aws-kms-can-administer-via-putkeypolicy
match (effective permission)
{
"action": "kms:PutKeyPolicy",
"resource_type": "AWS::KMS::Key"
}
where
DescribeKey.KeyManager == CUSTOMER (AWS-managed keys have immutable policies)
emit
| source type | Identity |
|---|---|
| target type | * |
| source | <principal> |
| target | <key node> |
| permissions | kms:PutKeyPolicy |
Narrative
{principal.name} can rewrite the key policy of {key.name} (kms:PutKeyPolicy) - self-grant Decrypt/Sign.
Raw rule rules/explicit/aws-kms.yaml
id: aws-kms-can-administer-via-putkeypolicy
emits: CanAdminister
applies_to:
- aws
match_effective_permission:
action: kms:PutKeyPolicy
resource_type: AWS::KMS::Key
where:
- DescribeKey.KeyManager == CUSTOMER (AWS-managed keys have immutable policies)
emit:
source_type: Identity
target_type: '*'
source: <principal>
target: <key node>
permissions:
- kms:PutKeyPolicy
narrative: "{principal.name} can rewrite the key policy of {key.name} (kms:PutKeyPolicy) \u2014 self-grant\
\ Decrypt/Sign."