gcp_cloud_audit_logging_removed_from_all_services


Description

Detect when GCP Cloud Audit logs are removed from all services at project or organization level. Audit logging helps organizations maintain security and minimize risk.

Query · yara_l

events:
    $gcp.metadata.event_type = "USER_RESOURCE_UPDATE_PERMISSIONS"
    $gcp.metadata.log_type = "GCP_CLOUDAUDIT"
    $gcp.metadata.product_event_type = "SetIamPolicy"
    $gcp.security_result.action = "ALLOW"
    $gcp.security_result.detection_fields["action"] = "REMOVE"
    $gcp.security_result.detection_fields["SERVICE"] = "allServices"
    $gcp.target.resource.attribute.labels["ser_type"] = "type.googleapis.com/google.iam.v1.logging.AuditData"
    $gcp.target.application = "cloudresourcemanager.googleapis.com"

  outcome:
    //Increase risk score if it is organization wide
    $risk_score = max(45 +
      if($gcp.target.resource.name = /organizations/,30,0)
    )
    $mitre_attack_tactic = "Defense Evasion"
    $mitre_attack_technique = "Impair Defenses: Disable Cloud Logs"
    $mitre_attack_technique_id = "T1562.008"
    $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 = $gcp.principal.user.userid
    $principal_user_display_name = $gcp.principal.user.user_display_name
    $target_resource_name = $gcp.target.resource.name
    $event_name = $gcp.metadata.product_event_type

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

  meta:
    author = "Google Cloud Security"
    description = "Detect when GCP Cloud Audit logs are removed from all services at project or organization level. Audit logging helps organizations maintain security and minimize risk."
    rule_id = "mr_6ffed437-4666-433f-8ba8-b6043daef4c5"
    rule_name = "GCP Cloud Audit Logging Removed From All Services"
    mitre_attack_tactic = "Defense Evasion"
    mitre_attack_technique = "Impair Defenses: Disable Cloud Logs"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1562/008/"
    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_UPDATE_PERMISSIONS"
    $gcp.metadata.log_type = "GCP_CLOUDAUDIT"
    $gcp.metadata.product_event_type = "SetIamPolicy"
    $gcp.security_result.action = "ALLOW"
    $gcp.security_result.detection_fields["action"] = "REMOVE"
    $gcp.security_result.detection_fields["SERVICE"] = "allServices"
    $gcp.target.resource.attribute.labels["ser_type"] = "type.googleapis.com/google.iam.v1.logging.AuditData"
    $gcp.target.application = "cloudresourcemanager.googleapis.com"

  outcome:
    //Increase risk score if it is organization wide
    $risk_score = max(45 +
      if($gcp.target.resource.name = /organizations/,30,0)
    )
    $mitre_attack_tactic = "Defense Evasion"
    $mitre_attack_technique = "Impair Defenses: Disable Cloud Logs"
    $mitre_attack_technique_id = "T1562.008"
    $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 = $gcp.principal.user.userid
    $principal_user_display_name = $gcp.principal.user.user_display_name
    $target_resource_name = $gcp.target.resource.name
    $event_name = $gcp.metadata.product_event_type

  condition:
    $gcp
}

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.