AWS KMS Key Policy Updated via PutKeyPolicy
Description
Identifies successful PutKeyPolicy calls on AWS KMS keys. The key policy is a resource-based policy that controls which principals can use the key for cryptographic operations and administration. Adversaries with "kms:PutKeyPolicy" may add or broaden principals (including external accounts) to decrypt or exfiltrate data protected by the key, or to preserve access after other credentials are rotated. This is distinct from disabling or scheduling deletion of the key.
Query · kuery
event.dataset: "aws.cloudtrail"
and event.provider: "kms.amazonaws.com"
and event.action: "PutKeyPolicy"
and event.outcome: "success"
and not aws.cloudtrail.user_identity.type: "AWSService"
and not user_agent.original: (*Terraform* or *Pulumi*)
Investigation fields
Pivot points the source recommends for triage.
@timestampuser.nameuser_agent.originalsource.ipaws.cloudtrail.user_identity.arnaws.cloudtrail.user_identity.typeaws.cloudtrail.user_identity.access_key_idaws.cloudtrail.resources.arnaws.cloudtrail.resources.typeevent.actionevent.outcomecloud.account.idcloud.regionaws.cloudtrail.request_parametersaws.cloudtrail.response_elements
Known false positives
- Security, platform, and encryption teams legitimately update KMS key policies during onboarding, key rotation, or cross-account access design. Review the policy document diff, ticketing, and whether new principals are in-org.
Analyst notes
Investigating AWS KMS Key Policy Updated via PutKeyPolicy
PutKeyPolicy replaces the entire key policy for a customer managed KMS key (and is used in limited scenarios for AWS
managed keys). Unexpected changes can grant kms:Decrypt, kms:GenerateDataKey, or administrative actions to new
identities.
Possible investigation steps
- Identify the key from
aws.cloudtrail.resources.arnoraws.cloudtrail.request_parameters.keyId. - Inspect
policyinaws.cloudtrail.request_parameters(or related fields) for newPrincipal,AWS, orkms:CallerAccountentries and cross-account ARNs. - Determine which data stores use the key (S3, EBS, RDS, Secrets Manager, etc.) via CMK aliases or CMDB.
- Correlate with
iam:AttachRolePolicy,sts:AssumeRole, or data-plane access from newly added principals.
False positive analysis
- Planned multi-account encryption patterns; confirm recipient accounts are approved.
Response and remediation
- If unauthorized: restore a known-good policy from backup or IAM/KMS change history, remove rogue principals, and
restrict
kms:PutKeyPolicyto break-glass roles.