Repository navigation
feat: require a setup token to create the first user on a tunnel (#32324) - #32512
Conversation
|
👋 Hey @coder-backporter-app[bot]! This PR is targeting the Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format: If this is not a bug fix, it likely should not target a release branch. |
) fix(security): require setup token for first user on tunnels Prevent unauthorized users from claiming Owner access on public `try.coder.app` tunnels before initial setup. - Generate a setup token at startup when using a tunnel with no existing users. - Require the token for first-user creation via the API, web UI, and CLI. - Block GitHub/OIDC first-user signup until setup is complete. - Support custom tokens via `--setup-token` / `CODER_SETUP_TOKEN` and non-interactive CLI setup. - Update development scripts, documentation, and tests. - Preserve existing behavior for deployments with an access URL or existing users. Validated with automated tests and 23/23 manual scenarios using a real tunnel. Refs CORE-784 (cherry picked from commit 88d3494)
1fa8f7b to
db03a86
Compare
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
|
Chat: Review posted | View chat Review history
deep-review v0.13.0 | Round 1 | Last posted: Round 1, no findings, COMMENT. Review Finding inventoryFindings
Contested and acknowledged(none) Round logRound 1Round type: round 1, full panel. Requester limited the review to P0, P1, and P2. Netero first pass: no findings; per-file comparison against #32324 shows server and CLI logic identical, with differences limited to those listed in the PR description. Law not run (effective additions 787, under 1000). About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
This PR backports #32324 to release/2.34: a setup token is required to create the first user when coder server opens a try.coder.app tunnel. As requested, the review covered P0 to P2 only, and it found 0 P0, 0 P1, and 0 P2 findings. The server and CLI changes match #32324, and the remaining differences are the ones listed in the description. The targeted Go tests, the SetupPage vitest file, and tsc pass at 1120029.
🤖 This review was automatically generated with Coder Agents.
Backport of #32324
Original PR: #32324 — feat: require a setup token to create the first user on a tunnel
Merge commit: 88d3494
Requested by: @BobbyHo
The automatic cherry-pick had conflicts. They are resolved by hand; the server and CLI changes are the same as in #32324.
Differences from #32324
scripts/develop: keeps this branch's password handling and adds only the setup token.password_test.gois left out because it comes from fix: generate per-instance dev passwords and remove the shared default #32283, which is not on this branch.docs/tutorials/quickstart.md), Azure and Compute Engine wording is applied to this branch's page layout. The sentences fordocs/install/index.mdand the RPM page are left out because those pages do not mention the tunnel here.Templatespage after setup, as it does on this branch.cli/login_test.go: the prompt test usesptytest, becausetestutil/expecteris not on this branch.