Certopolis

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 NotAction lists those services.
  • Believing a role exemption must match the role session ARN: aws:PrincipalArn returns the role's ARN for a role session, so the condition names the role.

Written from these sources

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A company's organization in AWS Organizations has a Workloads organizational unit (OU) under the root, and an Analytics OU inside the Workloads OU. On the Workloads OU only, the security team replaced FullAWSAccess with a service control policy (SCP) that allows Amazon EC2, Amazon S3, Amazon CloudWatch, AWS Lambda and Amazon DynamoDB actions. The root, the Analytics OU and every account keep the SCP that AWS Organizations attached when each was created. Every Analytics account now needs Amazon Simple Queue Service (Amazon SQS), and SQS calls from those accounts are denied by an SCP. Separately, the Analytics account that holds staging data must lose access to Lambda, while the other Analytics accounts keep it. Which combination of changes should the solutions architect make to meet these requirements? (Select TWO.)

    Right. In the game that’s Renown for your Security, Compliance, and Governance building.

    Not that one: B,D is right. In the game your Security, Compliance, and Governance building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    The one level that does not allow SQS is the Workloads OU's list, so adding sqs:* to that list is the change that opens SQS for the Analytics accounts. For Lambda, the staging account needs a deny. A deny attached at a level applies to that level and everything beneath it, so a deny on the staging account itself removes Lambda there and leaves every other Analytics account, which still gets Lambda through the Workloads list, untouched.

    Written from docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_evaluation.html

  2. A company must keep all workloads in eu-central-1 and eu-west-1. A solutions architect attaches a service control policy (SCP) to a test organizational unit (OU). Its deny statement covers every action whenever aws:RequestedRegion is not one of the two Regions. Workloads in the test accounts run normally, but administrators can no longer create IAM roles, change Amazon Route 53 records or update Amazon CloudFront distributions. An incident-response role exists in every account. The security team requires that role to keep working in all Regions during an investigation, while every other principal stays confined to the two Regions. Which combination of changes should the solutions architect make to the SCP setup? (Select TWO.)

    Right. In the game that’s Renown for your Security, Compliance, and Governance building.

    Not that one: D,E is right. In the game your Security, Compliance, and Governance building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Rewriting the statement with NotAction for those services, plus Organizations and Support, lifts them out of the deny while every Regional service stays confined. Second, the incident-response role: adding an ArnNotLike test on aws:PrincipalArn puts another condition on the same deny, and because every condition in a statement must be true for it to apply, the deny skips that role in any Region and any account.

    Written from docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws_deny-requested-region.html

  3. A company runs 140 member accounts in an organization in AWS Organizations with all features enabled. Business units administer their own accounts and give their engineers broad IAM permissions, including AdministratorAccess. Finance has found engineers launching very large Amazon EC2 instance types for short experiments. The company wants member accounts to be able to launch only instance types from the t3 and m5 families. The limit must apply to every IAM user and role and to each account's root user, and it must not change any other permission that the business units grant. The management account runs no workloads. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Security, Compliance, and Governance building.

    Not that one: D is right. In the game your Security, Compliance, and Governance building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    Because an SCP never grants anything, leaving the default full-access policy in place means every other permission keeps working as the business units set it, and the deny removes only launches of other instance types. SCPs do not touch the management account, which is acceptable because it runs no workloads.

    Written from docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html

Ask for something