Skip to content

fix(detection): global-service rules 2/3/4 as CIS metric-filter alarms (ADR-0014) - #61

Merged
arnoldcastro5000 merged 1 commit into
mainfrom
feat/007-cis-metric-filter-detections
Jul 7, 2026
Merged

arnoldcastro5000 merged 1 commit into
mainfrom
feat/007-cis-metric-filter-detections

Conversation

@loonvault-agent

Copy link
Copy Markdown
Contributor

Closes issue 007 (local tracker): detection rules 2/3/4 (console sign-in without MFA, root usage, IAM policy changes) were EventBridge rules on the ca-central-1 bus, but AWS delivers global-service events only to us-east-1 — so as deployed they could never fire. Verified against AWS docs (EventBridge troubleshooting, "rule matches global service API calls but didn't run").

Why not the AWS-documented fix (us-east-1 rules): the region-lock SCP (ADR-0009, live as of today) denies creating EventBridge rules outside ca-central-1 for workloads-account principals. Our own guardrail forbids option A. Full analysis in ADR-0014.

Chosen fix (option B): CloudWatch Logs metric-filter alarms in ca-central-1 on the member trail's log group — the multi-region trail already lands global-service events there. This is the CIS-canonical implementation: filter patterns are CIS 4.2/4.3/4.4 verbatim, matching what Security Hub CloudWatch.1/.3/.4 check for (they fail if terms are added, so the patterns must not be "improved").

Changes:

  • rules 2/3/4: EventBridge rules/targets → metric filters + alarms (≥1 event in 5 min → SNS), same rule numbering
  • rule 2 documented as expected-but-logged for IAM Identity Center sign-ins (federated ConsoleLogin records MFAUsed: No; MFA lives at the IdP) — runbook "Expected alerts" updated
  • rule 3 gains CIS invokedBy/AwsServiceEvent exclusions (drops AWS-service-initiated root noise)
  • rule 4 now covers the full 16-event CIS list (old pattern missed DeletePolicy/DeletePolicyVersion)
  • rule 9 extended: the new transport has its own suppression surface, so it now also watches DeleteMetricFilter/DeleteAlarms/DisableAlarmActions
  • ADR-0014 (new), plan.md (§Detection Pipeline rewrite + Honest Residual Risk chore(deps): bump psycopg2-binary from 2.9.10 to 2.9.12 in /lambdas/transform #9: ~5–10 min latency on rules 2/3/4), threat-model §5.10/T-038/T-049, runbook

terraform validate, fmt, and verify-docs pass locally. Live-fire acceptance (IAM change and no-MFA sign-in produce SNS alerts) folds into issue 010.

🤖 Generated with Claude Code

…ts never reach ca-central-1 EventBridge (ADR-0014)

Closes issue 007. EventBridge only delivers global-service events (IAM,
console sign-in, root) to the us-east-1 bus, so rules 2/3/4 as deployed
could never match — and the region-lock SCP (ADR-0009) forbids the
AWS-documented fix of creating rules in us-east-1.

Chosen fix: CloudWatch Logs metric-filter alarms in ca-central-1 on the
member trail's log group, using the CIS AWS Foundations patterns VERBATIM
(Security Hub CloudWatch.1/.3/.4 check these exactly). Not a workaround:
this is the CIS-canonical implementation for these three detections.

- rule 2 (CIS 4.2): expected-but-logged for Identity Center sign-ins
  (MFAUsed=No at the CloudTrail layer; MFA lives at the IdP) — runbook
- rule 3 (CIS 4.3): invokedBy/AwsServiceEvent exclusions drop
  AWS-service-initiated root noise the old pattern alerted on
- rule 4 (CIS 4.4): full 16-event list (old pattern missed DeletePolicy,
  DeletePolicyVersion)
- rule 9: now watches suppression of BOTH transports (DeleteMetricFilter,
  DeleteAlarms, DisableAlarmActions added)
- ADR-0014 records the SCP-forced trade-off; plan.md residual #9 documents
  the ~5-10 min latency; threat-model + runbook updated per acceptance

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arnoldcastro5000
arnoldcastro5000 merged commit 917ca10 into main Jul 7, 2026
9 checks passed
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