gcp_kms_decryption_by_unexpected_service_account
Description
Detects when a Key Management Service (KMS) decryption operation is carried out by a service account that's not in the allowlist. This behavior may indicate unauthorized access to information.
Query · yara_l
events:
$decrypt.metadata.product_name = "Google Cloud Platform"
$decrypt.metadata.vendor_name = "Google Cloud Platform"
// Generic KMS Key Pattern - Pick the relevant one to your environment
re.regex($decrypt.target.resource.name, `^projects/[^/]+/locations/[^/]+/keyRings/[^/]+/cryptoKeys/[^/]+$`)
$decrypt.metadata.product_event_type = "Decrypt"
not $decrypt.principal.user.email_addresses in %kms_decryption_service_account_allowlist
outcome:
$action = $decrypt.metadata.product_event_type
$account_name = array_distinct($decrypt.principal.user.email_addresses)
$mitre_attack_tactic = array_distinct("Persistence")
$mitre_attack_technique = array_distinct("Valid Accounts: Cloud Accounts")
$mitre_attack_technique_id = array_distinct("T1078.004")
condition:
$decrypt