#72 - AWS Resource Control Policies (RCPs)
One resource control policy can block outside access across S3 buckets in multiple accounts.
16 min read
We are looking into recently announced AWS Resource Control Policies. What are they? How are they different from Service Control Policies? What is a Data Perimeter? Tune in to find out!
Block Public Access covers public, one account at a time
Try to make an S3 bucket public in the console and AWS stops you to ask whether you meant it. Since April 2023, new buckets get S3 Block Public Access on and ACLs disabled by default. The control is older than the default. Account-level Block Public Access shipped in November 2018, and turning all four settings on for an account, in the documentation’s words, “blocks public access for all current and future buckets and access points”. The bucket somebody created in 2018 and forgot is covered too, as long as somebody switched that account on.
Buckets keep leaking anyway. Securitas left one open with around 1.5 million files of employee personal data in it, and the story broke in January 2022, years after public buckets were declared a solved problem. Security misconfiguration is A05 in the OWASP Top 10. The specific misconfiguration this post is about is an uneven one: Block Public Access is set per account, so it is on in the accounts somebody looks after and unset in the account nobody has logged into since a reorganisation. That is the account you’re worried about, and nothing above it makes the setting consistent.
The other limit is the word public, which S3 defines narrowly. A bucket policy counts as non-public as soon as it grants only to fixed values: a named account, a role, a service principal. Hand a specific outside account s3:GetObject and nothing about that is public, so Block Public Access leaves it alone and so does the dashboard counting your public buckets. Block Public Access is also S3 only. The services beside it lack an account-wide equivalent, and what they do have is narrower: the Secrets Manager console has blocked you from applying a resource policy that grants public or overly broad access since July 2020, with the CLI and the SDK left open for the cases where you mean it. That check asks whether a policy is public. It has nothing to say about a KMS key policy that names a contractor’s account id, or a secret shared across an account line on purpose.
Your network perimeter has no opinion about a bucket
Start with why the perimeter you already have doesn’t reach any of this. Firewalls, security groups and subnets draw a boundary around compute. Your bucket isn’t inside it. S3 doesn’t live in your VPC, and neither does a Secrets Manager secret, an SQS queue or a KMS key. Access to all of them is decided by IAM, so a boundary around your data has to be written in IAM too.
What is a data perimeter?
AWS defines it as “a set of permissions guardrails in your AWS environment you use to help ensure that only your trusted identities are accessing trusted resources from expected networks”.
Three nouns in that sentence carry the structure: identities, resources, networks. The data perimeters page is where AWS lays its control objectives against the policy types that implement them, which is service control policies, resource control policies and VPC endpoint policies. AWS is explicit that these are coarse guardrails and don’t replace your fine-grained access controls. They’re the floor, not the whole building.
Why data and not compute? Attackers do mine cryptocurrency on stolen capacity, and they do run spam campaigns out of accounts they’ve taken over. The money is in the data: steal it, sell it, or encrypt it and charge you for the key. That is the whole business model behind the ransomware waves, and it’s why the perimeter that matters is the one around storage rather than the one around servers.
RCPs cap the resource, SCPs cap the principal
The data perimeters page lists three policy types, and the newest of them is the one that creates confusion. AWS shipped resource control policies on 13 November 2024. They attach above the account, they cover more than S3, and they don’t care whether a grant was public or a quiet cross-account favour from 2019. The name collides with service control policies badly enough that the difference is the first thing to get straight.
What is the difference between an SCP and an RCP?
An SCP limits what the IAM users, roles and root users in your member accounts can do. An RCP limits what can be done to the resources inside your organization, whoever is asking.
A principal is the root user of an account, an IAM user, a role, a service. An SCP reaches the IAM users, roles and root users in your member accounts, and stops there. Principals in the management account are exempt, so are service-linked roles, and a service acting on your resources presents a service principal that no SCP reaches. Within those limits you can say that nobody may make a bucket public, and that’s worth having. It does nothing for the buckets that are already public, and it says nothing at all about a principal in somebody else’s organization, because an SCP only applies within yours. You can’t put limits on an organization that runs by its own rules.
Resource control policies are the other half. AWS’s wording is that they “are evaluated when your resources are being accessed irrespective of who is making the API request”.
The sample AWS published with the launch, EnforceOrgIdentities, is a single Deny statement: Action: "s3:*", Resource: "*", with StringNotEqualsIfExists on aws:PrincipalOrgID and BoolIfExists on aws:PrincipalIsAWSService set to false. The Principal element must always be *. A caller from another organization fails that condition. An anonymous caller carries no aws:PrincipalOrgID at all, so it fails too, which means a bucket can still be marked public and the anonymous GET still gets nothing.
Neither policy type grants anything. Both set a ceiling. When you enable RCPs, AWS attaches a managed policy called RCPFullAWSAccess to the root, every OU and every account, and it allows everything, so your existing IAM permissions keep working exactly as before until you attach a Deny of your own.
Five services at launch, and two of them are the ones you have
A ceiling is only useful where it exists, and at launch it didn’t exist everywhere.
Which services do RCPs cover?
At launch: Amazon S3, AWS STS, AWS KMS, Amazon SQS and AWS Secrets Manager, in all commercial AWS Regions, at no additional charge.
That’s a short list, and it’s enough to start. Most teams keep their data in S3 and their credentials in Secrets Manager, which are the two resources somebody could share outside the organization or expose by accident. Pick those two, write the policy, and come back for the rest when AWS adds them.
Four exclusions are worth knowing before you plan around RCPs. They don’t affect resources in the management account, only resources in member accounts, which is the one that changes how you lay out a small organization. They don’t apply to calls made by service-linked roles, and they don’t affect a service-linked role’s trust policy either. They can’t restrict AWS managed KMS keys, or kms:RetireGrant. And they need an organization with all features enabled, so consolidated billing alone won’t do.
One more behaviour surprises people: an RCP doesn’t stop anyone from saving a resource-based policy that’s more permissive than the RCP allows. The bucket policy writes fine. The access just fails.
Three controls worth writing first
Three of the examples AWS publishes with the RCP documentation earn their place on day one.
Which RCP should you write first?
Deny every principal outside your organization, then close the cross-service confused deputy gap, then require HTTPS.
The first is the identity perimeter, the EnforceOrgIdentities statement above. Write that one by hand: two condition keys, no exceptions in it. AWS ships a fuller version as identity_perimeter_rcp.json in its data perimeter policy examples repository, covering all five services plus OIDC providers. It arrives with exceptions wired in: aws:PrincipalAccount values for third parties, and aws:ResourceTag/dp:exclude:identity set to true.
Read that tag twice before you copy the file. It sits in a StringNotEqualsIfExists block in three of the four statements, so a resource carrying it falls outside those denies. The exemption only reaches services that report tags to IAM, which S3 doesn’t, so a tagged bucket stays denied. On a KMS key, a Secrets Manager secret or an SQS queue the tag does what it says, and there the permission to tag is the permission to leave the perimeter. Either delete that condition line from all three statements, or restrict kms:TagResource, secretsmanager:TagResource and sqs:TagQueue to a short list of principals. The service authorization reference lists which actions evaluate aws:ResourceTag.
The second control is the reason the first isn’t enough. The cross-service confused deputy problem is what happens when an AWS service calls your resource on somebody’s behalf. Your bucket policy allows a service principal, because the service needs access. That trust isn’t scoped to your organization, so the same service acting for an outside account presents the same principal and your policy says yes. AWS added aws:SourceOrgID for exactly this: it carries the organization the service is acting for, and an RCP can require it to be yours.
That statement is EnforceConfusedDeputyProtection in the same sample file. It tests aws:PrincipalIsAWSService the opposite way round: Bool with true, where the identity deny uses BoolIfExists with false. One skips requests made by AWS services; the other is written for them and nothing else.
The third control is the finding you already have. Any cloud security posture tool, Security Hub included, flags buckets whose policy doesn’t require TLS: that’s control S3.5, a Deny when aws:SecureTransport is false, and we see it on account after account. One RCP enforces it across every bucket at once, so plain HTTP fails whatever the bucket policy says. It won’t clear the finding: S3.5 reads the bucket policy, so the bucket keeps failing even though nothing can reach it over HTTP.
Attach it low, then walk it up the tree
Writing the policy is the easy half. Attaching it is where you can take the organization down.
Where do you attach an RCP?
To an account, an OU or the organization root, the same three places an SCP goes, and you start at a single test account.
Inheritance is the part to internalise. A resource has only the permissions every parent above it permits, so a deny at the OU level can’t be undone by an account admin, by a bucket policy, or by anyone’s identity policy. The effective permission is the intersection. That is precisely the property you want, and precisely why attaching an untested policy to the root is a bad afternoon.
So: test account first, confirm that what you expected to break is broken and nothing else is, then the OU, then check again, then up. Each step waits on evidence, not on a quiet afternoon with no complaints in it.
One shape doesn’t work. RCPs leave the management account alone, so a lone account wrapped in an organization of its own becomes the management account and gets nothing out of this. The data has to sit below: one account for organization administration, the workload in a member account underneath it, the policy attached there.
CloudTrail tells you what you broke, once data events are on
Walking the policy up the tree only works if you can see the damage at each step, and your trail does not show all of it by default.
How do you tell whether an RCP broke something?
Turn on CloudTrail data events for the buckets in scope, then watch AccessDenied and alert on the rate rather than on each event.
Bucket-level calls such as PutBucketPolicy are management events and are in your trail already. The call this policy exists to stop, GetObject, is a data event, and CloudTrail doesn’t log data events by default. Switch them on for the buckets you’re protecting before you attach anything, and price it first: data events are billed separately and they are high volume by nature.
With them on, an RCP denial looks like any other denial: the call fails, the error lands in CloudTrail, and nothing pages anyone. What you’re looking for is a spike right after you attached the policy. FivexL, Andrey’s consultancy, publishes cloudtrail-to-slack under Apache 2.0 for teams who have nothing in place. The module is a Lambda that parses CloudTrail and posts matching events to a Slack channel. Its default rules already catch errorCode values starting with AccessDenied, with anonymous principals filtered out to cut the noise.
Silence isn’t evidence, and a failed call on its own isn’t evidence either. A request from outside your organization may have been failing all along, on a bucket policy or on a grant nobody ever made, so a denial after attachment proves nothing unless you know the same call worked before it. Build the check in that order, in the test account. Put a throwaway object in a test bucket, grant one named external principal read access to it, and confirm that principal can read it with the RCP detached. Attach the policy. Confirm the same call now fails, confirm the denial reached the channel you’re watching, and confirm an internal caller you meant to keep can still read the object. The before-and-after pair is what tells you the policy did it.
The same feed pays for itself outside this project. When a developer breaks their own permissions and has no idea why their deployment fails, the denial is in that channel with the principal and the action in it. You get to tell them what’s missing before they file the ticket.
What this means for teams
The reason to care about RCPs isn’t that AWS shipped a new policy type. Account-level Block Public Access already handles public buckets in every account where somebody turned it on. What it never handled is the grant to a named outside account, the KMS key shared with a contractor in 2021, the queue a partner still reads from. Those were per-resource chores spread across accounts nobody owns, and an RCP turns them into one statement attached in one place, covering the buckets you can’t audit along with the ones you can.
Four things worth doing this week:
- Confirm account-level Block Public Access is on in every account. It’s the cheaper half of this, it covers buckets that already exist, and an RCP is no reason to skip it.
- Check that all features are enabled and that your data isn’t in the management account. RCPs need the first and don’t reach the second, so if the workload sits in the management account, moving it is the prerequisite for everything else here.
- Write the identity perimeter RCP and attach it to one test account. Start from the launch post’s
EnforceOrgIdentities, put your organization ID in it, and scope it to what you actually hold: S3 and Secrets Manager first, KMS and SQS next. If you take the AWS sample file instead, decide what you’re doing about itsdp:exclude:identitytag before you attach it. - Turn on S3 data events and run the before-and-after check. Route
AccessDeniedsomewhere you’ll see it, a Slack channel is enough, then prove the policy with one named external principal reading a throwaway object: working before you attach, failing after, with an internal caller still reading it.
Common questions, answered
How do I block access to my S3 buckets from outside my AWS organization?
Attach a resource control policy that denies s3:* when aws:PrincipalOrgID doesn’t match your organization ID, with a BoolIfExists carve-out on aws:PrincipalIsAWSService so AWS services keep working. The launch post carries it as EnforceOrgIdentities, with no exceptions in it. It covers every bucket in every member account below the attachment point, so attach it to a test account first, and remember it does nothing for resources in the management account.
Do resource control policies work if I only have one AWS account?
Not for the resources in that account. Wrap a lone account in an organization and it becomes the management account, and RCPs don’t restrict resources in the management account. You need two: the management account for organization administration, the workload in a member account below it, the policy attached there. That’s the layout multi-account setups arrive at anyway, and most of the effort goes into the account move rather than the policy.
An RCP broke a cross-account integration. How do I fix it?
Find the denied call in CloudTrail and work from the caller, the action and the resource, because that’s all you get: the launch post’s own example comes back as a plain access denied message that names no condition key. Take those three facts to the policies attached above the resource, find the statement that catches the caller, and confirm the integration is one you want before you widen anything. Then add a narrow exception: the partner’s account id in the aws:PrincipalAccount list, or aws:SourceAccount when an AWS service is acting for you. Detaching the policy isn’t the fix.
Related episodes
- Episode 66, Multi-account strategy and landing zones covers the organization structure that RCPs attach to: roots, OUs, and how finely to segment accounts in the first place.
- Episode 24, Protecting yourself from data breaches is the other side of this: what leaks, and what you can still do once the data is out.
- Episode 11, AWS security maturity roadmap is where the forgotten account and the credential nobody rotated first showed up as priorities.
- Episode 62, re:Invent 2023 highlights is the format this is a single-release version of, picking the announcements that matter from a DevSecOps angle.
Resources
- Introducing resource control policies is the 13 November 2024 launch post, and it settles the service list, the quotas, pricing and the
EnforceOrgIdentitiessample. - Resource control policies in the AWS Organizations documentation settles attachment, inheritance, and what RCPs can’t restrict: management account resources, service-linked roles, AWS managed KMS keys and
kms:RetireGrant. - Service control policies in the AWS Organizations documentation settles who an SCP actually reaches, and the exemptions for the management account and service-linked roles.
- Blocking public access to your Amazon S3 storage settles what the four account-level settings cover and what S3 counts as a public policy.
- How to use resource-based policies in the Secrets Manager console settles what the console blocks, public and overly broad policies, and what it still lets you grant to a named external role.
- Data perimeters on AWS is the page to scroll for how SCPs, RCPs and VPC endpoint policies divide the work between identity, resource and network.
- Use scalable controls for AWS services accessing your resources explains the cross-service confused deputy problem and the
aws:SourceOrgIDkey that closes it. - cloudtrail-to-slack is the Apache 2.0 Terraform module FivexL publishes for getting
AccessDeniedevents into a channel.
Since we recorded
AWS kept extending the service list, through ECR and OpenSearch Serverless, Cognito and CloudWatch Logs and DynamoDB, so check the current list before ruling a resource type out. The tag exemption now reaches S3 too, where bucket-tag authorization is switched on per bucket, so s3:TagResource deserves the scrutiny kms:TagResource gets. Block Public Access is no longer per-account either: it gained organization-level enforcement in November 2025, attached at the root, an OU or named accounts. We went back to the release-roundup format in Episode 93, on what re:Invent 2025 meant from a DevSecOps perspective.
