Skip to content

fix: audit Codex Desktop credential issuance - #81

Merged
OBenner merged 1 commit into
mainfrom
feat/3-audit-log
Nov 16, 2026
Merged

OBenner merged 1 commit into
mainfrom
feat/3-audit-log

Conversation

@OBenner

@OBenner OBenner commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Codex Desktop provisioning constructed CredentialStore without an audit sink, so issuing the operator and role tokens left no issuance record in the project audit or doctor. Wire the existing FileSecurityAuditLog into that provisioner, matching the other hosts. Re-init reuses valid credentials without extra issue events.

M4-min's append-only storage, auth/operator events, rotation/revocation audit, and doctor readout already landed in 21b287e; this PR closes the remaining Desktop issuance gap. The backlog M4 row is already DONE. No credential semantics or dependencies change.

Verification: the new regression failed before the fix (expected two issuance events, received none). Full pnpm verify passes: 87 files / 778 tests plus formatting, imports, types, and build. The regression verifies doctor visibility, no duplicate issue events on re-init, and no raw tokens in audit output. Existing M4 auth/operator/lifecycle/append-only tests pass in that full run. git diff --check is clean.

  • Full verify green.
  • Security rotation documentation updated with code.
  • New behavior tested; existing tests not weakened.
  • No real credentials, identifiers, or message bodies committed.
  • No message protocol changes.

Refs #3. Review: dev → CTO. No live credential operation was performed; all provisioning was confined to temporary test fixtures.

@OBenner OBenner left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

dev review — ACCEPT.

Проверено по диффу (83f4a1d, base 7cd06b0):

  1. Wiring идентичен остальным init-хостам: generic-host.ts, opencode-host.ts, initialize-team.ts конструируют CredentialStore ровно так же (new FileSecurityAuditLog(auditLogPath(paths.home, paths.key))) — gap закрыт консистентно, без расхождений.
  2. Семантика без дублей подтверждена по коду: ensureCredential при валидном существующем токене возвращает reused:true и не вызывает issue — повторный init не пишет лишних событий. Тест это пинит (сравнение файла до/после re-init).
  3. Гигиена: события несут action/agentId/reasonCode, без tokenHash и raw token — тест это проверяет явно.
  4. Claim-контур Codex Desktop не выдаёт credentials вне provisionDesktopRoles — других непокрытых точек issue нет.
  5. Проверил на ветке: test/init/codex-desktop.test.ts — 2/2 PASS (worktree review-81, pnpm install --frozen-lockfile). CI 3/3 зелёный.

Docs-абзац в token-rotation.md соответствует фактическому поведению. Замечаний нет. Передаю CTO на финал.

@OBenner
OBenner merged commit e25fa04 into main Nov 16, 2026
3 checks passed
@OBenner
OBenner deleted the feat/3-audit-log branch November 16, 2026 09:58
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