Skip to content
Tutorials Center
My learning

Topics

Lesson 51 of 70 ยท Security

Multi-Account Strategy and Control Tower

Learn why AWS teams use many accounts: Organizations, OUs, SCPs, Control Tower landing zones, central logging and IAM Identity Center, with a runnable SCP calculator.

A small project can live in one AWS account. A real company cannot. Production, testing and experiments share the same billing, the same quotas and the same blast radius if one of them is breached. The standard answer on AWS is simple: use many accounts. An account is the strongest isolation boundary AWS offers, so one account per workload and environment keeps mistakes small.

Many accounts need management. You must create them quickly, apply the same security rules to all of them, collect their logs in one place and let people sign in without a pile of passwords. That is what AWS Organizations, Service Control Policies (SCPs), Control Tower and IAM Identity Center are for. This lesson explains how they fit together and builds on How Policy Evaluation Works.

Organizations and Control Tower need a real AWS account and cannot run on this site, so every console step and CLI command below is read-only. The runnable examples are Python stand-ins: an SCP effective-permissions calculator and an Identity Center assignment expander. They follow the same rules in simplified form, and each section says what is simplified.

Why separate accounts

Accounts give you things that no amount of IAM policy writing can match:

  • Security isolation. A leaked key from a sandbox account cannot touch production data. Cross-account access exists only if you build it on purpose.
  • Quota isolation. Service limits are per account (and Region), so a runaway test cannot starve production.
  • Billing clarity. Each account's costs are visible on their own, and cost allocation becomes much easier.
  • Different rules per environment. Developers may have broad rights in a sandbox and almost none in production.

The price is more things to manage. Without automation, ten accounts means ten places to configure logging, alerts and baseline security. Hence the tooling below.

AWS Organizations

AWS Organizations groups accounts into one tree and gives you central billing and policy control.

  • The management account creates the organization and pays the bill (consolidated billing). Keep almost nothing in it: it is the one account SCPs cannot restrict.
  • Member accounts are every other account. You can create new ones with an API call, or invite existing ones.
  • Organizational units (OUs) are folders for accounts. OUs can be nested several levels deep below the root, the top of the tree.
  • Policies attached to the root, an OU or an account apply to everything below. The best-known type is the SCP. Others include tag policies, backup policies and resource control policies (RCPs), which limit what can be done to resources in your accounts.
flowchart TD
    R["Root"] --> S["OU: Security"]
    R --> W["OU: Workloads"]
    R --> M["Management account"]
    S --> LA["log-archive"]
    S --> AU["audit"]
    W --> P["OU: Prod"]
    W --> SB["OU: Sandbox"]
    P --> P1["shop-prod"]
    SB --> S1["dev-playground"]

A typical organization tree: shared security accounts, then workloads split by environment.

Creating a member account from the command line looks like this (read-only here):

Terminal
aws organizations create-account \
  --email [email protected] \
  --account-name shop-prod

aws organizations move-account \
  --account-id 111122223333 \
  --source-parent-id r-ab12 \
  --destination-parent-id ou-ab12-prod0001

A new member account gets an administrative role (named OrganizationAccountAccessRole by default) that the management account can assume, so you never need the new account's root password for daily work. Each account still has its own root user: secure it as described in Creating and Securing an Account.

Service control policies

An SCP is a guardrail policy. It sets the maximum permissions available in the accounts below the place where it is attached. Three facts matter most:

  1. SCPs never grant anything. An action must be allowed by the SCPs and by an IAM identity or resource policy. Think of an SCP as the fence and IAM as the path inside it.
  2. They apply to every principal in a member account, including its root user. They do not apply to the management account, and they do not affect service-linked roles.
  3. Each level must allow the action. An action works in an account only if every SCP level on the path from the root to the account permits it (root, each OU, and the account). An explicit deny at any level wins.

