Skip to Content
Asterrr's Handbook
4 · Identity and access management

Organizations SCPs, RCPs and declarative policies

Service control policies, resource control policies, declarative policies and AI opt-out policies. What each guards, what it cannot touch, how they combine and how they build data perimeters.

Exam tasks: 4.2 (Skills 4.2.1 authorization controls and cross-account resource policies, 4.2.3 least privilege), 6.1 (central governance across accounts, see multi-account organizations)

The decision: is the guardrail about what your principals may do, who may reach your resources, or how a service is configured, and which organization policy enforces that at scale?

AWS Organizations policies need an organization with all features enabled. SCPs and RCPs never grant permissions. They set the ceiling. Declarative policies work differently, because the service control plane enforces them.

Organization root or OUMember accountcaps actionscaps accessGetObjectblocked by RCPSCPRCPRoleS3 bucketOutsideprincipal
Policies attached at the root, an OU or an account flow downward. An SCP caps the principal side, an RCP caps the resource side.

Which one to use

What must be enforcedacross every account?What our principals cancallWho can reach ourresourcesA service setting stayson, whatever the APIAWS AI services don't useour contentSCPRCPDeclarativepolicy (EC2,VPC, EBS)AI services opt-out policy
Decision tree for choosing the policy type
SCPRCPDeclarative policyAI services opt-out
Applies toIAM users and roles (and root) in member accountsResources in member accounts, whoever callsService configurationContent use by AI services
Grants anythingNoNon/an/a
Enforced atAuthorization of each API callAuthorization of each API callThe service's control planeService behaviour
Affects the management accountNoNoApplies to accounts it's attached toApplies to accounts it's attached to
Affects service-linked rolesNoNoYesn/a
ExampleDeny leaving the org, deny disabling GuardDutyDeny access from outside the org to S3, KMS, Secrets ManagerBlock public AMIs, IMDSv2 by defaultOpt the whole org out of content use
Default policyFullAWSAccessRCPFullAWSAccess (cannot be detached)NoneNone
Affects outside principalsNoYes, anyone calling a resource in your accountsn/an/a
Root user of a member accountRestrictedRestrictedGovernedn/a

Exam signal

"Prevent any account in the organization from disabling CloudTrail or leaving the org" is an SCP deny. "Stop anyone outside the organization reaching buckets even if a bucket policy is too open" is an RCP. "Block public AMI and snapshot sharing, enforce IMDSv2 for every account, even new APIs" is a declarative policy.

SCP rules

  • Deny list (usual): keep FullAWSAccess attached and add Deny statements. New services are allowed until you deny them. Easier to maintain.
  • Allow list: replace FullAWSAccess with allows for approved services only. Tighter, more upkeep. An allow is needed at every level from the root through each OU to the account, and a deny at any level wins.
  • Removing FullAWSAccess without a replacement blocks every action. Disabling the SCP policy type detaches all SCPs, and re-enabling restores only FullAWSAccess.
  • SCPs support Condition, NotAction and NotResource in both allow and deny statements. Resource in an allow must be *. Principal and NotPrincipal aren't supported, so exempt roles with an aws:PrincipalArn condition.
  • They affect IAM users, roles and the root user in member accounts. They don't apply to the management account, service-linked roles, and principals from outside the organization calling your resources (that's what RCPs are for).
  • They don't touch resource-based policies directly, so a bucket policy can still let an outside account in.
  • Use service last accessed data to find services to deny.
  • Common guardrails: deny organizations:LeaveOrganization, deny stopping CloudTrail or GuardDuty, deny actions outside approved Regions (with NotAction for global services), deny creating IAM users or access keys, deny root user actions in member accounts.
{
  "Sid": "ProtectSecurityTooling",
  "Effect": "Deny",
  "Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail", "guardduty:DeleteDetector", "config:StopConfigurationRecorder"],
  "Resource": "*",
  "Condition": { "ArnNotLike": { "aws:PrincipalArn": "arn:aws:iam::*:role/sec-breakglass" } }
}

Protecting the management account with an SCP

SCPs never restrict the management account, so no SCP can stop someone there. Keep workloads out of the management account, lock down its access, and use a delegated administrator member account for security services.

Things SCPs cannot restrict

Item
Any action by the management account
Actions through a service-linked role
Root user registering for the Enterprise support plan
CloudFront trusted signer for private content
Reverse DNS for Lightsail or EC2 email, as root
Alexa Top Sites, Alexa Web Information Service, Mechanical Turk, Product Marketing API

