Explain the IAM policy evaluation logic.
AdvancedConceptIAM Advanced, STS and Multi-Account
Answer
Every request starts at implicit deny. AWS evaluates all applicable policies and the order of reasoning is:
- Any explicit Deny in any policy wins immediately.
- Organization SCPs/RCPs must allow the action (otherwise deny).
- Resource-based policy may grant access (same account: enough on its own for IAM roles/users in many cases).
- Identity-based policy must allow.
- Permission boundary must allow, if set.
- Session policy must allow, if passed.
The effective permission is the intersection of the restricting layers with the union of the granting ones. Remember: an Allow in an SCP never grants anything, it only permits.
More on IAM Advanced, STS and Multi-Account
How does cross-account access evaluation differ from same-account?AdvancedHow does `sts:AssumeRole` work, step by step?IntermediateWhat is the difference between AssumeRole, AssumeRoleWithWebIdentity and AssumeRoleWithSAML?IntermediateWhat is a permission boundary and when would you use one?IntermediateWhat do Service Control Policies do and not do?IntermediateDeny-list vs allow-list SCP strategy: which do you pick?Advanced