Organizations attaches an SCP called FullAWSAccess (allow everything) to every level by default. That is why a fresh organization seems to have no restrictions. There are two common strategies:

  • Deny list: keep FullAWSAccess and add SCPs that deny dangerous things, such as leaving the organization, turning off CloudTrail or using unapproved Regions. This is simple and the usual choice.
  • Allow list: remove FullAWSAccess from a level and attach an SCP that allows only approved services. This is stricter and needs more upkeep.

A deny SCP that stops anyone in the affected accounts from switching off auditing (read-only):

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ProtectAuditTrail",
      "Effect": "Deny",
      "Action": [
        "cloudtrail:StopLogging",
        "cloudtrail:DeleteTrail",
        "config:StopConfigurationRecorder"
      ],
      "Resource": "*"
    }
  ]
}

A Region guardrail uses a condition on the Region the request goes to. Real ones use NotAction to exempt global services such as IAM, because those calls are served from a single Region:

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "EuRegionsOnly",
      "Effect": "Deny",
      "NotAction": ["iam:*", "organizations:*", "route53:*", "support:*"],
      "Resource": "*",
      "Condition": {
        "StringNotEquals": {
          "aws:RequestedRegion": ["eu-west-1", "eu-central-1"]
        }
      }
    }
  ]
}

An SCP effective-permissions calculator

This stand-in builds the tree from the diagram and answers: "can a principal in this account perform this action?" It checks every level for an explicit deny first, then requires an allow at every level. To keep it short it models Action wildcards and one simple Region condition (DenyOutsideRegions), and it treats a request with no Region as a global call. It does not model NotAction, resource ARNs or other condition keys, and it stops at SCPs: a real call also needs an IAM allow.

Python SCP effective permissions along the tree

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Read the output from the top. The first shop-prod call is allowed at every level. The second is denied by the Region guardrail on Workloads, even though Prod itself says "allow everything". The CloudTrail call is stopped by the deny on Prod. iam:CreateRole has no Region, so it passes as a global call. In the Sandbox OU there is no FullAWSAccess, so only the allow list counts: rds:CreateDBInstance fails with "no allow at Sandbox". The audit account sits in the Security OU, which has no Region rule, so launching an instance in us-east-1 is allowed there, but leaving the organization is denied by the root SCP.

Notice that attaching a deny at the root protects every account at once. That is the main reason SCPs exist.

Landing zones and Control Tower

Creating accounts and applying the right baseline by hand is slow and error-prone. A landing zone is a pre-built, secure multi-account environment: an organization structure, shared accounts, baseline guardrails, logging and a way to create new accounts.

AWS Control Tower builds and maintains a landing zone for you. It sets up:

  • An organization with OUs, typically a Security OU holding two shared accounts, and OUs you add for workloads.
  • A log archive account that receives CloudTrail and AWS Config logs from every enrolled account, in a bucket that workload accounts cannot alter.
  • An audit account where security and compliance teams get read access across accounts.
  • Controls (formerly called guardrails) applied to OUs. Preventive controls are implemented as SCPs. Detective controls are AWS Config rules that report non-compliant resources. Proactive controls check CloudFormation templates before resources are created. Each is mandatory, strongly recommended or elective.
  • Account Factory, a standard way to create new accounts that arrive already enrolled with the baseline. A Terraform-based variant exists for teams that provision infrastructure with Terraform.
  • A home Region, chosen when you set up the landing zone. Choose it deliberately, because moving it later is a large operation.

If you cannot or do not want to use Control Tower, you can build the same structure yourself with Organizations plus CloudFormation StackSets. Control Tower is the faster start and fits most organizations.

flowchart LR
    A1["shop-prod"] -- "CloudTrail and Config logs" --> L["log-archive<br/>S3 bucket (write-only for others)"]
    A2["dev-playground"] -- "CloudTrail and Config logs" --> L
    A3["audit"] -- "read-only access" --> L
    L -.-> SEC["Security team"]

