SCPs vs RCPs: What They Protect in Your AWS Organization

SCPs vs RCPs: What They Protect in Your AWS Organization

Start with IAM basics, then configure two organization guardrails: block file deletion and require HTTPS for S3 reads. Includes policy JSON, verified results, rollback, and cleanup.

cloud engineer, indie hacker, devops
I think it's time to talk about how organizations manage AWS permissions. A recent project reminded me why those rules need to be in place from day zero, before teams start building.
An application team can give its role permission to read a file. The security or platform team may also need rules that apply across the organization's accounts, even when individual teams change their own permissions.
Service Control Policies (SCPs) and Resource Control Policies (RCPs) are two controls for setting those limits in AWS Organizations. An SCP limits what identities in member accounts can do. An RCP limits access to supported resources in member accounts.
Neither policy grants access. Teams still need to give their applications the permissions they need within those limits.  Organizations authorization policies 
I wanted to see how those limits behave when an application role already has permission to do the work.
So I tested both with one application role and two files in S3. I checked the starting access, applied each restriction, and removed them separately to see which requests worked again.

The role asks to read the file. AWS evaluates the applicable policies to decide whether that request is allowed.

Identities, Users, and Roles

An identity represents who is using AWS. AWS Identity and Access Management (IAM) lets you create users and roles for that access.
An IAM user is an identity created in an AWS account for a person or application. An IAM role is an identity that a trusted person, application, or AWS service can use temporarily.  IAM identities 
Using a role is called assuming the role. You receive temporary credentials and use that role's permissions until those credentials expire. Applications can assume roles too.  IAM roles 
For example, an application might assume a role to download a file from Amazon S3.
In AWS documentation, the caller making a request is called the principal. For that application, the principal is its role session.

Permissions, Resources, and Policies

A resource is something you use or manage in AWS, like an S3 bucket or a Lambda function.
S3 stores files as objects inside buckets. In this walkthrough, those objects are the resources the application accesses.
A permission allows an action on a resource. Reading an S3 object uses  s3:GetObject ; deleting it uses  s3:DeleteObject . Permission to read doesn't automatically include permission to delete.
A policy is a document containing access rules. Those rules describe allowed or denied actions, the resources involved, and any conditions on access.
Two common types are:
Policy Type
Where It Applies
Example
Identity-based policy
A user, group, or role
This application role may read files in this bucket.
Resource-based policy
A resource
This bucket allows access by specified roles.
An applicable explicit deny overrides an allow. Adding another allow doesn't cancel the deny.  Policies and permissions 
A role's trust policy specifies who may assume it. Its permissions policy specifies what the role can do. Permission to assume a role doesn't give it permission to read a file.  Role trust and permissions 

Where Organization Guardrails Fit

Now take that application setup and repeat it across several teams. Each team manages roles, applications, and resources in its own accounts.
AWS Organizations groups those accounts under central management. The management account administers the organization. The other accounts are member accounts.
An organizational unit (OU) groups accounts so you can apply common policies to them together.
The organization root is the top-level container for those accounts and OUs. Policies can be attached at the root, OU, or account level. This matters when checking which restrictions an account inherits.  Organizations structure 
The application team decides which access its application needs. The platform or security team may also need restrictions that remain in place when someone changes permissions inside an account.
For example, an organization might prohibit file deletion by certain application roles or require encrypted connections when accessing its stored files.
Those shared limits are guardrails. SCPs and RCPs help enforce them across member accounts. An account administrator cannot override an applicable organization-policy deny by adding an IAM allow.  Organizations authorization policies 

SCPs Limit What Your Identities Can Do

An SCP sets the maximum permissions available to users and roles in the member accounts it covers.
Suppose an application role has permission to read and delete files. An SCP could deny  s3:DeleteObject  for that role. The role would then be unable to delete a covered object, even though its IAM policy allows deletion.
This example covers direct  DeleteObject  requests. A broader deletion guardrail also needs to address deleting specific object versions and configuring S3 Lifecycle rules that delete objects automatically.  S3 deletion permissions 
The SCP follows the identity's account. It can restrict that account's roles when they access resources inside or outside the organization. Owning a bucket does not make the account's SCP apply to every caller accessing it.  SCP scope and behavior 
An SCP that permits S3 access also doesn't give every role S3 permissions. The application still needs its own access grant.

RCPs Limit Access to Your Resources

