Policy Evaluation Logic and Precedence
You'll learn: How cloud providers combine multiple IAM policies to make a final allow-or-deny decision when someone tries to access a resource.
Why Multiple Policies Matter
In cloud environments, a single access request might be governed by several policies at once: an identity-based policy attached to your user, a resource-based policy on the S3 bucket you're trying to access, and perhaps an organization-level policy from above. The cloud provider must evaluate all of these simultaneously and decide: allow or deny?
The Evaluation Order
Cloud providers follow a strict precedence hierarchy:
1. Explicit Deny Wins
If any policy contains an explicit deny statement matching the request, access is immediately denied—no exceptions. Think of this as the emergency brake that overrides everything else.
2. Explicit Allow
If at least one policy grants an explicit allow (and no deny exists), access is permitted. Identity-based and resource-based policies are combined with a logical OR: either one can grant permission.
3. Default Deny
If no policy explicitly allows the action and no explicit deny exists, the request is denied by default. Silence means "no."
Real-World Example
Imagine you're trying to read a file in cloud storage:
- Your user policy: allows
storage:GetObject - The bucket policy: silent (no statement)
- An organizational policy: denies
storage:*on sensitive buckets
Result: Denied—the explicit organizational deny trumps your user-level allow.
Key Insight
The evaluation isn't additive—it's defensive. One explicit deny outweighs a thousand allows, and without any allows, you get nothing.
Key Takeaway: Cloud IAM evaluation follows "explicit deny > explicit allow > default deny"—understanding this precedence prevents privilege escalation and ensures least-privilege enforcement.