Sub topic 8
What an RCP is and how it differs from an SCP
This chapter assumes you know how an organization is structured (root, OUs, accounts), how policies inherit down that tree, and what an SCP does. It also assumes you can read IAM policy JSON.
What an RCP is
A resource control policy (RCP) sets the maximum permissions available on resources in the member accounts of your organization. It works as a guardrail, the same way an SCP does. An RCP never grants access. A request is allowed only if an identity-based or resource-based policy allows it, and no RCP denies it.
The difference from an SCP is the side of the request it constrains:
- An SCP limits what the principals in your accounts can do.
- An RCP limits what can be done to the resources in your accounts, no matter who makes the request.
Why this matters
An SCP only sees principals inside your organization. If a bucket policy grants access to an outside account, no SCP can stop that outside principal, because the principal is not in your organization. An RCP is evaluated against the resource, so it applies to that request too.
An RCP lets you enforce a rule such as "all S3 traffic must use TLS" on every bucket. It holds even if a team writes a permissive bucket policy.
Side-by-side comparison
| Aspect | SCP | RCP |
|---|---|---|
| Limits | Principals (IAM users and roles) in member accounts | Resources in member accounts |
| Applies to outside principals | No | Yes, when they access your resources |
| Grants permissions | No | No |
| Principal element | Not used | Must be `"*"` |
| Management account | Not affected | Its resources are not affected |
| Service coverage | Almost all services | A limited list of supported services |
Two limits are worth remembering. RCPs do not apply to resources in the management account. They also do not affect service-linked roles. RCPs cover only some services, including Amazon S3, AWS STS, AWS KMS, Amazon SQS, and AWS Secrets Manager. The list grows over time, so check the current documentation before you rely on one.
A first RCP
This RCP denies any S3 request that does not use TLS. It applies to every principal, including ones outside your organization.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceTLSOnS3",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"BoolIfExists": {
"aws:SecureTransport": "false"
}
}
}
]
}Three details matter here:
Principalis"*". An RCP cannot name specific principals. To narrow the scope, use condition keys such asaws:PrincipalOrgID.- The
EffectisDeny. As with SCPs, deny statements are the practical way to build guardrails. BoolIfExistsmakes the condition match when the key is missing from the request context, so those requests are denied too.
You create and attach an RCP the same way as an SCP, after you enable the policy type on the root. Use --type RESOURCE_CONTROL_POLICY with aws organizations create-policy. Then attach it with attach-policy to a root, an OU, or an account.
Common mistakes
- Expecting an RCP to restrict your own users. It does not. Use an SCP for that.
- Applying an RCP to a service that is not on the supported list. The policy attaches without error, but it does nothing for that service.
- Testing in the management account. Its resources are exempt, so you will see no effect.
Exercise
A bucket policy in a member account grants read access to an account outside your organization. Which control can block that access across all member accounts, an SCP or an RCP, and why?
Show answer
An RCP. The SCP applies only to principals in your organization's member accounts, and the outside principal is not one of them. An RCP is evaluated against the resource, so it can deny the outside request, for example by using aws:PrincipalOrgID in a condition.