Sub topic 2
Authorization policy types and enabling them
This chapter covers the policy types that AWS Organizations offers, the two that control authorization, and how to turn them on. It assumes you can read IAM policy JSON, know the difference between identity-based and resource-based policies, and have used the AWS CLI. It also assumes you know the root, OUs, and accounts from the previous chapter.
Policy types in AWS Organizations
AWS Organizations supports several policy types. They fall into two families, and the family tells you what a policy does.
| Family | Policy types | What the policy does |
|---|---|---|
| Authorization policies | Service control policies (SCPs), resource control policies (RCPs) | Set the maximum permissions available in member accounts. They affect whether a request is allowed. |
| Management policies | Tag policies, backup policies, declarative policies, and others | Configure or standardize how services behave. They do not decide whether a request is authorized. |
This tutorial covers the authorization family only. The two types differ in what they limit:
- An SCP limits what the principals (IAM users and roles) in your member accounts can do.
- An RCP limits what can be done to the resources in your member accounts, no matter who makes the request. That includes principals from outside your organization.
Neither type grants permissions. An SCP or RCP only sets a ceiling. A request still needs an allow from an identity-based or resource-based policy, and the ceiling must not block it. Chapter 4 covers this in detail.
Enablement is per root and per type
A policy type is not active by default. You must enable it on the organization root before you can attach any policy of that type to the root, an OU, or an account. Three facts about enablement matter in practice:
- It is per type. Enabling SCPs does not enable RCPs. You run the enable step once for each type.
- It is per root. The setting lives on the root. Today an organization has one root, so in effect it applies to the whole organization.
- It needs the management account. Only credentials from the management account can enable or disable a policy type. The caller needs the
organizations:EnablePolicyTypepermission.
There is also a precondition. The organization must use the all features feature set. An organization created with only consolidated billing cannot use SCPs or RCPs. Check the setting like this:
aws organizations describe-organization \
--query 'Organization.FeatureSet' \
--output textIf the output is CONSOLIDATED_BILLING, run aws organizations enable-all-features. Accounts that joined by invitation must approve the change before it completes. Accounts created from within the organization need no approval.
Enabling SCPs and RCPs with the CLI
First find the root ID. The list-roots response also shows which policy types are already enabled.
# Find the root ID, then enable both policy types on it
aws organizations list-roots
aws organizations enable-policy-type \
--root-id r-examplerootid \
--policy-type SERVICE_CONTROL_POLICY
aws organizations enable-policy-type \
--root-id r-examplerootid \
--policy-type RESOURCE_CONTROL_POLICYThe --policy-type values are SERVICE_CONTROL_POLICY and RESOURCE_CONTROL_POLICY. Each enable-policy-type call returns the root with its PolicyTypes list. To check the result later, query only that list:
aws organizations list-roots \
--query 'Roots[0].PolicyTypes' \
--output tableEach entry has a Type and a Status. The status is one of three values:
ENABLED: you can create, attach, and enforce policies of this type.PENDING_ENABLE: the change is in progress.PENDING_DISABLE: the change is in progress.
An unlisted type is simply not enabled. The pending states are short. If you run an attach command and get an error saying the policy type is not enabled, check the status first.
In the console you do the same on the Policies page. Choose Service control policies or Resource control policies, then Enable.
What enabling does to your accounts
Enabling a policy type changes behavior in a way that surprises people, so read this section before you run the command in a production organization.
The default allow-all policy
When you enable SCPs, AWS Organizations creates an AWS managed policy named FullAWSAccess and attaches it to the root, every OU, and every account. The policy allows all actions on all resources. Because SCPs filter permissions rather than grant them, an allow-all SCP is what keeps your accounts working after enablement. Nothing changes for your users at that moment.
RCPs work the same way. Enabling RCPs creates and attaches an AWS managed policy named RCPFullAWSAccess. It allows all actions for all principals on all resources, so existing access keeps working.
These default policies carry the "allow" part of your design. Two rules follow from that:
- Every root, OU, and account must have at least one SCP attached. You cannot detach the last one.
- If you detach
FullAWSAccessfrom an entity and attach nothing that allows actions, that entity allows nothing. Detaching it is how you build an allow-list strategy, covered in a later chapter. Do it by accident and your accounts lose access.
The default policies are managed by AWS. You cannot edit or delete them. To start with a deny-list strategy, leave them attached and add deny policies next to them.
Disabling a policy type
Disabling is more drastic than enabling:
aws organizations disable-policy-type \
--root-id r-examplerootid \
--policy-type RESOURCE_CONTROL_POLICYWhen you disable a type, AWS Organizations detaches every policy of that type from the root, every OU, and every account. The policies themselves still exist, but all their attachments are gone. If you enable the type again later, you start over: only the default allow-all policy is attached, and you must re-attach your custom policies yourself.
Disabling a type removes your guardrails at once, which makes it a risky action. Control who can call organizations:DisablePolicyType, and record the attachments before any planned disable. A listing like this captures them:
aws organizations list-targets-for-policy \
--policy-id p-examplepolicyidCreating and attaching policies
With a type enabled, the workflow has two steps: create the policy, then attach it to a target. This example creates an SCP from a JSON file and attaches it to a test OU.
aws organizations create-policy \
--name DenyLeavingOrganization \
--description "Prevent member accounts from leaving the organization" \
--type SERVICE_CONTROL_POLICY \
--content file://deny-leave-org.json
aws organizations attach-policy \
--policy-id p-examplepolicyid \
--target-id ou-exam-ple12345The file deny-leave-org.json holds the policy document:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyLeavingOrganization",
"Effect": "Deny",
"Action": "organizations:LeaveOrganization",
"Resource": "*"
}
]
}The --type value on create-policy must match an enabled type. The --target-id can be a root ID (r-...), an OU ID (ou-...), or a 12-digit account ID. An RCP uses the same two commands with --type RESOURCE_CONTROL_POLICY.
Creating a policy has no effect on its own. A policy has no effect until you attach it. This separation lets you create and review a policy before it enforces anything.
Limits to know
Policy types come with quotas. The values below are the documented defaults at the time of writing, and the current quotas are listed in the AWS Organizations documentation.
| Limit | Value |
|---|---|
| Maximum size of an SCP or RCP document | 5,120 characters, including whitespace |
| Policies of one type attached to a single root, OU, or account | 5 |
| Minimum SCPs attached to a root, OU, or account | 1 |
The size limit pushes you to write compact policies. Use wildcards and condition keys, and avoid whitespace padding. The attachment limit of five counts directly attached policies only. Inherited policies from parent OUs do not count against it. Combine this with the per-entity minimum when you plan how many separate policies to attach at each level.
Common errors
PolicyTypeNotEnabledExceptiononattach-policymeans the type is not enabled on the root. Runlist-rootsand look at the status.PolicyTypeNotAvailableForOrganizationExceptionon enable means the organization still uses consolidated billing only. Enable all features first.AccessDeniedExceptionon enable usually means you are not using management account credentials, or your role lacksorganizations:EnablePolicyType.- Unexpected access loss after re-enabling means the earlier disable removed all custom attachments. Re-attach them.
Exercise
Your organization enabled SCPs last year and now wants to use RCPs. A colleague says enabling RCPs is unnecessary because SCPs are already active. What do you tell them? Name the CLI command, the value that goes in --policy-type, and the policy AWS Organizations attaches automatically.
Show answer
Each policy type is enabled separately on the root, so active SCPs do not enable RCPs. Run aws organizations enable-policy-type --root-id <root-id> --policy-type RESOURCE_CONTROL_POLICY from the management account. The organization must already use all features, which it does if SCPs work. AWS Organizations then attaches the managed policy RCPFullAWSAccess to the root, OUs, and accounts, so existing access continues until you attach restrictive RCPs.
Exercise
An engineer disables the SCP policy type to "reset" a broken configuration, then enables it again an hour later. What happened to the custom SCPs, and what protection is now in place?
Show answer
Disabling removed every SCP attachment from the root, OUs, and accounts. The policies still exist but are not attached. After re-enabling, only FullAWSAccess is attached everywhere, so the custom guardrails are not enforced until someone re-attaches them. Use list-targets-for-policy before any planned disable to record where each policy was attached.