IAM policy evaluation
Identity vs resource policies, the explicit-deny evaluation order, conditions, permission boundaries, sts:AssumeRole chains. Read a policy and say what it actually allows.
The mental model
IAM is the bouncer at every door in AWS, and the thing to understand is that this bouncer starts by saying no to everyone and only lets you through if it can find an explicit written pass — and even then, one written "banned" note anywhere in the building overrides every pass you hold. That is the whole model in one sentence: default deny, explicit allow required, explicit deny always wins.
The analogy that makes policy evaluation click: getting into a high-security building. You need a pass from the building management (your identity policy — what your role is allowed to do). But the specific room you want also has its own guest list (the resource policy — who the S3 bucket or KMS key lets in). Your employer may have put a cap on your clearance that no individual pass can exceed (a permissions boundary). The organisation's head office may have declared some floors off-limits to the entire company (a Service Control Policy). And when you badge in with a temporary visitor pass, that pass itself may be scoped down further than your normal clearance (a session policy). To enter, every one of these that applies must permit it, and if any of them explicitly forbids it, you are out — no matter how many allows you hold.
Why this exists and why it is the single most-tested cloud interview topic: IAM is the perimeter in the cloud. There is no network wall that saves you if the identity model is wrong — an over-broad policy is a breach waiting to happen, and a subtly-wrong one is an outage. The skill interviewers probe is not "name the policy types" but "read this policy and tell me exactly what it allows, and debug why this call was denied." Getting the evaluation order right — deny-first, then the intersection of every applicable allow — is what separates someone who copies policies from Stack Overflow from someone who can reason about access.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision