security(web+cli): dashboard token TTL rotation + vxd dashboard rotate-token (P0-04)#121
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.vxd/dashboard.tokenwas 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(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 newDASHBOARD_TOKEN_ROTATEDevent (handled in the projection switch; exhaustiveness test green).vxd dashboard rotate-tokenfor 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_TOKENenv 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