Skip to content

security(web+cli): dashboard token TTL rotation + vxd dashboard rotate-token (P0-04)#121

Merged
tzone85 merged 1 commit into
mainfrom
fix/p0-04-dashboard-token-rotation
Jul 16, 2026
Merged

security(web+cli): dashboard token TTL rotation + vxd dashboard rotate-token (P0-04)#121
tzone85 merged 1 commit into
mainfrom
fix/p0-04-dashboard-token-rotation

Conversation

@tzone85

@tzone85 tzone85 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • ~/.vxd/dashboard.token was a static 32-byte hex string for the life of the install — a leaked token granted dashboard control until someone manually deleted the file. Tokens now expire.
  • New dashboard.token_ttl_hours (default 168 = 7 days; negative disables). At web-dashboard startup, a token file older than the TTL is rotated (web.LoadOrGenerateTokenWithTTL), logged, and recorded as a new DASHBOARD_TOKEN_ROTATED event (handled in the projection switch; exhaustiveness test green).
  • New vxd dashboard rotate-token for manual rotation: replaces the 0o600 file, prints the new token, emits the audit event, and tells the operator to restart a running daemon.
  • VXD_DASHBOARD_TOKEN env override is operator-managed — never rotated.

Tests

TestAuth_TokenRotatesAfterTTL (mint/keep/rotate/ttl-off/env-override), TestRotateTokenFile, TestDashboardRotateTokenCmd, TestDashboardTokenTTL.

Closes WEAKNESSES.md P0-04. Per-user identity / RBAC remains a cross-cutting multi-tenancy workstream, tracked separately.

🤖 Generated with Claude Code

…e-token

~/.vxd/dashboard.token was a static 32-byte hex string for the life of
the install — a leaked token granted dashboard control until someone
manually deleted the file. Tokens now expire.

- dashboard.token_ttl_hours config (default 168 = 7 days; 0 → default,
  negative → rotation off). At web-dashboard startup, a token file older
  than the TTL is replaced (web.LoadOrGenerateTokenWithTTL) and the
  rotation is logged + recorded as DASHBOARD_TOKEN_ROTATED.
- New `vxd dashboard rotate-token` for manual rotation
  (web.RotateTokenFile): replaces the 0o600 file, prints the new token,
  emits the audit event (best-effort), and tells the operator to
  restart a running daemon (which holds the old token in memory).
- VXD_DASHBOARD_TOKEN env override is operator-managed — never rotated.
- New DASHBOARD_TOKEN_ROTATED event type, handled in the projection
  switch (informational, audit-trail only); exhaustiveness test green.
- Tests: TestAuth_TokenRotatesAfterTTL (mint/keep/rotate/ttl-off/env),
  TestRotateTokenFile, TestDashboardRotateTokenCmd, TestDashboardTokenTTL.
- Docs: CLAUDE.md config block + CLI rows, README dashboard row + CLI row.

Closes WEAKNESSES.md P0-04. (Per-user identity / RBAC remains a
cross-cutting multi-tenancy workstream, out of scope here.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tzone85
tzone85 merged commit 30680a1 into main Jul 16, 2026
1 check passed
@tzone85
tzone85 deleted the fix/p0-04-dashboard-token-rotation branch July 16, 2026 02:20
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.

2 participants