Interview Prep/AWS/IAM and Access Errors

`AccessDenied` with message `explicit deny in a resource-based policy` for a KMS decrypt in a cross-account pipeline.

AdvancedTroubleshootingIAM and Access Errors
Answer

Likely causes → The key policy lacks the caller or has a deny condition on kms:ViaService or encryption context.

Diagnose →

aws kms get-key-policy --key-id <key> --policy-name default
aws kms list-grants --key-id <key>
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=Decrypt

Fix →

  1. Add the role ARN to the key policy or a grant
  2. Add the identity policy allow for kms:Decrypt
  3. Check encryption context

Prevent → Review key policies when granting cross-account S3 or EBS access.

aws All AWS questions Roadmap: AWS core services

More on IAM and Access Errors