Skip to content

feat(e5c8): member swap, workload stacks stop owning GuardDuty, Security Hub and Inspector - #527

Merged
hemzaz merged 2 commits into
masterfrom
feat/e5c8-member-swap
Nov 16, 2026
Merged

hemzaz merged 2 commits into
masterfrom
feat/e5c8-member-swap

Conversation

@hemzaz

@hemzaz hemzaz commented Nov 16, 2026

Copy link
Copy Markdown
Owner

E5c8 of the E5c plan. Every workload stack drops guardduty/main, securityhub/main
and inspector2/main: the region's security stack's Cloud Posse delegated
administrator and org-settings (E5c4-E5c6) enroll each account as a member.

  • security-monitoring reads no service state: guardduty_detector_id,
    securityhub_account_arn and inspector2_account_id become the plain bool flags
    enable_guardduty_route, enable_securityhub_route and enable_inspector2_route
    (owner OQ-AL), default on. require_* still fails a plan that turns a route off,
    so turning one off takes both flags. Outputs, README and the mocked tftests follow.
  • Stacks, catalog (defaults, main-region, main-standby) and the nonprod,
    prod-primary and standby scaffold templates lose the three imports and their
    dependencies; goldens regenerate identically.
  • check-data-residency: a route left on in an account the region's org-settings
    does not enroll fails (tests added).
  • harden.sh: deploys cloudtrail, aws-config and, in a security stack, step 1
    (delegated-administrator) only. Step 3 (org-settings) reads step 1's detector
    and needs the root stack's step 2, so planning it beside step 1 failed a fresh
    security stack before anything applied; harden now names
    deploy-security-org -f deploy-full-stack -s <stack> for it instead. The status
    report names each service's administrator account. test_harden covers both.
  • plan_sweep_varfile drops the retired detector/hub synthetics; deploy-full-stack,
    compliance-check, security-hardening, OPERATIONS, README and the guardduty,
    securityhub and inspector2 READMEs updated. The orphaned
    stacks/catalog/{guardduty,securityhub,inspector2} files go in E5c9.

Nothing is applied, so no state moves and no destroys.

Test plan

  • python3 -m unittest test_check_data_residency test_harden (107 OK)
  • bash scripts/check-stack-scaffold.sh (IDENTICAL, 15 goldens; 7 fresh stacks pass)
  • atmos workflow lint -f lint
  • atmos workflow validate-all -f validate-enhanced
  • CI green, then promote from draft

…ity Hub and Inspector

E5c8 of the E5c plan. Every workload stack drops guardduty/main, securityhub/main
and inspector2/main: the region's security stack's Cloud Posse delegated
administrator and org-settings (E5c4-E5c6) enroll each account as a member.

- security-monitoring reads no service state: guardduty_detector_id,
  securityhub_account_arn and inspector2_account_id become the plain bool flags
  enable_guardduty_route, enable_securityhub_route and enable_inspector2_route
  (owner OQ-AL), default on. require_* still fails a plan that turns a route off,
  so turning one off takes both flags. Outputs, README and the mocked tftests follow.
- Stacks, catalog (defaults, main-region, main-standby) and the nonprod,
  prod-primary and standby scaffold templates lose the three imports and their
  dependencies; goldens regenerate identically.
- check-data-residency: a route left on in an account the region's org-settings
  does not enroll fails (tests added).
- harden.sh: deploys cloudtrail, aws-config and, in a security stack, step 1
  (delegated-administrator) only. Step 3 (org-settings) reads step 1's detector
  and needs the root stack's step 2, so planning it beside step 1 failed a fresh
  security stack before anything applied; harden now names
  `deploy-security-org -f deploy-full-stack -s <stack>` for it instead. The status
  report names each service's administrator account. test_harden covers both.
- plan_sweep_varfile drops the retired detector/hub synthetics; deploy-full-stack,
  compliance-check, security-hardening, OPERATIONS, README and the guardduty,
  securityhub and inspector2 READMEs updated. The orphaned
  stacks/catalog/{guardduty,securityhub,inspector2} files go in E5c9.

Nothing is applied, so no state moves and no destroys.
…ot-stack test

- security-hardening confirm prompt names what harden now plans
- harden: one skip line for both delegated administrators; 'no enabled
  instance' wording (metadata.enabled false is filtered); get-administrator-account
  None reads as 'none (delegated administrator, or not a member)'
- test_harden: root stack plans cloudtrail + aws-config only; disabled
  aws-config fails naming it; single combined skip line
- check-data-residency: an unresolved account gets its own message
- deploy-full-stack security-org comment; OPERATIONS line 13 period
@hemzaz
hemzaz marked this pull request as ready for review November 16, 2026 20:08
@hemzaz
hemzaz merged commit 104dc54 into master Nov 16, 2026
23 checks passed
hemzaz added a commit that referenced this pull request Nov 16, 2026
…ctor2 (#528)

chore(e5c9): delete the hand-written guardduty, securityhub and inspector2

E5c9 of the E5c plan. Since E5c8 (#527) no stack has an instance of the
hand-written components: the vendored Cloud Posse aws-guardduty,
aws-security-hub and aws-inspector2 (delegated administrator + org-settings)
own the services. Deletion PR, size-exempt per the plan.

- Deleted components/terraform/{guardduty,securityhub,inspector2} (tests and
  the inline CKV2_AWS_3 skip included) and stacks/catalog/{guardduty,securityhub,inspector2}.
- CODEOWNERS: the three catalog entries name the vendored catalogs.
- deploy-full-stack: the old names leave the security layer's plan and deploy
  queries (both copies).
- check-first-deploy-inputs: the old names leave MAP_CONSUMERS; tests use
  aws-guardduty.
- plan_sweep_hcl: account_ids (only the deleted aws_inspector2_enabler) leaves
  LIST_SCALAR_ATTRS.
- README 60 root modules (44 hand-written); CLAUDE.md 38 of the 44 validate
  tags.Environment; aws-security-hub catalog comments no longer point at
  deleted files.

Resolved stacks are byte-identical (stack-snapshot IDENTICAL, 28 stacks).
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