Sub topic 3
Writing RCPs and Checking Supported Services
Assume you understand IAM policy JSON, identity-based policies, and AWS Organizations. A resource control policy (RCP) is an organization-level guardrail that sets the maximum permissions on supported resources. An RCP does not grant access. An identity-based or resource-based policy must still allow the request.
Write and verify an RCP
RCP support is service-specific. Before writing one, check the current AWS documentation for supported services, resource types, actions, and condition keys. Do not assume that every resource-based service supports RCPs.
This RCP requires HTTPS for Amazon S3 requests:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "RequireTLS",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"BoolIfExists": {
"aws:SecureTransport": "false"
}
}
}
]
}Create the policy only after checking that S3 and the chosen condition key are supported:
aws organizations create-policy \
--name RequireTlsForS3 \
--description "Deny S3 requests that do not use TLS" \
--type RESOURCE_CONTROL_POLICY \
--content file://require-tls-s3.jsonAttach it to a test organizational unit (OU) first. RCPs inherit from the root or an OU to resources in descendant accounts.
Choose the right control
| Control | Main scope | Grants permissions? |
|---|---|---|
| RCP | Supported resources across accounts | No |
| SCP | Principals and actions in accounts | No |
| Permission boundary | One user or role | No |
| IAM policy | A user, role, or resource | Yes, when evaluation permits |
Use an RCP for resource-focused requirements, such as an organization-wide S3 TLS requirement. Use an SCP to restrict what principals can do, such as preventing Regions or actions.
Data perimeter patterns
A data perimeter combines controls. An RCP can deny access to S3 resources from principals outside your organization. An SCP can restrict principals from accessing resources outside approved accounts or Regions. Add explicit exceptions for approved AWS services and third parties, then test those exceptions separately.
Roll out and troubleshoot
Use a test OU and representative roles, including automation and service roles. Start with monitoring and narrowly scoped denies where possible. Expand only after reviewing CloudTrail events and failed workflows.
When access fails, check:
- The request's account, Region, action, and resource.
- SCPs inherited from the root, parent OUs, and account.
- RCPs attached at those same levels.
- Whether the service and resource type support the policy.
- Whether a condition key, principal exception, or explicit deny matches.
Exercise
Which control should require TLS for every supported S3 resource in an organization?
Show answer
An RCP, because the requirement targets resources rather than the actions of one principal.