Certopolis

AWS Certified DevOps Engineer – Professional

Permissions boundary vs SCP vs RCP: which limit applies (DOP-C02)

A permissions boundary caps one IAM user or role. A service control policy caps the IAM users and roles in an organization's member accounts. A resource control policy caps access to resources in member accounts. Per the IAM and AWS Organizations user guides, none of the three grants permissions, and SCPs and RCPs skip the management account.

What does a permissions boundary limit?

A permissions boundary is a managed policy set on an IAM user or role. The entity can perform only the actions allowed by both its identity-based policies and its boundary. The boundary grants nothing by itself. In the AWS example, a user whose boundary allows Amazon S3, CloudWatch and Amazon EC2 cannot create an IAM user even with a policy that allows iam:CreateUser.

Resource-based policies interact with boundaries in a way the exam tests. Within the same account, a resource-based policy that grants access to an IAM user ARN is not limited by an implicit deny in that user's boundary. A grant to an IAM role ARN is limited by an implicit deny in the role's boundary. A grant made directly to a role session ARN is not.

Do not use a resource-based policy statement with NotPrincipal and a Deny effect for principals that have a boundary. It always denies them. AWS recommends the ArnNotEquals condition with aws:PrincipalArn instead.

What does a service control policy limit?

SCPs set the maximum available permissions for the IAM users and roles in an organization, including a member account's root user. They are available only when the organization has all features enabled, not with consolidated billing features alone. An SCP never grants permissions.

SCPs do not affect users or roles in the management account. They do apply to member accounts that are delegated administrators. They do not apply to principals from accounts outside the organization, and they do not affect resource-based policies directly.

When an SCP, a permissions boundary and an identity-based policy all apply to a request, it is allowed only if all three allow it. An explicit deny in any of them wins. AWS recommends testing an SCP on a small OU before attaching it to the root, and not removing FullAWSAccess without a replacement that allows the needed actions.

What does a resource control policy limit?

RCPs set the maximum available permissions for resources in an organization. AWS's guidance is to use an SCP to limit the IAM principals inside your member accounts, and an RCP to restrict principals outside your organization that request access to resources in your member accounts.

Like SCPs, RCPs need all features enabled and grant nothing. RCPs do not affect resources in the management account. They apply to member accounts, including delegated administrators. They apply only to the AWS services that support RCPs.

The effective permissions are the intersection of what the SCPs and RCPs allow and what the identity-based and resource-based policies allow.

Where the exam catches people

  • Believing a boundary limits every grant to an IAM user: in the same account, a resource-based policy that names the user ARN is not held back by the boundary's implicit deny.
  • Believing an SCP or RCP attached to the root covers the management account: neither affects the management account.
  • Believing an SCP grants permissions: it only sets a ceiling. Identity-based or resource-based policies must still allow the action.
  • Believing an SCP stops outside principals that a bucket policy lets in: SCPs apply only to principals in the organization's accounts. That is the job of an RCP.
  • Believing a delegated administrator account is exempt like the management account: SCPs and RCPs apply to delegated administrator member accounts.

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 deployment tool has used the access keys of an IAM user named ci-deployer. The user's permissions boundary allows only AWS CloudFormation and Amazon S3 actions. A review finds that the tool still reads AWS Secrets Manager secrets in the same account whose resource policies name the ci-deployer user ARN. The DevOps team will move the tool to an IAM role named CiDeployRole, with the same boundary, which the tool assumes with the fixed session name deploy. After the move, the boundary must limit whatever any secret's resource policy grants to the tool. Which solution will 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 grant to a role ARN behaves differently: it is still held to the role's boundary. Naming CiDeployRole's role ARN in each secret's policy therefore keeps the tool working where the boundary allows and stops it where the boundary does not, which is the limit the team asked for.

    Written from docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html

  2. A platform team gives each application team its own AWS CodeBuild project in a shared tooling account. Each project's service role is defined in the application team's repository, and the teams change the role's policies through pull requests that they approve themselves. The platform team must put a ceiling on what any of these service roles can ever do: Amazon S3, Amazon ECR and Amazon CloudWatch Logs actions, and nothing else. The other roles in the tooling account must not be affected, and the application teams must keep editing their roles' policies. Which solution will meet these requirements?

    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

    A permissions boundary does exactly that for the roles it is set on: a build role can use an action only if both its own policies and the boundary allow it, and the boundary grants nothing by itself. The other roles in the account carry no boundary and are untouched.

    Written from docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html

  3. A company runs AWS CloudFormation StackSets with service-managed permissions from the management account of its organization in AWS Organizations. The stack set templates are stored in an Amazon S3 bucket in the management account. A resource control policy (RCP) attached to the organization root denies Amazon S3 access to principals outside the organization, and tests show it protecting the buckets in the organization's other accounts. A penetration test then reads the template bucket from an outside account through a bucket policy statement that an engineer added. The template bucket must fall under the same RCP control. What should a DevOps engineer do to meet these requirements?

    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

    The way to bring the templates under the existing control is to keep them in a member account. A shared services account under the root already inherits the RCP, and the stack set operations can read their templates from a bucket there.

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

Ask for something