google_workspace_suspicious_login_and_google_drive_file_download


Description

Identifies when a Google Workspace user downloads a file from Google Drive after a suspicious login event occurred.

Query · yara_l

events:
    // Suspicious Login Event
    $login.metadata.vendor_name = "Google Workspace"
    $login.metadata.product_name = "login"
    $login.metadata.product_event_type = "login_success"
    $login.about.labels["is_suspicious"] = "true"

    // Document Download Event
    $download.metadata.vendor_name = "Google Workspace"
    $download.metadata.product_name = "drive"
    $download.metadata.product_event_type = "download"

    // Joining login and download events using userid
    $login.target.user.userid = $download.principal.user.userid

    // Placeholders for match section
    $login.principal.ip = $principal_ip
    $login.target.user.userid = $target_userid

    // First login event occurs later a download event
    $login.metadata.event_timestamp.seconds < $download.metadata.event_timestamp.seconds

  match:
    $target_userid, $principal_ip over 1h

  outcome:

    $risk_score = max(75)
    $mitre_attack_tactic = "Exfiltration"
    $mitre_attack_technique = "Exfiltration Over Web Service"
    $mitre_attack_technique_id = "T1567"
    $event_count = count_distinct($download.metadata.id)
    $product_event_type = array_distinct($download.metadata.product_event_type)
    $userid = array_distinct($download.principal.user.userid)
    $doc_type = array_distinct($download.src.resource.attribute.labels["doc_type"])
    $owner = array_distinct($download.target.resource.attribute.labels["owner"])
    $doc_name = array_distinct($download.target.resource.name)
    $doc_id = array_distinct($download.target.resource.product_object_id)

  condition:
    $login and $download
Raw source google_workspace_suspicious_login_and_google_drive_file_download · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule google_workspace_suspicious_login_and_google_drive_file_download {

  meta:
    author = "Google Cloud Security"
    description = "Identifies when a Google Workspace user downloads a file from Google Drive after a suspicious login event occurred."
    rule_id = "mr_3c55c930-d9be-4d34-a90e-baf92c22ae40"
    rule_name = "Google Workspace Suspicious Login and Google Drive File Download"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "Exfiltration Over Web Service"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1567/"
    mitre_attack_version = "v13.1"
    type = "Alert"
    data_source = "Workspace Activity"
    severity = "High"
    priority = "High"

  events:
    // Suspicious Login Event
    $login.metadata.vendor_name = "Google Workspace"
    $login.metadata.product_name = "login"
    $login.metadata.product_event_type = "login_success"
    $login.about.labels["is_suspicious"] = "true"

    // Document Download Event
    $download.metadata.vendor_name = "Google Workspace"
    $download.metadata.product_name = "drive"
    $download.metadata.product_event_type = "download"

    // Joining login and download events using userid
    $login.target.user.userid = $download.principal.user.userid

    // Placeholders for match section
    $login.principal.ip = $principal_ip
    $login.target.user.userid = $target_userid

    // First login event occurs later a download event
    $login.metadata.event_timestamp.seconds < $download.metadata.event_timestamp.seconds

  match:
    $target_userid, $principal_ip over 1h

  outcome:

    $risk_score = max(75)
    $mitre_attack_tactic = "Exfiltration"
    $mitre_attack_technique = "Exfiltration Over Web Service"
    $mitre_attack_technique_id = "T1567"
    $event_count = count_distinct($download.metadata.id)
    $product_event_type = array_distinct($download.metadata.product_event_type)
    $userid = array_distinct($download.principal.user.userid)
    $doc_type = array_distinct($download.src.resource.attribute.labels["doc_type"])
    $owner = array_distinct($download.target.resource.attribute.labels["owner"])
    $doc_name = array_distinct($download.target.resource.name)
    $doc_id = array_distinct($download.target.resource.product_object_id)

  condition:
    $login and $download
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.