IAM Permission Denied Cascade Playbook
A broad IAM policy change breaks multiple services simultaneously. Whether it's an SCP update, role policy modification, or permission boundary change - IAM cascades affect every service that assumed those permissions. This playbook covers rapid identification of the change, blast radius assessment, and rollback procedures.
Operator's Field Notes
Jeremy Martinez · Incident Commander | Principal Site Reliability Engineer
"IAM permission cascades are the scariest incidents because they break things that haven't been deployed or changed. A security team tightens an SCP or removes a policy, and suddenly three different services in three different teams all start throwing AccessDenied errors. Nobody connects the dots because nobody thinks 'IAM change' when their container can't pull from ECR."
"The fastest path to root cause: CloudTrail. Filter for IAM events (PutRolePolicy, AttachRolePolicy, DeleteRolePolicy, PutUserPolicy, CreatePolicy, UpdateAssumeRolePolicy) in the last hour. Cross-reference the timing with when errors started. Then use IAM Policy Simulator to confirm the new policy denies what the old one allowed."
First 5 Minutes - Triage
1. Find the IAM Change
# Search CloudTrail for recent IAM changes aws cloudtrail lookup-events \ --lookup-attributes AttributeKey=EventSource,AttributeValue=iam.amazonaws.com \ --start-time $(date -u -d '2 hours ago' +%Y-%m-%dT%H:%M:%S) \ --max-results 50 # Filter for policy modification events # Look for: PutRolePolicy, AttachRolePolicy, DetachRolePolicy, # DeleteRolePolicy, PutUserPolicy, CreatePolicyVersion, # UpdateAssumeRolePolicy, PutPermissionsBoundary # Check SCP changes (if using Organizations) aws cloudtrail lookup-events \ --lookup-attributes AttributeKey=EventSource,AttributeValue=organizations.amazonaws.com \ --start-time $(date -u -d '2 hours ago' +%Y-%m-%dT%H:%M:%S)
2. Assess Blast Radius
# If a role was modified, find all services using it aws iam get-role --role-name ModifiedRole # Check trust policy - who can assume this role? # Find resources using this role # EC2 instances with this instance profile aws ec2 describe-instances --filters "Name=iam-instance-profile.arn,Values=*ModifiedRole*" # ECS task definitions using this role aws ecs list-task-definitions --query 'taskDefinitionArns' # Then check each for the role ARN # Lambda functions using this role aws lambda list-functions --query 'Functions[?Role==`arn:aws:iam::ACCOUNT:role/ModifiedRole`]'
3. Verify with IAM Policy Simulator
# Test if the role can still do what it needs aws iam simulate-principal-policy \ --policy-source-arn arn:aws:iam::123456789012:role/ModifiedRole \ --action-names s3:GetObject ec2:DescribeInstances ecs:RunTask \ --resource-arns "*" # Compare results - "implicitDeny" means the permission was removed
Recovery - Rollback the IAM Change
Revert Policy Version
# If a managed policy was updated, roll back to previous version aws iam list-policy-versions --policy-arn arn:aws:iam::123456789012:policy/MyPolicy # Set the previous version as default aws iam set-default-policy-version \ --policy-arn arn:aws:iam::123456789012:policy/MyPolicy \ --version-id v3 # the previous version # If an inline policy was changed, restore it aws iam put-role-policy --role-name MyRole \ --policy-name MyInlinePolicy \ --policy-document file://original-policy.json # If a policy was detached, reattach it aws iam attach-role-policy --role-name MyRole \ --policy-arn arn:aws:iam::123456789012:policy/DetachedPolicy
Revert SCP Changes
# List SCP versions (SCPs don't have versions, so check CloudTrail) # Get the previous SCP content from CloudTrail event aws cloudtrail lookup-events \ --lookup-attributes AttributeKey=EventName,AttributeValue=UpdatePolicy # Update SCP back to original aws organizations update-policy --policy-id p-abc123 \ --content file://original-scp.json # Or detach the problematic SCP aws organizations detach-policy --policy-id p-abc123 \ --target-id ou-root-abcdef
Prevention
IAM Change Controls
- • All IAM changes through IaC (Terraform/CDK)
- • Peer review for policy modifications
- • IAM Access Analyzer for unused permissions
- • Test policy changes with Policy Simulator first
- • SCP changes require change advisory board
Monitoring
- • CloudTrail alarm on IAM policy changes
- • EventBridge rule for SCP modifications
- • Track AccessDenied errors in CloudWatch
- • Config rule for IAM policy compliance
- • Regular IAM credential reports