IAM Permission Denied Errors

Trace IAM AccessDenied errors through policy layers to find the blocking rule.

Overview

Overview

IAM AccessDenied is hard because one generic message covers five different root causes. AWS returns the same response whether the denial came from an explicit Deny, a missing Allow, a Service Control Policy, a permissions boundary or a session policy. Knowing the evaluation order is the foundation of diagnosis.

AWS evaluates every API request in the same order.

  • It looks for an explicit Deny anywhere: in identity policies, resource policies, SCPs and permissions boundaries. If it finds one, the request is denied, because an explicit Deny always wins.
  • If there is no explicit Deny, it looks for an Allow in the relevant policies. If it finds one, the request proceeds.
  • If no Allow exists, the request is denied anyway. This is an implicit deny.

Key concepts

  • Explicit Deny
  • Implicit Deny
  • Service Control Policy (SCP)
  • Permissions Boundary
  • IAM Policy Simulator

Interview questions

  • A developer says their IAM role has AdministratorAccess but still gets AccessDenied when trying to create an IAM role in a new AWS account. What are the possible causes and how do you diagnose?

Sign up free to read the full topic

More Troubleshooting topics

Start free on Cariara · Coding problems · System design studio