How AWS IAM policy evaluation works
AWS evaluates a request using the principal, requested action, resource, and policies that apply to that request. A useful starting point is that an explicitDenyoverrides anAllow. If no applicable policy grants the request, the result is generally an implicit deny. Which policy types participate—and how they combine—depends on the request context; AWS authorization is not one universal linear checklist.
What each policy layer does
- Identity-based policies
- Attach permissions to users, groups, or roles. They can grant actions, subject to other applicable controls.
- Resource-based policies
- Attach permissions to resources, such as an S3 bucket. Cross-account access generally requires authorization from both the caller’s account and the resource-owning account.
- Service control policies (SCPs)
- Set the maximum permissions available to principals in an AWS Organization. SCPs do not grant permissions themselves.
- Permissions boundaries
- Set the maximum permissions an identity-based policy can grant to a user or role. A boundary does not grant permissions by itself.
- Session policies
- When supported and supplied for a session, further limit permissions for that session; they do not add permissions beyond those available to the role or user.
Apply the ideas to the practice scenarios
- Cross-account S3 request: an identity policy allowing
s3:GetObjectdoes not erase an applicable explicit deny. Check the caller’s permissions, the bucket policy, and any organization guardrails that apply to the accounts. - Role with a permissions boundary: an identity policy may allow
dynamodb:PutItem, but a boundary that does not include that action limits the role from using it. - Assumed-role session: evaluate the role’s available permissions and any session policy supplied when the role was assumed. A session policy can narrow access; it does not independently grant new actions.