AWS Builder Center
What Are SCPs? A Hands-On Guide to AWS Service Control Policies

What Are SCPs? A Hands-On Guide to AWS Service Control Policies

Learn how AWS Service Control Policies cap permissions across your org. Hands-on guide to region locks and guardrails even an admin can't bypass.

Developer Advocate @ AgilityFeat & WebRTC.ventures
Picture an AWS account where a developer has  Action: "*"  on  Resource: "*" . One afternoon their access key leaks, or they fat-finger a script. Now someone can stop CloudTrail logging, flip an S3 bucket public, and launch GPU instances in a region you've never used — and your IAM policies are powerless to stop them, because the IAM policy is the thing that says "allow everything."

This is the gap that account-level IAM can't close. An account administrator can always rewrite their own account's IAM policies. You need a control that sits above the account, one that an account admin cannot edit or escape. In AWS Organizations, that control is the Service Control Policy (SCP).

This post explains what SCPs are, how they interact with IAM, and then walks through building real guardrails hands-on: a region lock and a set of policies that stop anyone from disabling your security services.

The Admin Who Can't Be Stopped

IAM policies live inside an account, and whoever holds IAM write permissions in that account controls them. That's fine until it isn't:

  • A principal with broad permissions gets compromised.
  • A team spins up resources in unapproved regions, inflating cost and widening your attack surface.
  • Someone disables CloudTrail or GuardDuty — maybe maliciously, maybe to "quiet the noise."

In every case, the account's own IAM is the wrong layer to enforce the rule, because the people you're guarding against can change it. You need enforcement that the account cannot override. That's exactly what SCPs provide.

What an SCP Actually Is

A Service Control Policy (SCP) is a type of organization policy in AWS Organizations that sets the maximum available permissions for the principals (IAM users and roles) in your member accounts. The single most important thing to understand: SCPs never grant permissions. They only define the ceiling. You still need identity-based or resource-based IAM policies to actually allow actions. ( AWS docs )

So the effective permission for any action is the intersection of what the SCP allows and what IAM allows. An action succeeds only if both permit it.



Here are some things to consider when enabling SCPs:

  • SCPs require AWS Organizations with all features enabled. They aren't available if you only use consolidated billing. ( AWS docs )
  • Evaluation is deny-by-default. If no attached SCP allows an action anywhere along the path from the root to the account, it's denied.

SCPs also have blind spots — things they deliberately don't touch — but those matter most once you're deploying guardrails for real, so we'll cover them after the hands-on.

FullAWSAccess, Allow Lists, and Deny Lists

Because evaluation is deny-by-default, AWS attaches a managed SCP named  FullAWSAccess  to the root, every organizational unit (OU), and every account when you enable SCPs. It allows all services and all actions, which is what keeps everything working before you add any guardrails. ( AWS docs )

That default gives you two strategies:

  • Deny list (common): Leave  FullAWSAccess  attached and add SCPs with  Effect: Deny  to carve out specific prohibited actions. Everything stays allowed except what you explicitly block.
  • Allow list (restrictive): Replace  FullAWSAccess  with an SCP that explicitly allows only an approved set of services. Anything not listed is denied.

Most teams run deny lists, because an allow list means you have to enumerate every service your accounts legitimately use. We'll build deny-list guardrails below.

With the model clear, let's set up an organization and write our first SCP.

Hands-On: Your First Region-Restriction SCP

SCPs require AWS Organizations. Creating an organization is free (but any billable service running on any child account will cost money). If you'd rather not enable it on your account, read this as a conceptual walkthrough — the policy JSON is the part that matters.
First, make sure you have an organization with all features enabled. The AWS CLI command below is idempotent in spirit: check first, create only if needed.

# Check whether an organization already exists
aws organizations describe-organization 2>/dev/null

# If none exists, create one with ALL features (required for SCPs)
aws organizations create-organization --feature-set ALL

SCPs can be attached to the root, an OU, or an individual account. Attaching to an OU is the realistic pattern: you group accounts by purpose and apply guardrails per group. Create a  Sandbox  OU to target.

# Get the root ID — every organization has exactly one root
ROOT_ID=$(aws organizations list-roots --query 'Roots[0].Id' --output text)

# Create a Sandbox OU under the root; capture its ID for the attach step
SANDBOX_OU_ID=$(aws organizations create-organizational-unit \
--parent-id "$ROOT_ID" \
--name Sandbox \
--query 'OrganizationalUnit.Id' --output text)

