First-run setup closes once the instance has an admin; 30-minute window (#852) #854

Merged
Cordy merged 3 commits from setup-852 into main 2026-10-06 22:14:35 +00:00
Owner

Closes #852. Security fix, v0.6.319.

Decision A + B (Nikola):

  • A. Setup never opens, and no token is logged, once the instance has an admin. That covers auth.users, a local account, runtime directory admins, or, in oidc/ldap mode, auth.admins / auth.adminGroups. A lasting "setup closed" marker in instance state (posix and s3, via statePaths) keeps it closed even if the last local account is deleted later. In local mode, auth.admins alone doesn't close setup.
  • B. On a truly fresh instance the token works for 30 minutes. After that, /setup/status returns pending:false (the page sends you to sign-in) and POST /setup returns 410 until the next restart.
  • Fails closed: if the marker can't be read, setup stays closed and an ERROR is logged.
  • The decision is a pure function, auth.SetupAllowed. Docs (deployment.md, local-accounts.md) and the CHANGELOG are updated.

Reviewed by an independent reviewer: approved, no Critical or Important findings. The minor findings are fixed in 6981c286.

After deploy, cairn-enc should log "first-run setup skipped" and no token.

Closes #852. Security fix, v0.6.319. **Decision A + B (Nikola):** - **A.** Setup never opens, and no token is logged, once the instance has an admin. That covers `auth.users`, a local account, runtime directory admins, or, in oidc/ldap mode, `auth.admins` / `auth.adminGroups`. A lasting "setup closed" marker in instance state (posix and s3, via `statePaths`) keeps it closed even if the last local account is deleted later. In local mode, `auth.admins` alone doesn't close setup. - **B.** On a truly fresh instance the token works for 30 minutes. After that, `/setup/status` returns pending:false (the page sends you to sign-in) and `POST /setup` returns 410 until the next restart. - Fails closed: if the marker can't be read, setup stays closed and an ERROR is logged. - The decision is a pure function, `auth.SetupAllowed`. Docs (deployment.md, local-accounts.md) and the CHANGELOG are updated. Reviewed by an independent reviewer: approved, no Critical or Important findings. The minor findings are fixed in 6981c286. After deploy, cairn-enc should log "first-run setup skipped" and no token.
Cordy merged commit d60ab638dd into main 2026-10-06 22:14:35 +00:00
Cordy deleted branch setup-852 2026-10-06 22:14:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#854
No description provided.