AWS › IAM

How does IAM policy evaluation logic determine the final outcome when a user has multiple applicable policies, including identity based and resource based policies?

Intermediate

Answer

IAM evaluates all applicable policies together, starting with an implicit deny by default, meaning access is denied unless something explicitly allows it, then checks for any explicit Deny statement across all applicable policies, which always overrides any Allow, and finally checks whether any policy, whether identity based, resource based, or a permissions boundary, contains an explicit Allow for the requested action, with an explicit Deny anywhere in this evaluation always taking absolute precedence over any Allow.
// Evaluation order simplified
// 1. Implicit deny by default
// 2. Explicit deny anywhere overrides everything
// 3. Explicit allow required from at least one applicable policy
Real-world example A developer troubleshooting an unexpected access denied error discovers that while their user's identity based policy allowed the action, a separate service control policy at the organization level contained an explicit deny for that same action, which correctly overrode the otherwise permitted access.

Common follow-ups: What is a permissions boundary and how does it fit into this evaluation logic?;How do you effectively debug why a specific request was unexpectedly denied?