echo "Root: $ROOT_ID Sandbox OU: $SANDBOX_OU_ID"

Enabling "all features" makes SCPs available, but it doesn't turn them on. Before you can create or attach an SCP, you have to enable the  SERVICE_CONTROL_POLICY  policy type on the root — a one-time task run from the management account. Skip this and the attach step later fails with  PolicyTypeNotEnabledException .

# Enable SCPs on the root (one-time, asynchronous)
aws organizations enable-policy-type \
--root-id "$ROOT_ID" \
--policy-type SERVICE_CONTROL_POLICY

# Confirm it reports ENABLED before continuing
aws organizations list-roots --query 'Roots[0].PolicyTypes'
# Expect: [{"Type":"SERVICE_CONTROL_POLICY","Status":"ENABLED"}]

Now the policy itself. This SCP denies every action whose request targets a region outside an approved list. The  aws:RequestedRegion  condition key is what makes region locking possible — it's present on nearly every request. We also add an exception so a designated break-glass role can still operate everywhere.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyNonApprovedRegions",
"Effect": "Deny",
"Action": "*",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["us-east-1", "eu-west-1"]
},
"ArnNotLike": {
"aws:PrincipalARN": "arn:aws:iam::*:role/OrganizationAdmin"
}
}
}
]
}

What each piece does:

  •  Effect: Deny  on  Action: "*"  — a broad block that the condition then narrows.
  •  StringNotEquals  on  aws:RequestedRegion  — the deny applies only when the region is not one of the approved two.
  •  ArnNotLike  on  aws:PrincipalARN  — excludes the  OrganizationAdmin  role so it isn't caught by the lock (your break-glass path).
Note on global services: a region-lock SCP like this can also block IAM, CloudFront, Route 53, and other global services whose requests resolve to  us-east-1 . Keeping  us-east-1  in the approved list, as above, avoids locking yourself out of them.
Save that JSON as  region-restrict-scp.json , create the policy, and attach it to the Sandbox OU.

# Create the SCP from the JSON file and capture its policy ID
SCP_ID=$(aws organizations create-policy \
--name "RegionRestriction" \
--description "Deny actions outside us-east-1 and eu-west-1" \
--type SERVICE_CONTROL_POLICY \
--content file://region-restrict-scp.json \
--query 'Policy.PolicySummary.Id' --output text)

# Attach it to the Sandbox OU so every account in that OU inherits the guardrail
aws organizations attach-policy \
--policy-id "$SCP_ID" \
--target-id "$SANDBOX_OU_ID"

Any account moved into the Sandbox OU is now blocked from acting in unapproved regions — even if its IAM policies say  Allow * . That's the guardrail doing its job: the account admin cannot escape it.

Region locking is a good warm-up. The higher-value use case is protecting the controls that keep you safe in the first place.

Hands-On: Guardrails That Protect Your Security Services

Here's a classic textbook scenario: stop anyone in the organization from turning off logging and threat detection. IAM can't guarantee this because an account admin could grant themselves the permission. An SCP can, because it caps the ceiling regardless of IAM.

This SCP denies the actions that would disable CloudTrail, GuardDuty, and AWS Config, plus the action to leave the organization. Each statement targets a specific set of destructive API calls.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ProtectCloudTrail",
"Effect": "Deny",
"Action": [
"cloudtrail:StopLogging",
"cloudtrail:DeleteTrail"
],
"Resource": "*"
},
{
"Sid": "ProtectGuardDuty",
"Effect": "Deny",
"Action": [
"guardduty:DeleteDetector",
"guardduty:DisassociateFromMasterAccount",
"guardduty:UpdateDetector"
],
"Resource": "*"
},
{
"Sid": "ProtectConfig",
"Effect": "Deny",
"Action": [
"config:StopConfigurationRecorder",
"config:DeleteConfigurationRecorder",
"config:DeleteDeliveryChannel"
],
"Resource": "*"
},
{
"Sid": "DenyLeavingOrg",
"Effect": "Deny",
"Action": "organizations:LeaveOrganization",
"Resource": "*"
}
]
}

Why these specific actions:

  • CloudTrail —  StopLogging  and  DeleteTrail  are the two ways to blind your audit trail.
  • GuardDuty — deleting or disassociating the detector, or updating it to a no-op, all effectively disable threat detection.
  • Config — stopping or deleting the configuration recorder halts compliance evaluation.
  • Organizations —  LeaveOrganization  would let a member account escape all your SCPs at once, so it's the most important line in the file.

