Enhanced AccessDenied message
often confused with encoded authorization messageA plain-text error of the form User X is not authorized to perform Y on resource Z because …, including the policy type, and the policy ARN when available.
- “with an explicit deny in a type policy” → a Deny statement matched; find and narrow it.
- “because no type policy allows the action” → nothing in that layer allowed it; add an Allow there.
- If the message includes a policy ARN, check that policy; if not, check all policies of that type.
- Some services (notably EC2) return an encoded message instead; decode it with
aws sts decode-authorization-message(needssts:DecodeAuthorizationMessage).
| Enhanced message | Encoded authorization message | |
|---|---|---|
| Looks like | Readable sentence with policy type | Long encoded blob |
| Typical service | S3, IAM, most services | EC2 (Client.UnauthorizedOperation) |
| How to read | Just read it | sts:DecodeAuthorizationMessage |
| Shows | Policy type (+ ARN sometimes) | allowed, explicitDeny, principal, action, resource, condition values |
- Adding more Allow statements when the message says “explicit deny”. An Allow never beats a Deny.
- Editing the identity policy when the message says “no resource-based policy allows” (cross-account) or “no permissions boundary allows”.
- Forgetting the trust policy: “not authorized to perform sts:AssumeRole” is about the role's trust policy (or the caller's policy).
- Thinking every service gives the full message. Some still don't; fall back to CloudTrail.
- Fix the right layer first time.
- Faster incident response.
- Ordering questions on the exam often start with “read the error message”.