Skip to content

fix(security): attribute static admin mutations - #7640

Merged
bokelley merged 2 commits into
mainfrom
codex/issue-4208-static-admin-audit
Sep 21, 2026
Merged

bokelley merged 2 commits into
mainfrom
codex/issue-4208-static-admin-audit

Conversation

@bokelley

@bokelley bokelley commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • derive an 8-character SHA-256 fingerprint only after the static admin key validates
  • attach trusted request IP and a sanitized optional X-Admin-Operator value to mutation audit details and structured registry logs
  • identify incident scripts automatically, with ADMIN_OPERATOR available for human attribution

Validation

  • focused: 169 tests
  • full pre-commit: 656 server test files, 10,922 passed, 31 skipped
  • TypeScript checks passed

Fixes #4208


Open workspace in Conductor

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Sep 21, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — static-admin mutation attribution PR (server routes + incident scripts). Adds a SHA-256 key fingerprint, trusted request IP, and sanitized X-Admin-Operator header to audit details and structured logs, gated behind static-admin authentication.

Checks performed:

  • Fail-closed: attribution is set only after credential validation, and is a no-op for tenant/user requests. Verified in both requireAuth and optionalAuth paths, both tested.
  • Operator header sanitized against log injection.
  • Operational-only PR — no protocol surface touched (static/schemas/source/**, docs/reference/**, dist/** untouched), so no changeset required and no schema↔docs coherence concern.

No Critical/High/Medium findings from the reviewer.

Decision-rule walkthrough:

  • Row 1 (critical/high): no findings.
  • Row 2 (gated_paths + not APPROVED): gated_paths is false — does not fire.
  • Rows 3–5 (high-risk deleted/modified + medium; medium data-loss/schema/infra): high_risk is true only via (modified) matches on server/src/routes/**, but there are zero medium findings, so none of these fire.
  • Row 6 (sticky escalate): no prior decision.
  • Row 7 (no-auto-approve team): no team match.
  • Row 8 (≥3 medium): zero medium.
  • Row 9: approve.

Comment thread server/src/middleware/auth.ts Fixed

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean hardening change, no blocking findings.

The delta pass reviewed the two substantive changes: server/src/middleware/auth.ts and its unit test. The admin API-key audit fingerprint moves from a truncated plain SHA-256 of the secret to a domain-separated HMAC keyed by the secret (:v1 tag), with the test updated in lockstep. createHmac is already imported, the fingerprint is audit/log-only (auth still gates on constantTimeEqual), so the happy path is unchanged. App-scoped hardening: no protocol wire surface touched, so no changeset required.

Decision-table walk: no critical/high findings (row 1 n/a); gated_paths is false (row 2 n/a); no (deleted) high-risk reasons (row 3 n/a) — all high-risk matches are (modified) under server/src/routes/**; no medium findings at all, so rows 4, 5, and 8 do not fire; no author team gate (row 7 n/a); prior decision was approve, so sticky-escalation row 6 does not apply. Falls through to row 9 → approve.

High-risk flag is a heuristic; the modified server/src/routes/** files carry no medium-or-higher concerns, so the modifications are presumed safe. Net improvement over prior clean pass.

@bokelley
bokelley merged commit 7aa5c3c into main Sep 21, 2026
30 checks passed
@bokelley
bokelley deleted the codex/issue-4208-static-admin-audit branch September 21, 2026 18:22
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.

Audit-log enrichment for static ADMIN_API_KEY paths

2 participants