Policy Evaluation Logic
What you'll learn: How cloud platforms decide whether to grant or block access when multiple policies apply to the same request.
Why Evaluation Order Matters
When someone (or something) tries to access a cloud resource, the system may encounter multiple policies with conflicting instructions. Should it allow the action, deny it, or play it safe? Understanding the evaluation logic is crucial because even one misconfigured policy can accidentally lock out legitimate users or expose sensitive resources.
The Three-Step Evaluation Chain
Cloud IAM systems follow a predictable priority order when deciding on access:
1. Explicit Deny (Highest Priority)
If any policy contains a Deny effect for the requested action, access is immediately blocked—no questions asked. This is the nuclear veto. Think of it like a bouncer at a club: if your name is on the "do not admit" list, it doesn't matter how many VIP passes you hold.
2. Explicit Allow (Second Priority)
If there's no explicit deny, the system looks for an Allow statement that matches the action and resource. If found, access is granted.
3. Implicit Deny (Default)
If no policy explicitly allows the action and there's no explicit deny, access is denied by default. This is the "safe by default" principle—you must be explicitly granted permission to do anything.
Simple Mental Model
Think of it as a three-level filter:
- Red light (explicit deny) → Stop immediately
- Green light (explicit allow) → Proceed
- No light (implicit deny) → Stop by default
Key Takeaway: Cloud IAM evaluates permissions in strict order: explicit denies always win, explicit allows come second, and everything else is denied by default—this "deny by default" approach ensures security unless you explicitly grant access.