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.
Which one to use
| SCP | RCP | Declarative policy | AI services opt-out | |
|---|---|---|---|---|
| Applies to | IAM users and roles (and root) in member accounts | Resources in member accounts, whoever calls | Service configuration | Content use by AI services |
| Grants anything | No | No | n/a | n/a |
| Enforced at | Authorization of each API call | Authorization of each API call | The service's control plane | Service behaviour |
| Affects the management account | No | No | Applies to accounts it's attached to | Applies to accounts it's attached to |
| Affects service-linked roles | No | No | Yes | n/a |
| Example | Deny leaving the org, deny disabling GuardDuty | Deny access from outside the org to S3, KMS, Secrets Manager | Block public AMIs, IMDSv2 by default | Opt the whole org out of content use |
| Default policy | FullAWSAccess | RCPFullAWSAccess (cannot be detached) | None | None |
| Affects outside principals | No | Yes, anyone calling a resource in your accounts | n/a | n/a |
| Root user of a member account | Restricted | Restricted | Governed | n/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
FullAWSAccessattached and addDenystatements. New services are allowed until you deny them. Easier to maintain. - Allow list: replace
FullAWSAccesswith 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
FullAWSAccesswithout a replacement blocks every action. Disabling the SCP policy type detaches all SCPs, and re-enabling restores onlyFullAWSAccess. - SCPs support
Condition,NotActionandNotResourcein both allow and deny statements.Resourcein an allow must be*.PrincipalandNotPrincipalaren't supported, so exempt roles with anaws:PrincipalArncondition. - 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 (withNotActionfor 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.
RCPFullAWSAccessis 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:SourceOrgIDfor 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.
| Attribute | Values or purpose |
|---|---|
| VPC Block Public Access | off, block_ingress, block_bidirectional, plus whether accounts may create exclusions |
| VPC Encryption Controls | unmanaged, attempt_monitor, attempt_enforce for encryption in transit inside and between VPCs |
| Image Block Public Access (AMI) | unblocked, block_new_sharing |
| Snapshot Block Public Access | unblocked, block_new_sharing, block_all_sharing |
| Allowed Image Settings | Approved 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 Defaults | http_tokens (required means IMDSv2), http_tokens_enforced, hop limit, endpoint, metadata tags |
| EC2 Serial Console Access | enabled 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:
| Perimeter | Question | Enforced with |
|---|---|---|
| Identity | Only trusted identities can reach my resources | RCPs and resource policies with aws:PrincipalOrgID, aws:PrincipalIsAWSService |
| Resource | My identities can only reach trusted resources | SCPs and VPC endpoint policies with aws:ResourceOrgID |
| Network | Access only from expected networks | RCPs, SCPs, resource policies and endpoint policies with aws:SourceVpc, aws:SourceVpce, aws:SourceIp, aws:ViaAWSService |
- Exempt AWS services acting on your behalf with
aws:PrincipalIsAWSServiceandaws: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
| Item | Value |
|---|---|
| SCP size | 10,240 characters |
| RCP size | 5,120 characters |
| Declarative and tag and backup policy size | 10,000 characters |
| AI opt-out policy size | 2,500 characters |
| Policies attached per entity | SCP 10, RCP 5 (including the default), declarative 10 |
| OU nesting | 5 levels below the root |
| Roots per organization | 1 |
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
An RCP caps what any caller can do to resources in member accounts, including outside principals that SCPs never see. An SCP only restricts the company's own principals, so it can't stop the contractor. Config and Access Analyzer detect the problem after the fact instead of preventing it.
Declarative policies are enforced by the service's control plane, so they keep working for new APIs, and they support custom error messages. The SCP works today but only covers the actions and keys you listed. Config remediates after launch, and a tag policy only governs tag values.
SCPs apply only to member accounts, even when attached at the root. SCPs don't support NotPrincipal, service-linked roles don't create IAM users, and SCPs apply within minutes, not weeks. The fix is to lock down who can sign in to the management account and alert on IAM changes there.
Related
- Policy evaluation logic
- Permissions boundaries and iam:PassRole
- Access Analyzer, policy simulator and least privilege tools
- SCPs and RCPs
- AWS Organizations and multi-account design
- Organizations quick reference
Further reading
- Service control policies (SCPs)
- SCP evaluation
- Resource control policies (RCPs)
- Declarative policies
- Declarative policies for Amazon EC2
- EC2 declarative policy syntax and examples
- AI services opt-out policy syntax and examples
- Quotas and name restrictions for AWS Organizations
- The confused deputy problem
- Building a data perimeter on AWS
Permissions boundaries and iam:PassRole
Boundary versus SCP versus session policy, safe delegation of IAM administration, preventing privilege escalation through PassRole, and service-linked roles.
Access Analyzer, policy simulator and least privilege tools
IAM Access Analyzer analyzers, policy validation, custom checks and generation, the policy simulator, last accessed data and reading AccessDenied messages.