๐ก๏ธ AWS IAM Role Inline Policy allows KMS decryption actions on all KMS keys๐ข
- Contextual name: ๐ก๏ธ Role Inline Policy allows KMS decryption actions on all KMS keys๐ข
- ID:
/ce/ca/aws/iam/role-inline-policy-allows-kms-decrypt-on-all-keys - Tags:
- ๐ข Policy with categories
- ๐ข Policy with type
- ๐ข Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicโ
- ๐ง prod.logic.yaml๐ข
Similar Policiesโ
- AWS Security Hub: [KMS.2] IAM principals should not have IAM inline policies that allow decryption actions on all KMS keys
Descriptionโ
Descriptionโ
This policy checks whether an IAM role inline policy allows KMS decryption actions on all AWS KMS keys.
Rationaleโ
IAM role inline policies should follow least privilege and grant access only to the KMS keys that a workload, service, or automation path explicitly requires.
If a role inline policy allows
kms:Decrypt,kms:ReEncryptFrom, or broader KMS decryption-related actions against*or wildcard KMS key ARNs, any principal that can assume the role can potentially decrypt data protected by keys outside its intended boundary. This increases the blast radius of role compromise, policy misconfiguration, and privilege escalation.Impactโ
Restricting wildcard KMS access can require updates to applications, automation, cross-service integrations, or delegated administration workflows that currently rely on broad permissions. Before tightening the policy, identify the exact KMS keys the role must use and validate the updated access in a non-production environment when possible.
Auditโ
This policy flags an AWS IAM Role Policy as
INCOMPLIANTwhen all of the following are true:... see more
Remediationโ
Remediationโ
Restrict KMS key scopeโ
Perform the following to update the IAM role inline policy by replacing wildcard KMS resources with the specific KMS key ARNs that should be allowed and, where possible, narrowing broad KMS actions.
From Command Lineโ
Retrieve the current inline policy document:
aws iam get-role-policy \
--role-name {{role-name}} \
--policy-name {{policy-name}}Update the policy document so that KMS decryption permissions are limited to only the specific KMS key ARNs that the role requires.
Apply the updated inline policy:
aws iam put-role-policy \
--role-name {{role-name}} \
--policy-name {{policy-name}} \
--policy-document file://policy.jsonNotesโ
Grant
kms:Decryptandkms:ReEncryptFromonly for the KMS keys that the role inline policy should allow.Where possible, also narrow the allowed actions so the policy does not rely on broad permissions such as
kms:*orkms:ReEncrypt*.