latest run 54 pass 0 fail 0 skipevidence →
HKB Operations: pages
HKB OperationsKnowledge space

Starred pages

Pages

Page directory · Labels · [ hides this

ADR-0023 accepted

Fit HKB's guardrails into AWS's five-policy limit

  • Status: Accepted
  • Date: 2026-10-03
  • Plain-language rewrite 2026-10-27 (DQ-245).

Context

HKB's guardrails are service control policies: rules attached to the organization that no one in a member account can override. AWS allows at most five of these on any one level of the organization, and AWS's own "allow everything" baseline takes one of the five. The plan named six custom guardrails for the top level alone, and an older hand-made one was also still attached there. They didn't fit.

Two of the rules also had to apply everywhere except the Workloads and Sandbox areas, and the plan hadn't said how.

Decision

  • Keep each guardrail's ID as the inventory, but package them into three combined policies at the top level. Each rule inside a policy is labelled with its ID, so it can be traced back. Guardrails that attach lower down stay separate.
  • Express "everywhere except Workloads and Sandbox" inside the rule itself, by checking where the caller sits in the organization, rather than attaching it area by area.
  • Delete the old hand-made policy, since one of the new guardrails covers what it did.
  • Exempt Control Tower's and the deployment service's own roles from the deny rules, so they can still do their jobs.
  • Don't deny the bucket-level public-access setting, because CloudFormation uses the same permission to create every bucket safely. Block it account-wide instead, which overrides every bucket, and check bucket templates before they deploy.

Consequences

  • The top level keeps one free slot.
  • The exemptions go by role name, so anyone who can create a role with one of those names could slip past the rules. Role creation is what to watch, and alerts cover it.
  • Tracing a rule back to its ID depends on the labelling convention.
  • Control Tower's own controls also use slots on each area. If one fills up, the Sandbox cost guardrail will be the first affected.

Alternatives considered

  • One policy per guardrail, attached area by area. More files to review, and the limit is reached sooner.
  • One giant policy. AWS's size limit would be reached quickly, and every edit would be high-risk.
LLMs look here
  • Limit: five directly attached SCPs per root, OU or account, FullAWSAccess included. The Living Plan lists SCP-01, 03, 04, 05, 06, 07 for the root (six). The manual DenyLeaveAndCloseAccount overlapped SCP-01.
  • Root policies: hkb-scp-core-protection (SCP-01, 04, 05), hkb-scp-baseline-protection (SCP-03), hkb-scp-ai-and-cost-guardrails (SCP-06, 07). Each statement's Sid carries its ID. SCP-08, 09 and 10 attach elsewhere.
  • "Outside Workloads and Sandbox" (SCP-06, SCP-07): ForAllValues:StringNotLike on aws:PrincipalOrgPaths, paths built from stack parameters (no IDs in the repo); nothing attached per OU.
  • SCP-01 includes account:CloseAccount; DenyLeaveAndCloseAccount is detached and deleted by hand once SCP-01 is attached.
  • Every Deny except SCP-08 and SCP-09 exempts AWSControlTowerExecution, aws-controltower-* (with and without /service-role/) and stacksets-exec-*. Role creation alerts at 5.1.
  • SCP-05 denies only the account-level S3 Block Public Access change. Bucket-level PutBucketPublicAccessBlock is the API CloudFormation calls to create a bucket with BPA on, and the delete shares that permission. Guard rules check bucket templates.
  • SCP-06 approves Anthropic models only for now (exact models chosen in the Chatbot phase). SCP-07's Workloads instance allowlist (t4g.nano/micro/small/medium, t3.micro/small) is a parameter.
  • RCP-01 covers sts:AssumeRole, SetSourceIdentity and TagSession, not web identity or SAML federation (no aws:PrincipalOrgID). The public auditor path is designed in its own phase.
  • TAG-01 reports and does not enforce (enforced_for unset), so it can't block Control Tower or CloudFormation tagging.
  • If an OU hits the limit (Region deny control and Control Tower mandatory controls use slots), SCP-10 on Sandbox feels it first. A single policy hits the 5,120-character limit.

Page information

Owner
Platform Engineering
Status
accepted From the decision record.
Generated from
docs/adr/0023-consolidated-scps-and-org-path-gating.md
Linked from
Decisions