Repository navigation
fix(security): attribute static admin mutations - #7640
Conversation
There was a problem hiding this comment.
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 onserver/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.
There was a problem hiding this comment.
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.
Summary
X-Admin-Operatorvalue to mutation audit details and structured registry logsADMIN_OPERATORavailable for human attributionValidation
Fixes #4208
Open workspace in Conductor