AWS Certified Solutions Architect – Professional
How SCP inheritance and evaluation work for SAP-C03
The AWS Organizations user guide says an action is allowed in an account only if an SCP allows it at every level: the root, each OU on the path, and the account itself. A Deny at any of those levels blocks the action for everything underneath it. SCPs never grant permissions.
Why an Allow has to exist at every level
When SCPs are enabled, AWS Organizations attaches the AWS managed policy FullAWSAccess to every root, OU and account as it is created. It allows all services and actions. Evaluation is deny by default: an action that is not explicitly allowed at the root, at each OU on the direct path, and at the account is denied.
Replace FullAWSAccess on one OU with a list of allowed services, and every account below that OU is held to the list. That includes accounts in child OUs that still carry FullAWSAccess themselves. To open one more service to those accounts, add it at the level that leaves it out. An Allow attached above or below that level changes nothing, because each level is checked on its own.
The same holds at the root. In the AWS example, two allow-list SCPs at the root allow IAM, Amazon EC2, Amazon S3 and CloudWatch, and the accounts get only those four even though the OUs keep FullAWSAccess. If you remove FullAWSAccess at a level and put nothing in its place, every action from the accounts under that level fails. A root that carries only a Deny statement and no Allow gives member accounts no service access at all.
How a Deny is inherited
A Deny in any SCP at the root, at an OU on the path, or at the account blocks the permission. A Deny attached to an OU is evaluated for every OU and account beneath it. An Allow lower down does not bring the permission back. In the AWS example the root denies S3 and a child OU's only SCP allows S3, so the account in that OU ends up with no access to any service.
This decides where a Deny goes. To take a service away from one account while its sibling accounts keep it, attach the Deny to that account. A Deny on the OU removes the service from every account in the OU, and Allow policies on the other accounts cannot restore it.
AWS recommends that you do not attach an SCP to the root without testing it. Create an OU, move accounts into it a few at a time, and check service last accessed data in IAM or CloudTrail logs to see which services the accounts use.
What SCPs do not restrict
SCPs have no effect on users or roles in the management account, even when the policy is attached to the root. They do apply to member accounts that are delegated administrators. In member accounts they limit every IAM user and role and the account's root user, including a principal that holds AdministratorAccess.
SCPs do not affect service-linked roles. They also do not affect principals from accounts outside the organization. If a bucket policy in a member account grants access to an outside account, the SCP on the member account does not apply to those outside users.
An SCP only limits. A user with no IAM permission policy has no access even when the SCPs allow everything. This is why a single Deny SCP at the root, with FullAWSAccess left in place at every level, removes one thing and leaves every other permission that account administrators grant working as before.
Region-deny SCPs and exemption conditions
The usual Region restriction is a Deny statement with a StringNotEquals condition on aws:RequestedRegion that lists the approved Regions. Written against all actions, it also breaks global services. IAM has a single endpoint in us-east-1, so IAM calls are always made to us-east-1 and fail the Region test. The aws:RequestedRegion key is always present in the request context, so the cause is the Region value, not a missing key.
The AWS example policy fixes this with NotAction in the Deny statement. It lists cloudfront:*, iam:*, organizations:*, route53:* and support:*, and AWS says to add any other global services you use, such as budgets, globalaccelerator or waf. The Deny then covers every action except the listed ones.
To let one role work in every Region, add a second condition to the same Deny statement, for example ArnNotLike on aws:PrincipalArn with the role's ARN. Condition operators in one statement are combined with a logical AND, so the Deny applies only when the Region is outside the list and the caller is not that role. For a role, aws:PrincipalArn holds the ARN of the role, in the form arn:aws:iam::123456789012:role/role-name. AWS says not to use the assumed-role session ARN as the value, so the role ARN matches whatever session name is in use.
AWS also notes that aws:RequestedRegion controls which endpoint is called, not the effect of the operation. s3:PutBucketReplication is called in one Region and affects others.
Where the exam catches people
- Believing an Allow SCP on a child OU or account adds a service that a parent OU's allow list leaves out: the Allow must exist at every level, so the parent's list is what has to change.
- Believing an Allow lower in the tree overrides a Deny attached higher up: a Deny at any level applies to every OU and account beneath it.
- Believing an SCP attached to the root restricts the management account: SCPs do not affect users or roles in the management account.
- Believing a Region-deny SCP on all actions is safe: IAM, Route 53 and CloudFront calls go to us-east-1 and are denied unless
NotActionlists those services. - Believing a role exemption must match the role session ARN:
aws:PrincipalArnreturns the role's ARN for a role session, so the condition names the role.