Skip to content

Refuse the org root in IAM; tidy dependabot, lock file, config - #22

Merged
DustyStudy merged 1 commit into
mainfrom
feat/harden-and-tidy
Sep 21, 2026
Merged

DustyStudy merged 1 commit into
mainfrom
feat/harden-and-tidy

Conversation

@DustyStudy

Copy link
Copy Markdown
Owner

What

1. IAM refuses the organization root by default. orgseed-ci could attach or detach an SCP at the org root - a guardrail there hits every member account at once and only the management account can undo it. The baseline stack already refused a root target, but that was Terraform code. The root ARN is now in the role's AttachPolicy/DetachPolicy resources only when the new bootstrap parameter AllowAttachToRoot is true (default false).

  • Two new prove.yml probes ask, as orgseed-ci, to attach and detach an SCP at a root-shaped target. The policy ID is nonexistent but matches the allowed policy pattern, so the root is the only possible cause of a denial, and a wrongly-allowed call fails harmlessly with PolicyNotFound. The safety test now allows attach_policy/detach_policy only against a nonexistent policy.
  • SECURITY.md records a limit I could not remove: AWS does not support tag conditions on UpdatePolicy/DeletePolicy/AttachPolicy/DetachPolicy (checked in the Service Authorization Reference), so orgseed-ci can still edit any customer-managed SCP. Compensating controls are listed.

2. Tidy

  • Dependabot now covers modules/* and stacks/* (it pointed at /modules, which holds no .tf files, so it never ran for Terraform). A test keeps it that way.
  • stacks/baseline/.terraform.lock.hcl is committed (linux/windows/mac) so plan and apply use the same provider build. A test requires it.
  • github_repo is optional; nothing read it.
  • Removed the unused modules/ci-role scaffold and its README mentions.

Verification

  • 160 tests pass (new: root-guard structure, opt-in parameter, probe safety/shape, Dependabot coverage, lock file, optional key). ruff/bandit on cli/, cfn-lint, Checkov (35/0) clean; terraform test 13/13 and 4/4.
  • Not run locally: actionlint and gitleaks are not installed here; CI runs them.

Not verified yet

The change only takes effect once the seed workflow updates the orgseed-roles-sandbox stack, and the two new probes have never run against real AWS. After merging: run seed (approve), then prove (approve) - it should show 19 verdicts, with the root probes denied. If a probe reads as authorized or errors, that is a real finding.

…ock, optional github_repo

orgseed-ci's AttachPolicy/DetachPolicy resources no longer include the organization
root unless AllowAttachToRoot=true (default false), so the 'never the root' guard
is enforced by IAM and not only by Terraform code. prove.yml gains two real-call
probes for it. SECURITY.md records that tag-scoping SCP actions is not possible in
AWS and what compensates.

Also: Dependabot watches modules/* and stacks/*; the root stack's provider lock file
is committed; github_repo is no longer required; the unused modules/ci-role scaffold
is removed.
@DustyStudy
DustyStudy merged commit f7aff66 into main Sep 21, 2026
5 checks passed
@DustyStudy
DustyStudy deleted the feat/harden-and-tidy branch September 21, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant