gcp_bigquery_results_downloaded_from_multiple_tables


Description

Detect a user downloads GCP BigQuery results from multiple tables which might indicate data exfiltration activity.

Query · yara_l

events:
    $gcp.metadata.event_type = "USER_RESOURCE_ACCESS"
    $gcp.metadata.log_type = "GCP_CLOUDAUDIT"
    $gcp.metadata.product_event_type = "jobservice.getqueryresults"
    $gcp.metadata.product_name = "BigQuery"
    $gcp.security_result.action = "ALLOW"
    $gcp.principal.user.userid = $user_id

  match:
    $user_id 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($gcp.metadata.id)
    $network_http_user_agent = array_distinct($gcp.network.http.user_agent)
    $principal_ip = array_distinct($gcp.principal.ip)
    $principal_ip_country = array_distinct($gcp.principal.ip_geo_artifact.location.country_or_region)
    $principal_ip_state = array_distinct($gcp.principal.ip_geo_artifact.location.state)
    $principal_user_id = array_distinct($gcp.principal.user.userid)
    $principal_user_display_name = array_distinct($gcp.principal.user.user_display_name)
    $target_resource_name = array_distinct($gcp.target.resource.name)
    $event_name = array_distinct($gcp.metadata.product_event_type)
    $bq_table_name = array_distinct($gcp.target.resource.name)
    $dc_bq_table_name = count_distinct($gcp.target.resource.name)

  condition:
    $gcp and $dc_bq_table_name > 3
Raw source gcp_bigquery_results_downloaded_from_multiple_tables · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
 rule gcp_bigquery_results_downloaded_from_multiple_tables {

  meta:
    author = "Google Cloud Security"
    description = "Detect a user downloads GCP BigQuery results from multiple tables which might indicate data exfiltration activity."
    rule_id = "mr_dc6b1f68-734d-4b4b-91c2-1675f2422c11"
    rule_name = "GCP BigQuery Results Downloaded From Multiple Tables"
    mitre_attack_tactic = "Exfiltration"
    mitre_attack_technique = "Exfiltration Over Web Service"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1567/"
    mitre_attack_version = "v14.1"
    type = "Alert"
    data_source = "GCP Cloud Audit"
    platform = "GCP"
    severity = "High"
    priority = "High"

  events:
    $gcp.metadata.event_type = "USER_RESOURCE_ACCESS"
    $gcp.metadata.log_type = "GCP_CLOUDAUDIT"
    $gcp.metadata.product_event_type = "jobservice.getqueryresults"
    $gcp.metadata.product_name = "BigQuery"
    $gcp.security_result.action = "ALLOW"
    $gcp.principal.user.userid = $user_id

  match:
    $user_id 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($gcp.metadata.id)
    $network_http_user_agent = array_distinct($gcp.network.http.user_agent)
    $principal_ip = array_distinct($gcp.principal.ip)
    $principal_ip_country = array_distinct($gcp.principal.ip_geo_artifact.location.country_or_region)
    $principal_ip_state = array_distinct($gcp.principal.ip_geo_artifact.location.state)
    $principal_user_id = array_distinct($gcp.principal.user.userid)
    $principal_user_display_name = array_distinct($gcp.principal.user.user_display_name)
    $target_resource_name = array_distinct($gcp.target.resource.name)
    $event_name = array_distinct($gcp.metadata.product_event_type)
    $bq_table_name = array_distinct($gcp.target.resource.name)
    $dc_bq_table_name = count_distinct($gcp.target.resource.name)

  condition:
    $gcp and $dc_bq_table_name > 3
}

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.