Centralized logging: every account ships logs to one protected place that the workload accounts cannot edit.

Central logging matters because an attacker who gets into an account will try to cover tracks by deleting logs. If the logs live in another account that the attacked account cannot write to except by appending, the evidence survives. This is the idea behind an organization trail in CloudTrail. See CloudTrail, Config and X-Ray for how the events look.

IAM Identity Center for people

With dozens of accounts you do not want a separate IAM user for every person in every account. IAM Identity Center (the successor to AWS Single Sign-On) is the recommended way to give people access:

  • People sign in once to a portal with a corporate identity provider or Identity Center's own directory, using MFA.
  • You define permission sets (named bundles of permissions, such as ReadOnly or PowerUser).
  • You create assignments: "this group gets this permission set in these accounts". Identity Center then creates a matching role in each target account.
  • People receive short-lived credentials for the role they pick, in the console or with aws sso login on the CLI (see Console, CLI and SDKs).

Assignments are made to groups and OUs of accounts, not to individuals one by one, so adding a new account to an OU can grant the right teams access immediately.

An assignment expander

This stand-in turns assignments such as "platform-admins get AdministratorAccess in every Workloads account" into the per-account roles Identity Center would create, and flags accounts nobody can reach. Real Identity Center assigns to accounts (and organization roots or OUs through automation); the expansion by OU path here is a teaching shortcut.

Python Expand Identity Center assignments into account roles

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

new-analytics was just added to the Sandbox OU, and the assignments reached it automatically: platform admins and developers got roles there with no extra work. That is the reason to assign by OU and group rather than by hand. The developers group has read-only access to production and no access to the Security accounts, which is exactly the separation you wanted from using many accounts in the first place.

Putting it together

A sensible starting plan for a growing company:

  1. Create the organization and keep the management account nearly empty.
  2. Set up Control Tower, or equivalent automation, so log-archive and audit exist from day one.
  3. Create OUs for Security, Prod and Non-prod (Sandbox, Dev). Attach deny-list SCPs at the root (no leaving the organization, no disabling logging) and Region limits where compliance needs them.
  4. Create accounts through the factory, not by hand.
  5. Use IAM Identity Center for all human access. Keep IAM users for almost nothing.

Test every SCP in a non-production OU first. A wrong deny at the root can block your own operations, and only the management account (which SCPs do not touch) can fix it.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does a service control policy (SCP) do?

    SCPs are guardrails. They never grant access by themselves, so an action needs both an SCP that permits it and an IAM policy that grants it.
  2. 2. An action is allowed by the SCP on the account, but the OU above the account has an allow-list SCP that does not include it. What is the result?

    An action must be permitted at the root, at every OU on the path and at the account itself. Missing an allow at any level is an implicit deny.
  3. 3. Which account is not restricted by SCPs?

    SCPs affect member accounts only. That is why the management account should hold almost no workloads.
  4. 4. What is the main benefit of a centralized log archive account?

    When logs are shipped to a separate account that workload accounts cannot modify, deleting local resources cannot erase the audit trail.
  5. 5. Why assign IAM Identity Center permission sets to groups and OUs instead of individual users in individual accounts?

    Group and OU based assignments scale. Adding a person to a group or an account to an OU grants the correct access without editing many individual assignments.

Summary

  • Use many accounts for isolation of security, quotas and billing; AWS Organizations groups them into OUs under one root with consolidated billing.
  • SCPs are guardrails: they never grant access, they apply to member accounts (including their root users) but not to the management account, and every level on the path must permit an action.
  • A deny list (keep FullAWSAccess, add denies) is the simple default; an allow list is stricter and needs more upkeep.
  • Control Tower builds a landing zone with a log archive account, an audit account, preventive, detective and proactive controls, and Account Factory.
  • Ship CloudTrail and Config logs to a protected account, and give people access through IAM Identity Center permission sets assigned to groups and OUs.

Next: CloudFormation