Create and attach it the same way as before:

# Create the security-guardrails SCP from its JSON file
GUARDRAIL_ID=$(aws organizations create-policy \
--name "SecurityGuardrails" \
--description "Prevent disabling security services and leaving the org" \
--type SERVICE_CONTROL_POLICY \
--content file://security-guardrails-scp.json \
--query 'Policy.PolicySummary.Id' --output text)

# Attach to the Sandbox OU alongside the region-lock SCP (both apply together)
aws organizations attach-policy \
--policy-id "$GUARDRAIL_ID" \
--target-id "$SANDBOX_OU_ID"

Both SCPs now apply to accounts in the OU simultaneously. Multiple deny statements combine — an action is blocked if any attached SCP denies it. You've built a layered guardrail that no account admin inside the OU can remove.

Before you roll anything like this out broadly, it's worth knowing exactly where SCPs stop working.

Where SCPs Don't Reach

SCPs are powerful, but their blind spots determine how you architect a multi-account setup. Keep these in mind:

  • The management account is exempt. No SCP restricts it. Treat it as a control plane, not a place to run workloads, data, or anything you'd want guardrailed.
  • Service-linked roles bypass SCPs. Actions a service performs on your behalf via a service-linked role aren't filtered, so don't rely on an SCP to constrain them.
  • SCPs constrain your principals, not external ones. A resource policy that lets an outside account in isn't limited by your SCPs. Guard cross-account access with resource policies too.
  • Deny lists are safer to iterate on than allow lists. An over-aggressive allow list can lock an account out of a service it quietly depends on. Start with targeted denies.
  • Always keep a break-glass path. The  ArnNotLike  exception on a dedicated admin role, as in the region SCP, prevents a bad policy from leaving you with no way back in.
  • Test on one OU before going wide. Attach to a non-production OU first and confirm legitimate workflows still function, since a mistaken deny applies instantly to everything below the attachment point.

Clean Up

While nothing here costs money — SCPs, OUs, and the organization itself are free — the reason to clean up is correctness: a leftover deny SCP keeps silently blocking actions long after you've forgotten it exists.

Two things worth knowing about undoing the setup itself:

  • Disabling the SCP policy type is reversible but destructive to your work: disabling SCPs in the organization drops all SCP attachments, and re-enabling later means reattaching every policy by hand. ( AWS docs )
  • Deleting the organization removes the SCPs along with it, but only works once you've removed all member accounts so just the management account remains. ( AWS docs ) If you created a throwaway organization purely for this lab, that condition is already met and deletion is clean. If you enabled SCPs on an existing organization that has real accounts in it, leave the organization in place — just delete the lab's policies and OU below.

Detaching and deleting the policies is always safe:

# A policy must be detached from every target before it can be deleted
aws organizations detach-policy --policy-id "$SCP_ID" --target-id "$SANDBOX_OU_ID"
aws organizations detach-policy --policy-id "$GUARDRAIL_ID" --target-id "$SANDBOX_OU_ID"

aws organizations delete-policy --policy-id "$SCP_ID"
aws organizations delete-policy --policy-id "$GUARDRAIL_ID"

# The OU must be empty (no accounts, no child OUs) to delete it
aws organizations delete-organizational-unit --organizational-unit-id "$SANDBOX_OU_ID"

# Optional: reverse the one-time enablement from setup
aws organizations disable-policy-type \
--root-id "$ROOT_ID" \
--policy-type SERVICE_CONTROL_POLICY

Deleting the organization is intentionally left out of that block — it's irreversible and, run by habit, would tear down an existing organization you meant to keep. Only run it if you created a throwaway organization solely for this lab, in which case the management account is the only member and deletion is clean:

# ONLY for a throwaway lab org — this is irreversible
aws organizations delete-organization

Wrapping Up

SCPs are the one control an account admin cannot override: an organization-wide ceiling on permissions, evaluated as the intersection with IAM, enforced from above the account. You've seen the model (guardrails, not grants), the default  FullAWSAccess  and deny-list strategy, and two working examples — a region lock and a security-service protection set.

The highest-leverage next step is architectural: move every real workload out of the management account, since nothing you run there is protected by SCPs. From there, build a small baseline set of deny-list SCPs — region restriction, security-service protection, and a block on leaving the organization — attach them to a test OU, and promote them outward once you've confirmed nothing legitimate breaks.

Are you looking into manage IAM policies securely across your AWS Accounts using Organizations?  Let's talk! 
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article