Stop 04 · IAM & Account SecurityTopics · 9/9

AWS Organizations & Service Control Policies

Part of the AWS Roadmap

In short

Serious teams don't use one AWS account. They use many: dev, test, prod, security, sandbox. AWS Organizations ties them together for billing and guardrails, and SCPs make sure no account can break the company's rules.

AWS Organizations groups multiple accounts under one management account. Service control policies set the maximum permissions available to accounts in the organisation; they do not grant permissions themselves and do not restrict the management account.

The jaadu, as school principal, pins a big rulebook poster on a corridor wall above a row of separate classroom doors.

Think of it like this

A school with house rules

Each class teacher decides what students in that class may do. But the school rulebook sets limits nobody can break, like 'no one leaves campus during exams'. A teacher cannot give permission for something the rulebook forbids. SCPs are the school rulebook; IAM policies are the class rules.

Watch it happen

An organisation for a small company

Root (management account)
OU: Security
OU: Workloads
OU: Sandbox
Log archive account
Dev account
Prod account
Learning sandbox

1/5The management account creates the organisation, pays the consolidated bill and should run almost no workloads.

The big ideas

What you need to know

Consolidated billing

One bill for all accounts, with volume discounts and Savings Plans shared across them.

SCPs set the ceiling

An SCP never grants access. It limits the maximum permissions of every IAM user and role in the affected accounts, including member account root users.

Management account is exempt

SCPs don't apply to the management account, which is why you keep workloads out of it.

Account per environment

Separate accounts give a hard boundary for blast radius, permissions and billing.

See it in code

Walk through the code

json
1{2  "Version": "2012-10-17",3  "Statement": [4    {5      "Sid": "StayInTheOrg",6      "Effect": "Deny",7      "Action": "organizations:LeaveOrganization",8      "Resource": "*"9    },10    {11      "Sid": "ProtectAuditTrail",12      "Effect": "Deny",13      "Action": ["cloudtrail:StopLogging", "cloudtrail:DeleteTrail"],14      "Resource": "*"15    }16  ]17}

1/2No one in the member accounts, not even an admin, can remove the account from the organisation.

A guardrail SCP. Create it with aws organizations create-policy --type SERVICE_CONTROL_POLICY --name baseline-guardrails --content file://scp.json, then attach-policy to an OU.

Save yourself the pain

Common mistakes

Oops

Expecting an SCP with Allow s3:* to give developers S3 access.

Do this instead

SCPs only filter. Developers still need an IAM or Identity Center policy that allows S3.

Oops

Running production apps in the management account.

Do this instead

Keep the management account for billing and organisation tasks. SCPs cannot protect it.

Oops

Attaching a brand-new deny SCP straight to the root of the organisation.

Do this instead

Test it on a sandbox OU first. A badly written SCP can lock every account out of needed actions.

Your mission

Build a mini organisation

~40 min

Quick check

A developer has AdministratorAccess in a member account, and an SCP on that account denies ec2:RunInstances. Can they launch an instance?

Go deeper

  1. 1Read the AWS documentation on how SCPs combine with IAM policies.
  2. 2Write an example SCP that denies actions outside the Mumbai and Hyderabad Regions.
  3. 3Learn why companies use separate accounts for dev, staging and production.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge