Skip to content

[Bug]: admin audit export is not audited and auth silently caps audit retention #467

Closed

Description

@jimhoyd

Runtime revision and environment

main at d939969 (static source review; not executed against a deployment). Node/OS/deployment: not applicable.

Minimal reproduction

Reported by review, not independently reproduced.

  • Audit export is not itself audited. GET /audit/export (packages/admin/src/admin.ts lines 199-203, packages/admin/src/admin-audit-export.ts) checks auth.audit.read and auth.audit.export. It writes no audit event, and it requires neither a reason nor a recent sign-in. packages/admin/THREAT-MODEL.md:17 lists "audited reveal/export" as a mitigation.
    • Fix: record an audit event (actor, range, count) for each export, require a reason, and require fresh authentication as other sensitive admin actions do. Or correct the threat model.
  • Silent audit retention cap. packages/auth/src/auth-store.ts:253 deletes all but the newest 100,000 audit rows. The cap is not documented, and nothing tells the operator when rows are dropped.
    • Fix: document the retention bound in the auth operations/security docs, make it configurable, and emit a metric or log line when rows are pruned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions