Sub topic 2
AWS Organizations, OUs and SCPs in brief
This chapter covers the AWS Organizations building blocks that Control Tower relies on. It assumes you know basic IAM (users, roles, policies), can use the console and AWS CLI, and understand why teams split workloads across several AWS accounts.
The working model
AWS Organizations lets you manage many AWS accounts as one unit. It has four pieces you will meet in every Control Tower setup:
- Management account: the account that creates the organization. It pays the bills and can create accounts and attach policies. Policies do not restrict it.
- Member accounts: every other account in the organization.
- Root: the top container of the hierarchy. It is not the same as an account's root user.
- Organizational units (OUs): containers for accounts. OUs can nest, up to five levels below the root.
Policies attach to the root, to an OU, or to a single account. Accounts inherit the policies of every container above them.
In this layout, app-prod and app-dev both inherit the SCP, because both sit under the Workloads OU.
Service control policies
A service control policy (SCP) sets the maximum permissions that accounts in an OU can have. An SCP never grants access. It only limits what IAM policies in the member accounts can allow.
The effective permission for a request is the overlap of two things: what the SCPs allow at every level, and what the IAM identity or resource policy allows. If either side does not allow an action, the request fails.
Key behaviors to remember:
- SCPs affect IAM users and roles in member accounts, including the account's root user.
- SCPs do not affect the management account.
- SCPs do not affect service-linked roles.
- Each level from the root down to the account must allow an action. An allow at the root does not help if the OU blocks it.
- AWS attaches a default
FullAWSAccesspolicy to each new root, OU and account. If you remove it without adding another allow, everything is denied.
An example SCP
This SCP denies actions outside two Regions. It uses a NotAction list so that global services still work.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideApprovedRegions",
"Effect": "Deny",
"NotAction": [
"iam:*",
"organizations:*",
"sts:*",
"support:*",
"cloudfront:*",
"route53:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:RequestedRegion": ["us-east-1", "eu-west-1"]
}
}
}
]
}A deny-list style like this, where FullAWSAccess stays attached and you add targeted denies, is easier to maintain than an allow-list.
Inspecting your organization from the CLI
Run these from the management account. They find the root and the OUs you will target later.
aws organizations describe-organization
aws organizations list-roots
aws organizations list-organizational-units-for-parent \
--parent-id <root-id>
aws organizations list-policies --filter SERVICE_CONTROL_POLICYWhy this matters for Control Tower
Control Tower does not replace Organizations. It creates and manages an organization structure for you, and some of its controls are implemented as SCPs that it attaches to OUs. Because SCP inheritance flows downward, where you place an account decides which guardrails apply to it. The next chapters build on that when you design OUs.
Common errors
- Testing as the management account. SCPs do not apply there, so a policy can look harmless in testing and block member accounts.
- Removing
FullAWSAccessby mistake. This causes a blanket deny. - Expecting an SCP to grant access. The IAM policy in the member account must still allow the action.
- Editing Control Tower-managed SCPs directly. Control Tower reports this as drift. Use Control Tower to change them.
Exercise
An SCP on the Workloads OU allows only s3:* and ec2:*. An IAM role in an account under that OU has the AdministratorAccess policy. Can the role create a DynamoDB table?
Show answer
No. The SCP sets the maximum permissions, and it does not allow DynamoDB actions. The role's IAM policy allows them, but a request needs both the SCP and the IAM policy to allow it.
Exercise
Why can a new SCP appear to work in testing and still block users in member accounts?
Show answer
SCPs do not apply to the management account. If you tested there, the policy had no effect, so its blocking behavior only shows up in member accounts.