Interview Prep/AWS/IAM Advanced, STS and Multi-Account

Explain the IAM policy evaluation logic.

AdvancedConceptIAM Advanced, STS and Multi-Account
Answer

Every request starts at implicit deny. AWS evaluates all applicable policies and the order of reasoning is:

  1. Any explicit Deny in any policy wins immediately.
  2. Organization SCPs/RCPs must allow the action (otherwise deny).
  3. Resource-based policy may grant access (same account: enough on its own for IAM roles/users in many cases).
  4. Identity-based policy must allow.
  5. Permission boundary must allow, if set.
  6. Session policy must allow, if passed.

The effective permission is the intersection of the restricting layers with the union of the granting ones. Remember: an Allow in an SCP never grants anything, it only permits.

aws All AWS questions Roadmap: AWS core services

More on IAM Advanced, STS and Multi-Account