Repository navigation
feat: require a setup token to create the first user on a tunnel (#32324) - #32513
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)
d08c343 to
00317ca
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 inventoryFinding inventory, PR #32513Findings
Contested and acknowledgedNone. Round logRound 1Round type: round 1, full panel. Netero first pass: 2 P3, no P0, panel proceeded. Law not run (effective additions 764). About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
This PR backports #32324, which requires a setup token to create the first user when coder server opens a try.coder.app tunnel. No P0, P1, or P2 findings. As requested, findings below P2 are not posted.
The added and removed lines match #32324 file by file, except for the four files named in the description (docs/install/index.md, docs/install/server/rpm.md, scripts/develop/password_test.go, and cfg.password in scripts/develop/main.go).
Out of scope (needs a ticket or explicit acceptance by a human):
site/src/pages/SetupPage/SetupPage.tsx:37:SetupPagerenders the form when theauthmethodsquery fails, so the page silently drops the auth options that the response would have enabled.
🤖 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/install/index.mdanddocs/install/server/rpm.mdare left out. Those pages do not mention the tunnel on this branch.