An RCP sets limits on access to supported resources in the member accounts it covers.
For example, an RCP could deny requests to covered S3 objects when the connection uses unencrypted HTTP. An application with read permission would still need to use HTTPS, which encrypts the connection. A bucket-policy allow would not override that deny. AWS publishes an  HTTPS-only RCP example .
The RCP follows the resource's account. It can restrict access to that resource by callers inside or outside the organization, including your own application roles.  RCP scope and behavior 
Requiring HTTPS is one possible rule. It isn't a built-in property of every RCP. The actions, resources, and conditions in the policy determine the restriction.
Some requirements can be expressed through either policy type. The important difference is whether you want the restriction to apply to your identities' actions or to access to your resources.

How Both Policies Affect an S3 Request

Consider one application role reading files from a private, unversioned S3 bucket in a member account. Its IAM permissions allow reads and deletes. Assume the other applicable permissions allow the requests below.
Now add two organization restrictions: an SCP denying deletion by the application role, and an RCP denying unencrypted HTTP access to the bucket's objects.

IAM grants the role read and delete access. The SCP blocks deletion, and the RCP blocks unencrypted HTTP requests.
Here is how those rules affect three requests:
Application Request
Effect of These Example Rules
Read a file over HTTPS
Neither example deny blocks it; the existing permissions can allow the read.
Delete a file over HTTPS
The SCP deny blocks deletion despite the role's IAM allow.
Read a file over unencrypted HTTP
The RCP deny blocks access despite the role's IAM allow.
For this example, HTTPS protects data while it travels between the application and S3. Encryption of the stored object is a separate control.

Configure Both Guardrails in a Test Account

Start with the two requirements used in this test: "This role must not delete the test file" and "Reading the test data must use HTTPS."
The configuration below turns those requirements into policies. The AWS Command Line Interface (CLI) makes the requests using the application role. There is no application server to deploy.

Creating a policy saves its rules. Attaching it determines which accounts are affected.

1. Choose the Account and Prepare Two Files

Use a dedicated member account in an existing AWS organization with all features, SCPs, and RCPs enabled. Keep separate signed-in sessions for the Organizations administrator and the member-account administrator. Both should use your existing short-lived authentication.
Have AWS CLI v2 installed and the member-account operator profile signed in before the verification steps.
Review the policies inherited from the root and parent OUs. Leave the account's existing policies attached. If existing controls block the starting requests, use a suitable test environment rather than weakening those controls.
AWS automatically attaches  RCPFullAWSAccess  when RCPs are enabled. It lets existing permissions pass through RCP evaluation until another RCP restricts them; it doesn't grant access.  RCP evaluation 
The management account cannot demonstrate these member-account guardrails.
Creating the bucket and making requests can incur S3 charges. Use synthetic data only.
Tag the new bucket, reader role, and example organization policies with  Purpose=ScpRcpArticleExample . Keep a record of their exact names so cleanup targets only resources created for this example.
  1. In the member account's S3 console, create a new general purpose bucket in  ap-southeast-1 . Choose a unique bucket name. Keep all Block Public Access settings enabled, leave Object Ownership set to Bucket owner enforced, and leave versioning disabled. Use server-side encryption with Amazon S3 managed keys (SSE-S3) to encrypt stored objects.  S3 encryption 
  1. Create a  guardrails-example  folder. Upload  read.txt  and  delete-me.txt  into it. Put only this text in both files:  Guardrails example fixture. No private data. 
  1. Keep the bucket policy empty for this comparison. A bucket policy that already denies HTTP would hide the RCP's effect. This controlled setup is not a production storage baseline.
In the snippets, replace  my-bucket  with the bucket you just created. Replace  111122223333  with that member account's ID. If you choose a different Region, update the profile and HTTP endpoint below together.

2. Create the Application Role and Its Starting Permissions

