Sub topic 11
Applying controls to OUs
This chapter assumes you have launched a landing zone, you know what an organizational unit (OU) is, and you can read a basic IAM or service control policy. It covers what controls are, how the three behaviors differ, how to enable them on an OU, and the errors people hit most often.
What a control is
A control (older documentation calls it a guardrail) is a rule that Control Tower applies to an OU. Every account in that OU inherits the rule. Each control has three properties you should check before you enable it:
- Behavior: preventive, detective, or proactive. This sets how the rule is enforced.
- Guidance: mandatory, strongly recommended, or elective. This tells you how much AWS expects you to use it.
- Scope: the OU, and through it every enrolled account, that the control applies to.
Controls attach to OUs, not to individual accounts. This is why OU design matters. If two accounts need different rules, they belong in different OUs.
The three behaviors
| Behavior | Enforced with | When it acts | Result on violation |
|---|---|---|---|
| Preventive | Service control policies (SCPs) in AWS Organizations | At API call time | The call is denied |
| Detective | AWS Config rules | After a resource exists or changes | The resource is marked non-compliant |
| Proactive | AWS CloudFormation Hooks | Before CloudFormation creates a resource | The stack operation fails |
Preventive controls
A preventive control is an SCP. SCPs set the maximum permissions available in an account. They never grant access. A preventive control denies a specific action, such as disabling CloudTrail or leaving a chosen set of Regions. Because SCPs apply to every principal in the member accounts, including the account's root user, they are the strongest form of control. They do not apply to the management account.
Preventive controls report one of two states per OU: enforced or not enabled.
Detective controls
A detective control is an AWS Config rule that evaluates resources. It does not block anything. For example, a detective control can flag an EBS volume that is not encrypted. The result appears as clear or in violation in the Control Tower console, and the Config findings aggregate in the Audit account.
Detective controls need AWS Config to be recording in the member accounts. Control Tower sets this up in governed Regions. A resource created in a Region that is not governed is not evaluated.
Proactive controls
A proactive control is a CloudFormation Hook. It inspects the resources in a template before CloudFormation provisions them and fails the deployment if the template breaks the rule. Proactive controls only see resources deployed through CloudFormation. A resource created directly through the console or an API call bypasses them. Pair them with detective controls to catch what they miss.
Guidance levels
| Guidance | Meaning | Typical use |
|---|---|---|
| Mandatory | Always enforced on every enrolled OU. You cannot turn these off. | Protect Control Tower's own resources, such as the log archive and the CloudTrail configuration. |
| Strongly recommended | Not on by default. AWS advises enabling them. | Common security practices, such as blocking public access to resources. |
| Elective | Optional. Enable them if your policy requires them. | Narrower rules, such as restricting specific instance types. |
Mandatory controls are applied automatically when you register an OU. You enable the other two kinds yourself.
Region deny and other landing-zone settings
Region deny is a landing zone setting rather than a control you pick from the library. It uses an SCP to deny access to AWS services in Regions you did not choose to govern. Be aware of two points:
- It applies to the whole landing zone, and you can add exceptions for specific global services or principals.
- Changing the governed Regions means updating the landing zone, so plan this before you enroll many accounts.
Finding and enabling controls
Browse the control library in the console under Controls. You can filter by behavior, guidance, and service. Every control has an ARN, which the API uses to identify it.
You need two ARNs to enable a control: the control's ARN and the target OU's ARN. First, find the OU. The list-roots call returns the root ID. The list-organizational-units-for-parent call returns the OUs below it.
aws organizations list-roots
aws organizations list-organizational-units-for-parent \
--parent-id <root-id>The OU ARN has the form arn:aws:organizations::<management-account-id>:ou/<organization-id>/<ou-id>. The Organizations output gives you the OU ID and ARN. Then enable the control and confirm it:
aws controltower enable-control \
--control-identifier <control-arn> \
--target-identifier <ou-arn> \
--region us-east-1
aws controltower list-enabled-controls \
--target-identifier <ou-arn> \
--region us-east-1Run the calls in the home Region. enable-control is asynchronous. It returns an operation identifier, and the control is not active until the operation finishes. Check progress with get-control-operation:
aws controltower get-control-operation \
--operation-identifier <operation-id> \
--region us-east-1Wait for the status to be SUCCEEDED. A status of FAILED includes a message that names the cause.
Inheritance through nested OUs
A control enabled on a parent OU applies to every child OU and every account beneath it. A control enabled on a child applies only to that child's subtree. Two rules follow:
- You cannot weaken a control from below. If a parent enforces a deny, a child OU cannot lift it.
- Enable broad rules high in the tree, and put exceptions in a separate OU that sits outside the broad rule's scope.
The same SCP logic applies when SCPs from outside Control Tower are also attached. An action is allowed only if every level from the root to the account allows it. If you are unsure why a call is denied, review all SCPs along the path, not only the Control Tower ones.
A worked example
Suppose you have a Workloads OU with Prod and Dev children, and a security requirement that S3 buckets must not be publicly readable.
- Enable a detective control for public read access on
Workloads. Both children inherit it. Existing buckets are evaluated and any violators appear in the console. - Enable the matching proactive control on
Workloads. New CloudFormation stacks that would create a public bucket now fail before deployment. - Enable a preventive control on
Prodonly, to deny changes that would open the account-level block on public access.Devstays more permissive.
The result uses all three behaviors at the points where each is strongest. The preventive control is limited to Prod because blocking in Dev would slow experimentation.
Common errors and gotchas
- The control seems enabled but does nothing. For detective controls, check that the Region is governed and that AWS Config is recording. For proactive controls, confirm the resource was deployed through CloudFormation.
enable-controlfails with a conflict. Control Tower runs one landing zone or control operation against an OU at a time in many cases. Wait for the earlier operation to finish and retry.- Wrong identifier type. The
--target-identifiertakes an OU ARN, not an OU ID, and not an account ID. - Wrong Region for the call. Control APIs are served from the home Region. A call to another Region fails or returns nothing.
- Unexpected denials after enabling a preventive control. SCPs can break automation. A pipeline that calls a now-denied action gets
AccessDeniedwith an explicit deny from an SCP. Test new preventive controls on a sandbox OU first. - Drift. If someone edits or detaches a Control Tower-managed SCP or Config rule directly in Organizations or Config, the control shows drift. Repair it from Control Tower and not by hand. Chapter 13 covers drift in detail.
- Controls on the management account. SCPs do not restrict it. Keep workloads out of the management account.
Disabling a control
Use disable-control with the same two identifiers to remove an elective or strongly recommended control from an OU. This removes the SCP, Config rule, or hook from the accounts in that OU. Mandatory controls cannot be disabled.
aws controltower disable-control \
--control-identifier <control-arn> \
--target-identifier <ou-arn> \
--region us-east-1Exercise
A team deploys an S3 bucket by clicking through the console in an account under an OU that has a proactive control against public buckets. The bucket is public. Why did the proactive control not stop it, and which behavior would you add to catch this case?
Show answer
Proactive controls are CloudFormation Hooks, so they inspect only resources deployed through CloudFormation. The console deployment bypassed the hook. A detective control (an AWS Config rule) would flag the public bucket after creation, and a preventive control (an SCP) would block the action that makes it public.
Exercise
You enable a preventive control on a parent OU. A child OU needs an exception. Can you disable the control on the child only, and what would you do instead?
Show answer
No. A control on a parent applies to all children, and a child cannot lift it. Move the accounts that need the exception into an OU outside the parent's scope, and apply the control to the other OUs individually.