Certopolis

AWS Certified CloudOps Engineer – Associate

How SCPs are evaluated and what they cannot restrict

The AWS Organizations User Guide says a service control policy (SCP) never grants permissions. It sets the maximum permissions for IAM users and roles in member accounts, including the root user. An action needs an Allow at every level down to the account, and a Deny at any level blocks it. The management account and service-linked roles are exempt.

What does an SCP do and not do?

An SCP is a guardrail. The effective permissions are the intersection of what the SCPs allow and what identity-based and resource-based policies allow. A user with no IAM permission policy has no access even when the SCPs allow everything.

If an SCP blocks an action, a user or role in the account cannot use it, even with the AdministratorAccess policy attached. The member account's root user is restricted too.

SCPs are available only in an organization with all features enabled. They affect only principals managed by accounts in the organization, not users from outside accounts who are granted access by a resource-based policy.

How are Allow and Deny evaluated across levels?

For a permission to be allowed in an account, there must be an explicit Allow at every level in the direct path: the root, each OU, and the account itself. Evaluation is deny by default, so a level with no matching Allow blocks the action.

That is why AWS Organizations attaches the managed SCP FullAWSAccess to every root, OU and account when it is created. If it is removed at some level and not replaced with another policy that has allowed actions, every action from the accounts under that level fails. An SCP that contains only a Deny statement does not count as an Allow.

A Deny works the other way: an explicit Deny in any SCP on the path, at the root, an OU or the account, blocks the action for everything beneath it, whatever is allowed elsewhere.

To build an allow list, replace FullAWSAccess with an SCP that allows only chosen services. New AWS services then stay blocked until someone adds them.

What can an SCP not restrict?

SCPs have no effect on users or roles in the management account. They do apply to member accounts that are designated as delegated administrators.

SCPs do not affect any service-linked role. An action that a service performs with its service-linked role continues even when an SCP denies that action to the account's users and roles.

A few tasks are also exempt, such as registering for the Enterprise support plan as the root user. AWS recommends not attaching an SCP to the root of the organization without testing it first on an OU with a small number of accounts.

Where the exam catches people

  • Believing an SCP grants permissions: it only limits them. IAM policies must still grant access.
  • Detaching FullAWSAccess and leaving a Deny-only SCP: with no Allow at that level, every action from those accounts fails.
  • Expecting an SCP to stop a service-linked role, for example Auto Scaling terminating instances: SCPs do not affect service-linked roles.
  • Believing an SCP at the root restricts the management account: SCPs affect member accounts only.
  • Believing a delegated administrator account is exempt like the management account: it is a member account, so SCPs apply.

Written from these sources

Try 3 questions on this

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

  1. An SCP attached to a Production OU denies ec2:TerminateInstances to prevent accidental deletions. In one Production account, IAM users, roles and the account's root user all get access denied when they try to terminate an instance. An EC2 Auto Scaling group in the same account still terminates instances at every scale-in. What is a reason for this behavior?

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

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

    Show the full explanation and doc quotes

    Service-linked roles sit outside SCP control, so scale-in carries on.

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

  2. An SCP attached to an organization's root denies ec2:CreateVpc. Network administrators have always created VPCs from the management account. To keep daily work out of that account, the company registers its Network member account as a delegated administrator and moves the administrators there. Their role in Network has AdministratorAccess, yet CreateVpc now fails with access denied. The restriction must keep applying to every other member account. Which action should the SysOps administrator take to meet these requirements?

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

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

    Show the full explanation and doc quotes

    A condition on the deny statement that leaves out requests from the Network account's principals lets them create VPCs while every other member account stays blocked.

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

  3. Each member account in a company's Apps OU has two SCPs attached: FullAWSAccess and DenyLeave, which denies only organizations:LeaveOrganization. The organization root and the Apps OU also carry FullAWSAccess. To reduce clutter, a SysOps administrator plans to detach FullAWSAccess from every Apps account and keep DenyLeave attached to each one. Which of the following describes the result of this change?

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

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

    Show the full explanation and doc quotes

    For a request to succeed, some SCP must allow it at the root, at the Apps OU and at the account itself; the account level now allows nothing, so every request from IAM users, roles and the root user in those accounts is refused, whatever their IAM policies say.

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

Ask for something