Sub topic 7
How SCPs are inherited and evaluated, and why to prefer deny lists
This chapter assumes you know IAM policy basics (Allow, Deny, NotAction, conditions), the organization hierarchy of root, OUs and accounts, and the purpose of service control policies (SCPs) from the previous chapter. Here you will learn how several SCPs combine, how to predict whether a request is allowed, and why most organizations build their guardrails from deny statements.
SCPs filter permissions; they never grant them
An SCP does not give anyone access to anything. It defines the maximum permissions that identities in an account can have. A request succeeds only if two things are both true:
- The SCPs that apply to the account allow the action.
- An IAM identity-based or resource-based policy in the account also allows it.
The effective permissions are the intersection of the two. If an SCP allows s3:* but no IAM policy grants any S3 access, the request is denied. If an IAM policy grants ec2:* but the SCPs do not allow EC2, the request is denied.
Two facts about scope matter in practice:
- SCPs affect IAM users and roles in member accounts, including the account's root user. They do not affect the management account at all, even when attached to the root or to the OU that contains it.
- SCPs do not affect service-linked roles, and they do not affect principals outside the organization that reach your resources.
Inheritance: every level must allow
SCPs attach to the root, to an OU, or directly to an account. An account is governed by every SCP attached to the account itself, to its parent OU, to each ancestor OU, and to the root.
The rule is that an allow must be present at every level between the root and the account. Each level acts as a filter, and the permissions that pass through are the intersection of all filters. A deny at any level cannot be overridden by a lower level.
Child OUs can never gain permissions that a parent filtered out. Attaching an SCP with "Action": "*" to a child OU does not restore anything the parent removed. This is why the choice of which level to attach a policy to matters. A guardrail at the root applies everywhere. A guardrail on one OU applies only to that subtree.
The default FullAWSAccess policy
When you enable SCPs, AWS attaches a managed policy named FullAWSAccess to the root, to every OU and to every account. It contains a single statement that allows all actions on all resources:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}This is why enabling SCPs does not break anything at first. Every level allows everything, so the intersection is everything. You then have two ways to restrict access, and they lead to very different operating models.
Allow lists and deny lists
Allow-list strategy
In an allow list, you detach FullAWSAccess and attach SCPs that name exactly the services you permit. Anything not listed is implicitly denied. Because every level must allow, you must list the permitted actions at every level between the root and the account. If you detach FullAWSAccess from the root and attach an allow for s3:* and ec2:*, then an OU below it that has only FullAWSAccess removed and nothing else attached has no allow at all, so everything in that OU is denied.
This gives tight control but has real costs:
- Every new AWS service or action is blocked until you add it, so teams file requests and wait.
- Allow lists must be repeated or carefully nested across levels, which is easy to get wrong.
- Policy size limits (5,120 characters per SCP, and a limit of five SCPs per target) force you to compress actions with wildcards, which weakens the precision you wanted.
Deny-list strategy
In a deny list, you keep FullAWSAccess in place and add SCPs with explicit Deny statements for what you want to forbid. Everything else stays allowed, and IAM policies decide who gets what. This is the approach AWS recommends for most organizations, for these reasons:
- Explicit deny always wins. A
Denyin any SCP in the chain overrides any allow elsewhere, so you can attach a deny at the root and be sure it holds. - New services keep working. You do not need to update policies each time AWS launches a feature.
- Policies stay small. You list the few things that are dangerous, such as leaving the organization, disabling logging or using unapproved Regions.
- Fewer outage risks. A missing allow in an allow list silently breaks workloads. A missing deny only leaves a guardrail absent.
The trade-off is that you must know what to forbid. Deny lists protect against known bad actions, but they do not stop a developer from using a service you never thought about.
| Aspect | Allow list | Deny list |
|---|---|---|
| `FullAWSAccess` | Detached | Kept |
| Default for unlisted actions | Denied | Allowed (IAM still applies) |
| New AWS services | Blocked until added | Available immediately |
| Maintenance effort | High | Low |
| Main risk | Outages from missing allows | Gaps from unanticipated actions |
| Typical use | Small, highly regulated OUs | Organization-wide guardrails |
Many organizations combine them: a deny list across the organization, plus an allow list on a single sensitive OU such as a sandbox or a regulated workload group.
Reading a deny SCP
The deny-outside-approved-Regions policy from earlier in this tutorial shows the main building blocks:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": [
"iam:*",
"organizations:*",
"route53:*",
"cloudfront:*",
"support:*",
"budgets:*",
"sts:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["eu-west-1", "eu-central-1"]
}
}
}
]
}Read it as: deny every action except the listed global services, when the requested Region is not one of the two approved ones. NotAction with Deny is a common trick. It means "deny everything except these", and it lets global services that are served from us-east-1 keep working. Without the exemption, you would break IAM, Route 53 and billing tools.
Compare this with the simpler policy from the earlier chapter that denies only organizations:LeaveOrganization. Both use Deny with "Resource": "*", which is the usual shape.
Evaluation order in detail
For a single request from a principal in a member account, AWS evaluates roughly in this order:
- Is there an explicit
Denyin any applicable SCP, resource policy, permissions boundary, session policy or identity policy? If yes, the request is denied. - Does the chain of SCPs allow the action at every level (root, each OU, the account)? If any level lacks an allow, the request is denied.
- Does an identity-based or resource-based policy grant the action? If not, the request is denied.
- Otherwise the request is allowed.
Within one level, multiple SCPs are combined. An allow from any attached SCP at that level satisfies the level's allow requirement. A deny in any of them applies.
A worked example
Suppose the hierarchy is:
- Root:
FullAWSAccess - OU
Workloads:FullAWSAccessandDenyOutsideApprovedRegions - Account
prod-app1insideWorkloads:FullAWSAccess
A role in prod-app1 has an IAM policy allowing ec2:RunInstances. The table shows the outcome of three requests.
| Request | Root | Workloads OU | Account | IAM policy | Result |
|---|---|---|---|---|---|
| `ec2:RunInstances` in `eu-west-1` | Allow | Allow, no deny matches | Allow | Allow | Allowed |
| `ec2:RunInstances` in `us-west-2` | Allow | Explicit deny | Allow | Allow | Denied |
| `s3:GetObject` in `eu-west-1`, no IAM grant | Allow | Allow | Allow | No grant | Denied |
The second row shows that an account-level FullAWSAccess cannot undo the OU deny. The third row shows that SCPs never grant permissions.
Testing before you attach
Because SCPs can lock out people who need to fix things, test them first:
- Create a test OU with one throwaway account and attach the new policy there first.
- Use the IAM policy simulator or CloudTrail event history to check which API calls your workloads make before you deny them.
- Keep an exemption for a break-glass administrative role by adding a condition on
aws:PrincipalARN, for example"ArnNotLike": {"aws:PrincipalARN": "arn:aws:iam::*:role/BreakGlassAdmin"}.
Common errors
- Detaching
FullAWSAccesswithout a replacement allow. Every request in that subtree is denied, including those from administrators. - Expecting an SCP to grant access. The user still needs an IAM policy.
- Attaching a deny to the root and forgetting global services. Region denials without a
NotActionexemption break IAM, Route 53 and CloudFront. - Assuming the management account is protected. It is not covered by SCPs, so keep workloads out of it.
- Hitting limits. An SCP is limited to 5,120 characters and a target to five directly attached SCPs. Use wildcards, shorter
Sidvalues and several focused policies. - Mixing strategies accidentally. Removing
FullAWSAccesson one OU while the rest of the organization uses deny lists turns that OU into an allow list without anyone noticing.
Exercises
Exercise
An organization keeps FullAWSAccess at every level. An SCP on the Workloads OU denies all actions outside eu-west-1 and eu-central-1. A role in an account in that OU has an IAM policy allowing ec2:RunInstances. The role calls ec2:RunInstances in us-east-1. Is it allowed, and why?
Show answer
It is denied. The explicit deny in the OU's SCP applies to the account through inheritance, and an explicit deny overrides every allow, including the account's FullAWSAccess and the role's IAM policy.
Exercise
You detach FullAWSAccess from the root and attach an SCP allowing only s3: and ec2:. The OU below the root still has FullAWSAccess attached, and the account below it too. Can a role in that account, with an IAM policy allowing s3:GetObject, read an object? Can it call dynamodb:GetItem if its IAM policy allows it?
Show answer
It can call s3:GetObject, because the root allows s3:*, the OU and account allow everything, and the IAM policy grants it. It cannot call dynamodb:GetItem, because the root level has no allow for DynamoDB, and every level from the root to the account must allow the action.
Exercise
Give two reasons AWS recommends a deny-list strategy for most organizations, and one situation where an allow list is still a good fit.
Show answer
Deny lists keep new AWS services and features working without policy updates, and an explicit deny at a high level cannot be overridden below it, while policies stay short. An allow list fits a small, highly regulated OU, such as one for a compliance-bound workload, where only a known set of services should ever be used.