gcp_storage_bucket_opened_to_public
Description
Detect when Google Cloud Storage buckets are opened to public by adding allUsers or allAuthenticatedUsers to the access policy.
Query · yara_l
events:
$gcp.metadata.event_type = "USER_RESOURCE_UPDATE_PERMISSIONS"
$gcp.metadata.log_type = "GCP_CLOUDAUDIT"
$gcp.metadata.vendor_name = "Google Cloud Platform"
$gcp.metadata.product_name = "Google Cloud Storage"
$gcp.metadata.product_event_type = "storage.setIamPermissions"
$gcp.target.application = "storage.googleapis.com"
$gcp.security_result.action = "ALLOW"
$gcp.target.resource.attribute.labels["ser_binding_deltas_action"] = "ADD"
$gcp.target.resource.attribute.labels["ser_binding_deltas_role"] = /roles\/storage.*/
$gcp.target.resource.attribute.labels["ser_binding_deltas_member"] = /allUsers|allAuthenticatedUsers/
$gcp.target.resource.resource_type = "STORAGE_BUCKET"
outcome:
$risk_score = max(75)
$mitre_attack_tactic = "Defense Evasion"
$mitre_attack_technique = "Impair Defenses"
$mitre_attack_technique_id = "T1562"
$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