Sub topic 6
Deny list versus allow list strategies
An SCP strategy is the rule you follow for deciding what the policies in your organization say. There are two: a deny list and an allow list. This chapter assumes you know how SCPs are attached and inherited. It also assumes you know that an SCP never grants permissions. It only sets the maximum that identity-based policies can grant. Here you will compare the two strategies, see how each one behaves, and choose between them.
The starting point: FullAWSAccess
When you enable SCPs, AWS attaches a managed policy named FullAWSAccess (policy ID p-FullAWSAccess) to the root, to every OU, and to every account. It looks like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "*",
"Resource": "*"
}
]
}This policy is why turning on SCPs does not break anything. Every level of the tree allows everything, so the ceiling on permissions is "all actions". The two strategies differ in what they do with this policy.
| Strategy | What happens to FullAWSAccess | What you add |
|---|---|---|
| Deny list | It stays attached everywhere | Deny statements for what you want to block |
| Allow list | You detach it | Allow statements for what you want to permit |
How a deny list works
In a deny list, you keep FullAWSAccess and attach SCPs that contain Deny statements. Everything is allowed unless something denies it.
The rules are simple:
- An explicit deny in any SCP on the path from the root to the account blocks the action. No lower level can undo it.
- You do not need to know every service your teams use. New AWS services and new actions are allowed by default.
- Each SCP you add narrows the ceiling a little further.
Here is a typical deny-list SCP. It protects logging by blocking the actions that turn CloudTrail off, with an exception for one administrative role:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyCloudTrailTampering",
"Effect": "Deny",
"Action": [
"cloudtrail:StopLogging",
"cloudtrail:DeleteTrail",
"cloudtrail:UpdateTrail",
"cloudtrail:PutEventSelectors"
],
"Resource": "*",
"Condition": {
"ArnNotLike": {
"aws:PrincipalArn": "arn:aws:iam::*:role/SecurityAdmin"
}
}
}
]
}The condition makes the deny apply to every principal except roles named SecurityAdmin. Exceptions like this are the usual way to give a trusted role a way through a deny. Without one, nobody in the affected accounts can perform the action.
Failure modes of a deny list
- Unknown actions slip through. If AWS launches a service that is risky for you, it is allowed until you write a deny for it.
- Conditions can be bypassed by omission. A deny that depends on a condition key only works if the key is present in the request context. Use operators such as
...IfExistsand test the policy when a key may be missing. - Policy size limits. An SCP can hold at most 5,120 characters, and you can attach at most five SCPs directly to a root, OU, or account. Long lists of denied actions can hit these limits. Inheritance gives you extra room, since policies attached higher up also apply.
How an allow list works
In an allow list, you detach FullAWSAccess and attach SCPs with Allow statements for the services you approve. Everything is blocked unless something allows it.
The command to detach the default policy from an OU looks like this:
aws organizations detach-policy \
--policy-id p-FullAWSAccess \
--target-id ou-exam-ple12345Detaching it without attaching a replacement leaves the OU with no allow at all. Every request from every account under it is then implicitly denied. Always attach the replacement first, then detach.
An example allow-list SCP:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowApprovedServices",
"Effect": "Allow",
"Action": [
"ec2:*",
"s3:*",
"logs:*",
"cloudwatch:*",
"kms:*",
"sts:*",
"iam:*"
],
"Resource": "*"
}
]
}The rule that catches people: every level must allow
For an action to pass SCP evaluation, an allow must exist at every level on the path: the root, each OU between the root and the account, and the account itself. The effective ceiling is the intersection of what each level allows.
KMS is blocked because the OU does not allow it. S3 is blocked because the account does not allow it. Lambda is blocked because the root and OU do not allow it. If you grant a new service at the account level but forget the root, the service still fails.
This makes allow lists more work to maintain. Each new service a team needs means editing policies at several levels, though a common pattern keeps the broad allow high in the tree and uses narrower allows lower down.
Allow statements have a restricted syntax
Historically, an Allow statement in an SCP could not use a Condition or a Resource other than "*", and the allow list was therefore limited to service and action names. AWS has been extending SCP syntax, so check the current SCP syntax page for what an Allow statement supports before you design around either limit. A Deny statement has never had these limits, so conditions such as Region or tag checks have lived in denies.
Comparing the two
| Question | Deny list | Allow list |
|---|---|---|
| Default stance | Allowed unless denied | Denied unless allowed |
| New AWS services | Usable immediately | Unusable until you add them |
| Effort to maintain | Low; add a deny when a risk appears | High; edit allows as teams need services |
| Risk of outage when changing policy | Lower; adding a deny affects only that action | Higher; removing an allow or detaching FullAWSAccess blocks broadly |
| Fits | Most organizations | Regulated or tightly scoped environments |
| Auditing "what can they do" | Hard; you must read the denies and subtract | Easier; the allow list is the answer, before IAM policies narrow it |
Mixing the strategies
You do not need one strategy across the whole tree. A common design is:
- Keep
FullAWSAccessat the root and in most OUs, and use deny SCPs for organization-wide rules such as the Region restriction and protection of logging. - For a sensitive OU, such as a regulated workload, detach
FullAWSAccessfrom that OU only and attach an allow-list SCP there.
Remember that the allow requirement applies at every level below the point where you detach. If you detach FullAWSAccess from the OU, accounts inside it also need an allow at the account level. A FullAWSAccess that remains attached to each account supplies that. The OU's allow list then does the restricting, because the effective ceiling is the intersection of the levels.
Deny statements work the same in both strategies. An allow-list organization can still attach deny SCPs, and a deny always wins over an allow.
Choosing a strategy
Start with a deny list unless you have a clear reason not to. The reasons to use an allow list are usually external: a compliance rule that requires an approved-service register, or an OU such as a sandbox or a regulated environment where you want a short, auditable list of permitted services.
Questions that help you decide:
- Does your team have capacity to update allow lists when developers request a new service? If not, an allow list becomes a source of delays.
- Is the risk you want to control a short list of known-bad actions? Then deny those.
- Is the risk "anything we have not reviewed"? Then an allow list fits.
- Can you test changes in a separate OU first? Allow-list changes carry more risk, so a test OU matters more there.
Exercise
An OU has FullAWSAccess detached and one SCP attached that allows ec2:* and s3:*. The root still has FullAWSAccess. An account in the OU has an IAM role with a policy allowing dynamodb:*. Can the role call dynamodb:GetItem? What if the OU SCP is changed to also allow dynamodb:*?
Show answer
No in the first case. The OU SCP does not allow DynamoDB, and with FullAWSAccess detached from the OU there is no other allow at that level, so the request is implicitly denied by the SCP no matter what the IAM policy says. After adding dynamodb:* to the OU SCP, the SCP ceiling includes DynamoDB, provided the account itself still has an allow (for example FullAWSAccess attached to the account). The role's IAM policy then grants the action, so the call succeeds.
Exercise
You plan to move an OU from a deny list to an allow list. Why should you attach the new allow-list SCP before you detach FullAWSAccess, and what would happen if you did it in the other order?
Show answer
If you detach FullAWSAccess first, the OU has no SCP that allows anything, so every request from accounts in the OU is implicitly denied until the replacement is attached. Attaching the allow-list SCP first keeps a valid allow at that level during the change, so only the actions you did not list become blocked.