Sub topic 8
What an RCP is and how it differs from an SCP
This chapter assumes you know how an organization tree is built (root, OUs, accounts), how policies attach and inherit, and how an SCP caps what principals can do. You should also be able to read IAM policy JSON. If SCP inheritance is still unclear, review the earlier chapters first.
The core idea
A resource control policy (RCP) sets the maximum permissions available on resources in the member accounts of an organization. An SCP limits what principals (users and roles) in your accounts can do. An RCP limits what can be done to your resources, whoever the caller is.
Neither policy type grants permissions. An RCP that allows an action does not let anyone perform it. A request still needs an identity-based or resource-based policy that allows it. RCPs and SCPs only remove options.
The practical difference is the direction of control:
- An SCP is attached to the side of the caller. It applies when a principal in one of your accounts makes a request, wherever that request goes.
- An RCP is attached to the side of the resource. It applies when a resource in one of your accounts receives a request, wherever that request comes from.
Consider an external account whose role reads an object from a bucket in your organization. Your SCPs have no say, because the caller is not in your organization. An RCP on the account that owns the bucket does apply to that request, so you can deny it centrally.
The external principal bypasses the SCP check, because SCPs only cover principals in your organization. It does not bypass the RCP check, because the resource lives in your account.
Side-by-side comparison
| Property | SCP | RCP |
|---|---|---|
| Limits | Permissions of principals in member accounts | Permissions on resources in member accounts |
| Evaluated against | The account of the principal making the request | The account that owns the resource |
| Affects external principals | No | Yes, when they access your resources |
| Grants permissions | No | No |
| Principal element | Not used | Must be `"*"` |
| Services covered | Essentially all AWS services | A supported list only |
| Default policy on root | `FullAWSAccess` | `RCPFullAWSAccess` |
| Policy type value in the CLI | `SERVICE_CONTROL_POLICY` | `RESOURCE_CONTROL_POLICY` |
The last two rows matter in practice. Enabling a policy type on the root attaches a default allow-all policy to it. That policy keeps existing behavior unchanged until you add a deny.
Supported services
SCPs apply to nearly every service. RCPs apply only to the services AWS has integrated. At launch this was Amazon S3, AWS STS, AWS KMS, Amazon SQS, and AWS Secrets Manager. AWS has been adding more, so check the current list in the Organizations documentation before relying on an RCP for a service.
This changes how you design a control. An RCP statement written for dynamodb:* has no effect until DynamoDB is on the supported list. A deny that does nothing looks the same as one that works, so verify with a test request.
Anatomy of an RCP
An RCP uses the same JSON grammar as other IAM policies, with some restrictions:
Principalis required and must be"*". You narrow who is affected with conditions, not with the principal element.Denystatements can use conditions, includingNotAction-style carve-outs in the supported form.Allowstatements are limited. In practice the only allow is the full-access statement inRCPFullAWSAccess, which has no conditions. Treat RCPs as deny lists.- The same inheritance rules as SCPs apply. A request must be allowed at the root, at each OU on the path, and at the account. Any explicit deny at any level wins.
Here is the TLS-enforcement RCP from the topic plan:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceTLSOnS3",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"BoolIfExists": {
"aws:SecureTransport": "false"
}
}
}
]
}This denies any S3 request in the covered accounts that does not use TLS. It applies to every caller: your own roles, other organizations' roles, and anonymous requests. No bucket policy can override it, because an explicit deny in an RCP is final.
BoolIfExists makes the condition match when the key is missing from the request context. Without the IfExists suffix, a request that lacks aws:SecureTransport would not match and would slip through.
Creating and attaching an RCP
The RCP workflow mirrors the SCP workflow. First enable the policy type on the root, as shown in the enablement chapter. Then create the policy and attach it:
aws organizations create-policy \
--name EnforceTLSOnS3 \
--description "Deny S3 requests that do not use TLS" \
--type RESOURCE_CONTROL_POLICY \
--content file://enforce-tls-s3.json
aws organizations attach-policy \
--policy-id p-examplepolicyid \
--target-id ou-exam-ple12345Attach to a test OU first. The target can be the root, an OU, or an account, and the policy affects the resources in every account beneath it.
To see what is attached to a target, list the policies by type:
aws organizations list-policies-for-target \
--target-id ou-exam-ple12345 \
--filter RESOURCE_CONTROL_POLICYWhere RCPs do not reach
Like SCPs, RCPs have exemptions. The documentation is the authority on the current list. The main ones to remember:
- Resources in the management account are not affected. Keep workloads out of that account.
- Requests made by service-linked roles are not restricted.
- Some AWS-managed resources, such as AWS managed KMS keys, are outside RCP control.
The inverse holds for SCPs. An SCP does not restrict the management account's principals, does not restrict service-linked roles, and does not affect principals outside your organization. Those gaps are why the two policy types complement each other.
Evaluation: how the two combine
For a cross-account request, evaluation considers both sides:
- The principal's account hierarchy: SCPs must allow the action, with no explicit deny.
- The resource's account hierarchy: RCPs must allow the action, with no explicit deny.
- The identity-based policy and the resource-based policy: the usual same-account or cross-account rules still apply, and an explicit deny anywhere ends evaluation.
For a same-account request, both the SCPs and RCPs of that one account's hierarchy apply to the same request. A request from a role in account A to a bucket in account A passes through account A's SCPs and account A's RCPs.
Common mistakes
- Expecting an RCP to grant access. Adding an allow to an RCP does nothing for callers who lack their own permissions.
- Writing a deny for an unsupported service. The policy attaches without error and has no effect.
- Denying too broadly with
Principal: "*". An RCP deny applies to AWS services acting on your behalf too. Some patterns need a condition such asaws:PrincipalIsAWSServiceso that, for example, a service delivering logs to your bucket is not blocked. - Forgetting the management account. An RCP does not protect a bucket there.
- Using an SCP where an RCP is needed. An SCP cannot stop an external principal from reading a bucket that your bucket policy shares with them.
Summary of when each one fits
Use an SCP when the control is about what your own principals may do, such as which Regions they use or whether they can leave the organization. Use an RCP when the control is about how your resources can be accessed, especially by principals you do not manage. Many controls need both, which later chapters cover under data perimeters.
Exercise
A role in an account outside your organization reads an object from an S3 bucket in one of your member accounts. The bucket policy allows it. You want to block this centrally for all member accounts. Can an SCP do it? What do you use instead, and what must be true about the service?
Show answer
An SCP cannot, because SCPs only restrict principals in your own organization and the caller is external. Use an RCP attached to the root or an OU that contains the bucket's account, with a Deny statement and Principal set to "*", for example one that checks aws:PrincipalOrgID. This works because Amazon S3 is a service supported by RCPs. Note that the bucket must not be in the management account, which RCPs do not cover.
Exercise
You attach an RCP to an OU with a single statement: Effect Allow, Principal "", Action "s3:GetObject", Resource "". Does this give roles in those accounts permission to read S3 objects? Explain.
Show answer
No. RCPs never grant permissions. They only set a maximum. Principals still need an identity-based or resource-based policy that allows the action. The statement is also not a valid pattern for RCPs, since the only allow they accept is the unrestricted full-access form used by RCPFullAWSAccess.
Exercise
Why does the TLS-enforcement RCP use BoolIfExists instead of Bool for aws:SecureTransport?
Show answer
BoolIfExists also matches when the key is absent from the request context. With plain Bool, a request that lacks the key would not match the condition, so the deny would not apply and the request would pass.