Policy evaluation logic
often confused with network ACL rule orderThe fixed process AWS uses to combine all applicable policies into one decision: Allow or Deny.
- Start from deny by default.
- Look for any explicit Deny in all policies. Found → Deny.
- Check the RCPs, then the SCPs: each must allow.
- Look for an Allow in resource-based or identity-based policies.
- Check the permissions boundary and session policy if they exist.
- All passed → Allow.
Policies considered, by owner: RCPs of the account that owns the resource, SCPs of the account the principal belongs to, the resource-based policy, the principal's identity-based policies, its permissions boundary, and the session policy for temporary credentials.
| IAM evaluation | Network ACL | |
|---|---|---|
| Does order matter? | No. Statement and policy order are irrelevant | Yes. Rules run from the lowest number, first match wins |
| Deny vs Allow | Deny always wins | Whichever rule matches first wins |
| Default | Implicit deny | The final * rule denies |
| Applies to | API requests | Network packets in a subnet |
- Thinking the first matching statement wins, like a firewall.
- Thinking an Allow in one policy beats a Deny in another.
- Forgetting the RCP and SCP checks happen even when the identity has AdministratorAccess.
- Treating boundaries and session policies as grants.
- Troubleshoot AccessDenied step by step instead of guessing.
- Design guardrails knowing exactly where they apply.
- Explain to auditors why a request was or wasn't allowed.