Identity and Access Management · Topic 4 of 6
Policy Types and Evaluation Logic
Learn how AWS evaluates identity, resource, SCP, RCP, boundary and session policies, with same account and cross account rules and deny precedence.
- 6 min
- Includes a diagram
- Explicit deny beats every allow, in any policy.
- SCPs, RCPs, boundaries and session policies filter permissions and never grant them.
- In one account, a resource policy that names an IAM user can grant access without an identity policy.
What it is
Every AWS request is checked against all applicable policies. The result is deny unless something allows the request and nothing denies it.
Knowing the policy types and the order of evaluation is the foundation for almost every authorization question on the exam.
How it works
The policy types
| Policy type | Attached to | Effect on permissions |
|---|---|---|
| Identity based | User, group or role | Grants permissions to that identity |
| Resource based | A resource, such as an S3 bucket, KMS key or SQS queue | Grants permissions to named principals, including other accounts |
| Permissions boundary | A user or role | Sets the maximum that identity policies can grant |
| Service control policy (SCP) | Organization, OU or account | Sets the maximum for principals in member accounts |
| Resource control policy (RCP) | Organization, OU or account | Sets the maximum for supported resources in member accounts |
| Session policy | Passed when assuming a role or federating | Reduces the permissions of one session |
| Endpoint policy | A VPC endpoint | Limits what can pass through that endpoint |
SCPs, RCPs, boundaries and session policies never grant anything on their own. They only filter what other policies grant.
The evaluation order
For a request in one account, AWS evaluates in this logic.
- Explicit deny. If any applicable policy denies the action, the answer is deny. This always wins.
- SCPs. If the account is in an organization, the SCPs must allow the action.
- RCPs. For supported resources, the resource control policies must allow it too.
- Resource based policy. In the same account, a resource policy that names an IAM user can allow the request by itself.
- Identity based policy. Otherwise an identity policy must allow the action.
- Permissions boundary. If the principal has a boundary, it must allow the action.
- Session policy. If the session has one, it must allow the action.
- Default. Anything else is an implicit deny.
In short, an identity policy grant must pass through the SCP, RCP, boundary and session filters, and a request that matches none of the allows is denied.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": ["iam:*", "organizations:*", "sts:*", "support:*", "cloudfront:*", "route53:*"],
"Resource": "*",
"Condition": { "StringNotEquals": { "aws:RequestedRegion": ["us-east-1", "eu-west-1"] } }
}]
}
This SCP denies actions in any other Region, while exempting global services that work from us-east-1. Because it is a deny, it cannot be overridden by an allow elsewhere.
Cross account access
For a principal in account A to use a resource in account B, both sides must allow it. The identity policy (and any boundary or SCP) in account A must allow the call, and the resource policy in account B must allow account A or its principal.
A role is an alternative. The principal assumes a role in account B, and then acts as that role under account B's rules, so only the role's policies in B matter after the assume step.
SCP and RCP details
- SCPs affect principals in member accounts, including the root user of those accounts. They do not affect the management account.
- SCPs do not affect service linked roles.
- An SCP allow list approach removes
FullAWSAccessand lists permitted services, and a deny list approach keepsFullAWSAccessand adds denies. Both work, and the deny list is easier to run. - RCPs apply to supported resources in member accounts, even when the caller is an outside principal. They help enforce a data perimeter, such as requiring TLS or blocking access from outside the organization.
- Neither SCPs nor RCPs apply to the management account.
Permission boundaries and session policies
A permissions boundary limits the maximum permissions of a user or role, and it is the basis of safe delegation: a developer may create roles, but only roles that carry the boundary. Effective permissions are the intersection of the identity policy and the boundary.
A session policy narrows one session. A role session's effective permissions are the intersection of the role's identity policy, its boundary if any, and the session policy.
Notable exceptions
- KMS keys. A key policy is required. If the key policy does not allow the account to use IAM policies, identity policies alone cannot grant access.
- Anonymous requests. Only resource policies can allow unauthenticated principals, as in a public bucket.
What to remember for the exam
- Explicit deny beats every allow, in any policy.
- SCPs, RCPs, boundaries and session policies filter permissions and never grant them.
- In one account, a resource policy that names an IAM user can grant access without an identity policy.
- Cross account access requires an allow on both sides, or the use of an assumed role in the target account.
- SCPs do not affect the management account or service linked roles, but they do affect member account root users.
- RCPs control access to supported resources, including by external principals.
- Effective permissions are the intersection of the identity policy with boundary, session policy and SCP.
- A KMS key policy must permit the use of IAM policies, or name the principal directly.
Draw the intersection for any "why is this denied" question: identity policy, boundary, session policy and SCP must all allow, and one explicit deny anywhere ends it.
Common mistakes
Assuming an SCP grants access. It only sets a ceiling, so you still need an identity or resource policy.
Expecting SCPs to restrict the management account. They do not, which is why you keep workloads out of it.
Forgetting both sides for cross account. An identity allow in A with no resource policy allow in B is denied.
Putting an allow where a deny is needed. To guarantee that something never happens, use an explicit deny, ideally in an SCP.
A boundary attached to a role that has no identity policy still grants nothing, so an empty identity policy with a broad boundary gives no access.
Check yourself
If an identity policy allows an action and an SCP does not, what happens?
The request is denied, because the SCP sets the maximum and the action is outside it.
What must be true for cross account access with a resource policy?
The calling account's identity policy must allow the call and the resource policy in the other account must allow the caller.
Which accounts do SCPs not restrict?
The organization management account, and service linked roles in any account.
Topic 4 of 6 in Identity and Access Management
Test yourself on Identity and Access Management
The full AWS SCS-C03 question bank has 858 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.