In IAM → Roles → Create role, choose a custom trust policy.
An Amazon Resource Name (ARN) identifies an AWS resource. Use the existing IAM operator role's ARN in this policy to let that role assume the new reader role.  AWS resource names 
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:role/your-operator-role"
},
"Action": "sts:AssumeRole"
}
]
}
Replace the entire operator ARN with the role ARN from IAM → Roles. Use an  arn:aws:iam::...:role/...  ARN, not the  arn:aws:sts::...:assumed-role/...  session ARN. The operator also needs permission to assume the new role.
Finish creating the role as  example-reader . On its Permissions tab, add this inline policy through the JSON editor:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadExampleObjects",
"Effect": "Allow",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/guardrails-example/*"
},
{
"Sid": "DeleteDisposableObject",
"Effect": "Allow",
"Action": "s3:DeleteObject",
"Resource": "arn:aws:s3:::my-bucket/guardrails-example/delete-me.txt"
}
]
}
The role can read files under  guardrails-example/  and delete only  delete-me.txt . It cannot upload files, list the bucket, or administer organization policies.
For verification, add a new named profile to  ~/.aws/config , keeping existing profiles intact:
[profile guardrails-reader]
role_arn = arn:aws:iam::111122223333:role/example-reader
source_profile = your-member-admin
role_session_name = guardrails-example
duration_seconds = 900
region = ap-southeast-1
Set  source_profile  to your existing, authenticated member-account operator profile. The CLI obtains temporary reader-role credentials from it; no permanent access keys are needed.  CLI role profiles 
Confirm the identity before testing:
aws sts get-caller-identity --profile guardrails-reader
The account must be the selected member account, and the ARN must identify an assumed session of  example-reader . The Organizations administrator session is for policy attachment, not for these application requests.

3. Establish the Starting Access

Before attaching either example deny, confirm both objects exist. Run the following commands one at a time. The delete command permanently removes only the synthetic  delete-me.txt  object from this unversioned bucket.
The HTTP read is deliberately unencrypted. It sends temporary authentication headers and the synthetic file over HTTP. Use only this narrowly scoped, short-lived reader role and test data on an approved network.
guardrails_output="$(mktemp -d)"

aws s3api get-object --profile guardrails-reader \
--bucket my-bucket --key guardrails-example/read.txt \
"${guardrails_output}/https.txt"

aws s3api delete-object --profile guardrails-reader \
--bucket my-bucket --key guardrails-example/delete-me.txt

aws s3api get-object --profile guardrails-reader \
--bucket my-bucket --key guardrails-example/read.txt \
--endpoint-url http://s3.ap-southeast-1.amazonaws.com \
"${guardrails_output}/http.txt"
All three requests must succeed at this stage. Open the two downloaded files and check their contents. In S3, confirm  delete-me.txt  disappeared, then upload that synthetic file again as the member-account administrator.
Repeat that upload after every successful deletion. Deleting a missing object can still return success. Check that the test file exists before each attempt so a missing file doesn't look like a successful deletion. A new output directory also prevents an old download from looking like a successful new read.
If HTTP is blocked by a proxy or an existing control, stop here. An expired session, redirect, or connection failure is not evidence of an RCP deny.  S3 read behavior 

4. Create and Attach the SCP

In the Organizations administrator console, open Service control policies → Create policy. Name the new policy  ExampleDenyDelete  and paste this JSON:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyExampleRoleDeletion",
"Effect": "Deny",
"Action": "s3:DeleteObject",
"Resource": "arn:aws:s3:::my-bucket/guardrails-example/delete-me.txt",
"Condition": {
"ArnEquals": {
"aws:PrincipalArn": "arn:aws:iam::111122223333:role/example-reader"
}
}
}
]
}
Replace the bucket and the full reader-role ARN before saving.  Resource  limits this example to the disposable object. The  aws:PrincipalArn  condition selects the application role. The separate operator role can still restore the test file and manage the setup. An SCP does not use a  Principal  element.  SCP syntax 
After reviewing the policy, attach it only to the selected test member account, not the root or an OU. Check the target account ID and leave existing policy attachments unchanged.  Creating  and  attaching organization policies 
Allow the change to propagate, then repeat the same three requests with a fresh output directory. HTTPS and HTTP reads should still succeed. The delete should return  AccessDenied , and the object should remain in S3.
The IAM allow is still present. The new SCP deny blocks the action.

5. Create and Attach the RCP

Open Resource control policies → Create policy. Name the new policy  ExampleRequireHttps  and paste:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyUnencryptedExampleRead",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket/guardrails-example/read.txt",
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
},
"BoolIfExists": {
"aws:PrincipalIsAWSService": "false"
}
}
}
]
}
This policy restricts reads of  read.txt .  aws:SecureTransport  is false for an unencrypted HTTP request. The second condition excludes direct AWS service principals from this deny; it does not grant them access or exempt every role used by a service.  Condition keys 
An RCP requires  Principal: "*" ; conditions determine which requests the deny matches. Review required service integrations before widening a transport restriction.  RCP syntax 
Replace the bucket, save the policy, and attach it only to the same test member account. Keep the SCP attached for this step. After propagation, repeat the requests:
  • The HTTPS read should succeed and download the known text.
  • The delete should return  AccessDenied  because of the SCP.
  • The HTTP read should return  AccessDenied  because of the RCP.
Check the HTTPS read first. The reader has no  ListBucket  permission, so a missing object can also produce  AccessDenied . A known existing object and a successful HTTPS read help distinguish that mistake from the intended HTTP restriction.

6. Separate the Effects and Restore Access

In the Organizations console, detach only  ExampleDenyDelete  from the selected account. After propagation, repeat the requests. Deletion should work again, while the HTTP read remains blocked by the RCP. Re-upload the disposable file after a successful delete.
Then detach only  ExampleRequireHttps  and repeat once more. All three starting requests should work again. Check that the account's original policy attachments are unchanged.
These were my observed results across the five stages. Use them to compare your own run:
Policies Attached
HTTPS Read
HTTPS Delete
HTTP Read
Neither example deny
Allowed
Allowed
Allowed
Example SCP only
Allowed
Denied
Allowed
Both example policies
Allowed
Denied
Denied
Example RCP only
Allowed
Allowed
Denied
Both example policies removed
Allowed
Allowed
Allowed
For your own run, record the caller identity, attached policies, result, and time at each stage. Investigate unexpected errors. Only count  AccessDenied  as a denied request after checking the identity and confirming the test object exists.

7. Remove the Example Resources

These cleanup actions permanently delete the example policies and synthetic files. Confirm their names, account, and contents first.
  1. Verify neither example policy remains attached to the test account. Check that each has no other targets, then delete only  ExampleDenyDelete  and  ExampleRequireHttps . Do not disable policy types or remove  FullAWSAccess  or  RCPFullAWSAccess .
  1. In S3, inspect and delete the two synthetic files and the empty folder marker if one was created. Leave unexpected data untouched. Confirm the bucket is empty before deleting this example bucket.
  1. In IAM, remove the inline permissions policy from  example-reader  and delete that example role. Keep the existing operator role and its permissions.
  1. Remove only the  guardrails-reader  profile you added. Confirm the example bucket, role, and organization policies are gone, and existing organization controls remain.
If you created the baseline with an infrastructure tool, detach the example organization policies and empty the example bucket first. Then use that tool's reviewed deletion procedure for the resources it owns.

Other Controls and Coverage Limits

A permissions boundary caps what identity-based policies can grant to an individual user or role. A session policy limits a particular temporary session. These can also affect a request alongside organization guardrails.  IAM policy types 
Organizations has policies for tagging standards and backup plans too. Those manage standards and settings; SCPs and RCPs are its authorization policy types.  Organizations policy categories 
SCPs don't restrict identities in the management account, and RCPs don't restrict resources in that account. Service-linked roles, special roles tied to AWS services, are exempt from both.  SCP exceptions ,  RCP exceptions 
RCP coverage depends on the AWS service and action. Check support and service-integration requirements before treating an organization policy as universal protection.

Results From the Test

I ran the comparison in one development member account in  ap-southeast-1 . I used CloudFormation to create the private bucket and reader role, then tested them with a small verification helper.
All 15 request checks matched the five-stage table. The role's IAM permissions stayed the same throughout.
HTTPS reads kept working at every stage. Removing the SCP restored deletion while the RCP still blocked HTTP reads. Removing the RCP restored the starting access too.
My first attempt stopped in the verification helper. The AWS CLI returned no output when I successfully checked versioning on the new bucket. My helper expected JSON and failed on the empty response.
I fixed that handling and added a regression test before rerunning the checks.
After verifying restored access, I deleted the two example organization policies. I checked and removed the remaining synthetic file, then deleted the CloudFormation stack.
I confirmed the bucket and reader role were gone and the original organization policy attachments were preserved. I left the RCP policy type enabled.

My Take

I would choose the policy based on where the restriction needs to apply: the identities making requests or the resources being accessed.
Then I'd test the access the application needs as carefully as the action I want to block. A failed delete request is only half the check. The read the application depends on should still work.

References

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article