RCP rules

  • The resource-side twin of SCPs: a ceiling on what any principal, including ones from other organizations and root users, can do to resources in your member accounts.
  • Supported by a long and growing list of services, including S3, STS (role trust), KMS, SQS, Secrets Manager, DynamoDB, ECR, CloudWatch Logs, Cognito, OpenSearch Serverless, EventBridge, WAF and IAM Roles Anywhere. Check the current list before relying on one.
  • RCPFullAWSAccess is attached everywhere and can't be detached, so RCPs are always deny-style.
  • Not restricted: resources in the management account, calls by service-linked roles, and AWS managed KMS keys. An RCP does not affect kms:RetireGrant.
  • Typical uses are a data perimeter (only my organization may reach my buckets), enforcing TLS, and confused deputy control with aws:SourceOrgID for service principals.
  • One RCP can stop a misconfigured bucket policy from ever sharing data outside the company, however the bucket owner writes it. Use Access Analyzer external access findings to preview the impact before enforcement.
{
  "Sid": "EnforceOrgOnlyAccess",
  "Effect": "Deny",
  "Principal": "*",
  "Action": ["s3:*", "sqs:*", "kms:*", "secretsmanager:*", "sts:AssumeRole"],
  "Resource": "*",
  "Condition": {
    "StringNotEqualsIfExists": { "aws:PrincipalOrgID": "o-k7pq2example" },
    "BoolIfExists": { "aws:PrincipalIsAWSService": "false" }
  }
}

Exam signal

"Ensure no resource in any account can be accessed from outside the organization, even if a developer writes a permissive resource policy" means an RCP with aws:PrincipalOrgID. "Ensure our employees can't use resources outside the organization" means an SCP (or VPC endpoint policy) with aws:ResourceOrgID.

Declarative policies

Declarative policies are enforced in the service control plane, so they keep working when a service adds new APIs. They apply to an org, OU or account, and new accounts inherit them. Detaching a policy rolls an attribute back to its prior state. Account administrators cannot override an enforced attribute. A custom error message can point users at an internal wiki (avoid PII). The account status report shows, per attribute and Region, how many accounts match and which value is most common, so run it before enforcing. Today the EC2 policy type covers EC2, VPC and EBS attributes.

AttributeValues or purpose
VPC Block Public Accessoff, block_ingress, block_bidirectional, plus whether accounts may create exclusions
VPC Encryption Controlsunmanaged, attempt_monitor, attempt_enforce for encryption in transit inside and between VPCs
Image Block Public Access (AMI)unblocked, block_new_sharing
Snapshot Block Public Accessunblocked, block_new_sharing, block_all_sharing
Allowed Image SettingsApproved AMI providers by account ID or alias (amazon, aws_marketplace, aws_backup_vault). Up to 10 criteria, 200 providers. States enabled, disabled, audit_mode
Instance Metadata Defaultshttp_tokens (required means IMDSv2), http_tokens_enforced, hop limit, endpoint, metadata tags
EC2 Serial Console Accessenabled or disabled

AI services opt-out policy

Controls whether AWS AI services may use your content for service improvement. Key default covers all current and future AI services. Only @@assign is supported, with values optOut or optIn. @@operators_allowed_for_child_policies set to @@none stops children overriding.

  • Set it once at the root for all supported services (default), or per service. Accounts can be prevented from overriding the parent's choice.
  • Opting out also deletes historical content the service kept for that purpose, but not content it needs to provide the service to you.

Data perimeters

A data perimeter is three questions, answered with three kinds of policy:

Identity perimeterResource perimeterNetwork perimeterOnly our principalsaws:PrincipalOrgIDOnly our resourcesaws:ResourceOrgIDOnly expected networksaws:SourceVpc,aws:SourceIpIDCompany dataRSNW
Diagram of data perimeters
PerimeterQuestionEnforced with
IdentityOnly trusted identities can reach my resourcesRCPs and resource policies with aws:PrincipalOrgID, aws:PrincipalIsAWSService
ResourceMy identities can only reach trusted resourcesSCPs and VPC endpoint policies with aws:ResourceOrgID
NetworkAccess only from expected networksRCPs, SCPs, resource policies and endpoint policies with aws:SourceVpc, aws:SourceVpce, aws:SourceIp, aws:ViaAWSService
  • Exempt AWS services acting on your behalf with aws:PrincipalIsAWSService and aws:ViaAWSService, or the perimeter breaks CloudTrail delivery, replication and similar.
  • Roll out in stages: test in one OU, watch CloudTrail for AccessDenied, then widen.

Limits

ItemValue
SCP size10,240 characters
RCP size5,120 characters
Declarative and tag and backup policy size10,000 characters
AI opt-out policy size2,500 characters
Policies attached per entitySCP 10, RCP 5 (including the default), declarative 10
OU nesting5 levels below the root
Roots per organization1

Exam trap

An SCP does not stop an external account listed in a bucket policy. It also never grants access, so Allow * in an SCP with no IAM policy still gives nothing. Size limits to remember: SCP 10,240 characters, RCP 5,120, up to 10 SCPs and 5 RCPs attached per root, OU or account.

Scenarios

Scenario
A healthcare company has 90 accounts. A recent incident involved a developer adding a bucket policy that granted read access to a contractor's personal AWS account. The CISO wants a control that prevents any principal outside the organization from reading S3 objects or retrieving secrets in any member account, regardless of the resource policy. What should the security team implement?
Scenario
A company requires IMDSv2 on every new EC2 instance in all member accounts. It wants the setting to hold even if AWS introduces new launch APIs, and to show users a link to the internal standard when a launch is rejected. What should it use?
Scenario
A security architect adds an SCP to the organization root that denies iam:CreateUser. Two weeks later, a new IAM user appears in the management account. What explains this?

Further reading

On this page