Certopolis

AWS Certified Solutions Architect – Professional

SCP vs RCP vs permissions boundary for SAP-C03

AWS documents SCPs as limits on what principals in member accounts can do, and RCPs as limits on what any caller, including one outside the organization, can do to resources in member accounts. A permissions boundary is a managed policy that caps a single IAM user or role. None of the three grants permissions.

Who each one governs

An SCP is principal-centric. It sets the maximum permissions of the IAM users and roles in member accounts, including each member account's root user, whichever resource they call. It does not affect principals from accounts outside the organization.

A resource control policy (RCP) is resource-centric. It sets the maximum permissions available on resources in member accounts. It applies to any principal that calls those resources, inside the organization or not, root users included. It does not apply to resources in an outside account when your principals call them.

A permissions boundary is set on one IAM user or role inside an account. The entity can perform only the actions allowed by both its identity-based policies and its boundary. When an SCP also applies, the SCP, the boundary and the identity-based policy must all allow the action.

SCPs and RCPs share some rules. Both need an organization with all features enabled. Neither applies to the management account: SCPs do not limit its users and roles, and RCPs do not limit its resources. Both apply to member accounts that are delegated administrators. Neither restricts service-linked roles.

When the control has to be an RCP

Take a bucket in a member account whose bucket policy grants access to an account outside the organization. An SCP on the member account does not apply to those outside users. An RCP attached to the member account, its OU or the root applies to the bucket even when the outside users make the call. A resource in an account has only the permissions that every level above it permits, even if the owner's resource-based policy allows full access to anyone.

AWS uses S3 upload encryption as the example of a control that can be written either way. As an SCP it stops your own principals from uploading unencrypted objects. As an RCP it requires encryption whenever any principal uploads, and AWS says that form may be preferred when the bucket accepts uploads from principals outside the organization, such as third-party vendors.

RCPs cover only a listed set of services, which includes Amazon S3, AWS KMS, AWS Secrets Manager, Amazon SQS, AWS STS and Amazon DynamoDB. Check the list before choosing an RCP for a service. RCPs do not apply to AWS managed KMS keys.

The AWS managed policy RCPFullAWSAccess is attached to the root, every OU and every account when RCPs are enabled, and it cannot be detached. RCPs therefore work through Deny statements. A Deny at the root or an OU is evaluated for every account beneath it, so an exception for one OU has to be written into the Deny that covers that OU. A separate policy lower down cannot lift a Deny inherited from above.

When the control is a permissions boundary

A boundary is the tool for delegating IAM work inside an account. An administrator lets other people create users or roles, and makes sure those new entities can never exceed a set policy. AWS shows the pattern: allow the IAM actions only when the iam:PermissionsBoundary condition key equals the ARN of the approved boundary policy.

In the AWS example, that condition sits on the create action and also on the actions that attach, put, detach and delete policies and that set a boundary. The delegate can then create entities only with the boundary attached, and can manage permissions policies only on entities that carry it. Entities without that boundary are outside the delegate's reach. Separate Deny statements stop the delegate from editing the boundary policy and from deleting a boundary.

The delegate's own boundary does not pass to what the delegate creates. AWS notes that the delegate in its example can create a user who reaches Amazon S3, which the delegate cannot use. The cap has to be attached to each new entity, which is what the condition on the create action forces.

An explicit deny in a boundary always wins. If the boundary denies a bucket, a bucket policy that allows the user still does not give access.

Using SCPs and RCPs together

SCPs and RCPs are independent. You can enable one type or both. AWS describes using both to build a data perimeter: an SCP keeps your identities from reaching resources outside your organization, and an RCP keeps identities outside your organization from reaching your resources.

The effective permissions are the intersection of what the SCPs and RCPs allow and what the identity-based and resource-based policies allow. Users and roles still need IAM policies that grant the action. A principal with no permission policy has no access, even if every SCP and RCP allows everything.

Where the exam catches people

  • Believing an SCP at the root stops an outside account that a bucket policy lets in: SCPs limit only principals in the organization's member accounts, so this needs an RCP.
  • Believing an RCP can be written for any service: RCPs apply only to the services on the supported list.
  • Believing an RCP attached lower down can lift a Deny attached to the root: a Deny at any level applies to every account beneath it, so the exception belongs in the Deny itself.
  • Believing a boundary on the developers' own role caps the roles they create: each new role needs the boundary attached, which the iam:PermissionsBoundary condition on the create action enforces.
  • Believing the iam:PermissionsBoundary condition is needed only on the create action: without it on the policy-attachment actions, the delegate can add policies to entities that have no boundary.

Written from these sources

Try 3 questions on this

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

  1. A company stores incoming files in Amazon S3 buckets in 30 member accounts of its organization in AWS Organizations. Its own applications upload files, and so do two logistics vendors whose AWS accounts are outside the organization and whose access is granted in each bucket policy. A new rule says that every upload must request SSE-KMS encryption and that any other upload must be rejected. The security team attached a service control policy (SCP) to the organization root that denies s3:PutObject when the request does not specify SSE-KMS. The company's own unencrypted uploads are now rejected, but the vendors' unencrypted uploads still succeed. Which solution will resolve this issue?

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

    Not that one: C 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

    That is why the company's uploads are blocked and the vendors' are not. An RCP applies the same encryption requirement from the resource side: it limits what any caller may do to the member accounts' buckets, so an unencrypted PutObject from a vendor is denied even though the bucket policy grants the vendor access. AWS describes this exact case, an encryption requirement where outside parties upload, as one where the RCP form is preferred.

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

  2. A company has an organization in AWS Organizations with all features enabled and five organizational units (OUs). Every member account sits in one of the OUs. Application teams write their own Amazon S3 bucket policies, and several of those policies have granted read access to AWS accounts outside the organization. The security team must ensure that no principal outside the organization can reach objects in any member account's buckets, whatever the bucket policies say. The exception is the data-exchange OU, whose buckets must stay reachable by three named partner accounts and by no other outside account. Application teams must not be able to change either control. Which combination of steps will meet these requirements? (Select TWO.)

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

    Not that one: A,B 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 two places need different rules. On the four ordinary OUs, a plain deny for outside principals closes every bucket regardless of the bucket policy. On the data-exchange OU, the deny carries an exception for the three partner accounts, so they keep the access their bucket policies grant while every other outside account is refused. Keeping the strict deny off the root matters, because a resource only keeps what every level above its account permits.

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

  3. A company gives each product team its own AWS account in an organization in AWS Organizations. Developers must create IAM roles for their workloads and attach whatever policies those roles need, without waiting for the platform team. No role that a developer creates or changes may ever exceed the DevBoundary managed policy. Each account also holds older roles that the platform team created without a permissions boundary. The developers' policy already denies editing DevBoundary and removing a boundary from any role. Which solution will meet these requirements?

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

    Not that one: C 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 older unbounded roles are therefore out of reach, and with boundary edits and removals already denied, no role a developer touches can rise above DevBoundary.

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

Ask for something