Skip to content

PutKeyPolicy

AWS

PutKeyPolicy

service: AWS - KMS
techniques:

Event

Modifies a KMS key policy to grant cross-account access or expand key usage permissions.

Security Context

  • KMS key policies are resource-based policies that can grant any AWS principal full cryptographic operations, enabling an attacker to decrypt sensitive data or grant cross-account access to encryption keys.
  • Modifying a key policy to add an external account effectively exfiltrates the ability to decrypt data without needing to move the encrypted data itself.

Log Source

CloudTrail

Sample Event

Adversarial — privilege escalation. Draco modifies the key policy on the production data KMS key (60000000-0000-4000-8000-000000000001) to add a statement allowing the adversary-controlled external account 555666661337 full kms:* permissions. With this, anyone in 555666661337 can decrypt any data encrypted under the prod data key — without needing any IAM identity in 555123456789. T1098.

{
"eventVersion": "1.09",
"userIdentity": {
"type": "IAMUser",
"principalId": "AIDADRAC0MALF0YBADGY",
"arn": "arn:aws:iam::555123456789:user/draco",
"accountId": "555123456789",
"accessKeyId": "AKIADRAC0MALF0YEXAMP5",
"userName": "draco",
"sessionContext": {
"attributes": {
"creationDate": "2026-04-15T21:42:08Z",
"mfaAuthenticated": "false"
}
}
},
"eventTime": "2026-04-16T00:11:53Z",
"eventSource": "kms.amazonaws.com",
"eventName": "PutKeyPolicy",
"awsRegion": "us-east-1",
"sourceIPAddress": "203.0.113.66",
"userAgent": "aws-cli/1.18.147 Python/3.7.10 Linux/5.4.0-1045-aws botocore/1.18.6",
"requestParameters": {
"keyId": "60000000-0000-4000-8000-000000000001",
"policyName": "default",
"policy": "{\n \"Version\" : \"2012-10-17\",\n \"Id\" : \"key-default-1\",\n \"Statement\" : [ {\n \"Sid\" : \"Enable IAM User Permissions\",\n \"Effect\" : \"Allow\",\n \"Principal\" : {\n \"AWS\" : \"arn:aws:iam::555123456789:root\"\n },\n \"Action\" : \"kms:*\",\n \"Resource\" : \"*\"\n }, {\n \"Sid\" : \"AllowExternalAccess\",\n \"Effect\" : \"Allow\",\n \"Principal\" : {\n \"AWS\" : \"arn:aws:iam::555666661337:root\"\n },\n \"Action\" : \"kms:*\",\n \"Resource\" : \"*\"\n } ]\n}",
"bypassPolicyLockoutSafetyCheck": false
},
"responseElements": null,
"requestID": "90000000-0000-4000-8000-000101110000",
"eventID": "90000000-0000-4000-8000-000101110001",
"readOnly": false,
"resources": [
{
"accountId": "555123456789",
"type": "AWS::KMS::Key",
"ARN": "arn:aws:kms:us-east-1:555123456789:key/60000000-0000-4000-8000-000000000001"
}
],
"eventType": "AwsApiCall",
"managementEvent": true,
"recipientAccountId": "555123456789",
"eventCategory": "Management",
"tlsDetails": {
"tlsVersion": "TLSv1.3",
"cipherSuite": "TLS_AES_128_GCM_SHA256",
"clientProvidedHostHeader": "kms.us-east-1.amazonaws.com"
}
}

MITRE ATT&CK Mapping

Tactics: Privilege Escalation

Techniques:
  • T1098 — Account Manipulation — Adversaries may manipulate accounts to maintain and/or elevate access to victim systems. Account manipulation may consist of any action that preserves or modifies adversary access to a compromised account, such as modifying credentials or permission groups. These actions could also include accoun...