Sub topic 13
Beyond SCPs: RCPs, Tag, Backup and Declarative Policies
This chapter assumes you can write SCPs and attach them to OUs, as covered earlier. AWS Organizations supports four more policy types. Each uses the same attach-and-inherit model as SCPs, but they control different things.
The policy types at a glance
| Policy type | CLI type value | What it controls |
|---|---|---|
| Resource control policy (RCP) | `RESOURCE_CONTROL_POLICY` | The maximum permissions on resources in member accounts |
| Tag policy | `TAG_POLICY` | Tag keys and allowed values |
| Backup policy | `BACKUP_POLICY` | AWS Backup plans applied across accounts |
| Declarative policy | `DECLARATIVE_POLICY_EC2` | Baseline service configuration, such as blocking public snapshots |
Each type must be enabled on the root before you can create or attach policies of that type.
aws organizations enable-policy-type \
--root-id r-examplerootid111 \
--policy-type RESOURCE_CONTROL_POLICYResource control policies
An SCP limits what your principals can do. An RCP limits what can be done to your resources, whoever the caller is. This includes principals from outside the organization. Like SCPs, RCPs never grant permissions. They only set a ceiling. They apply to a supported list of services, including S3, STS, KMS, SQS and Secrets Manager, and they do not affect the management account.
The usual use is a data perimeter. This RCP denies S3 access from any principal outside your organization, except AWS services acting on your behalf:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceOrgIdentities",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"StringNotEqualsIfExists": {
"aws:PrincipalOrgID": "o-exampleorgid"
},
"BoolIfExists": {
"aws:PrincipalIsAWSService": "false"
}
}
}
]
}RCPs require "Principal": "*". Test before attaching, because this policy also blocks legitimate third-party access, such as a vendor reading a bucket. Add exceptions for those principals first.
Tag policies
A tag policy defines the allowed tag keys and values, such as CostCenter being one of two codes. This helps cost allocation work. By default, a tag policy only reports noncompliant resources. Add enforced_for to block noncompliant tagging on the listed resource types.
{
"tags": {
"CostCenter": {
"tag_key": { "@@assign": "CostCenter" },
"tag_value": { "@@assign": ["1001", "1002"] },
"enforced_for": { "@@assign": ["ec2:instance"] }
}
}
}Backup and declarative policies
A backup policy defines an AWS Backup plan once, at the OU level. It then creates the plan in each member account and selects resources, often by tag. This makes tag policies and backup policies work together: a resource tagged Backup=daily is picked up automatically.
A declarative policy enforces a service setting at the service level, so it holds even when new APIs or features appear. Examples include blocking public access to EBS snapshots or AMIs, and requiring IMDSv2 by default. An SCP only denies specific API calls, so it can miss a new route to the same result. A declarative policy sets the end state.
Choosing between them
Exercise
A security team wants to guarantee that no principal outside the organization can read objects in any member account's S3 buckets, even if a developer writes a permissive bucket policy. Which policy type fits, and why not an SCP?
Show answer
A resource control policy. SCPs only limit principals inside the organization, so they cannot restrict an outside principal reaching a bucket. An RCP applies to the resource itself, whoever the caller is. The RCP has to be enabled on the root and attached to the OU or accounts.