fix: harden gateway security guidance (#2000) (thanks @rhuanssauro)

This commit is contained in:
Peter Steinberger committed 2026-01-26 13:38:37 +00:00
1 parent 42fe1021ca
commit 09ab5a9b31
14 files changed
+67 -89

No files matched your search

+3 -7
View File
@@ -68,13 +68,9 @@ clawdbot gateway --tailscale serve
Open:
- `https://<magicdns>/` (or your configured `gateway.controlUi.basePath`)
By default, Serve requests can authenticate via Tailscale identity headers
(`tailscale-user-login`) when `gateway.auth.allowTailscale` is `true`. Clawdbot
verifies the identity by resolving the `x-forwarded-for` address with
`tailscale whois` and matching it to the header, and only accepts these when the
request hits loopback with Tailscale’s `x-forwarded-*` headers. Set
`gateway.auth.allowTailscale: false` (or force `gateway.auth.mode: "password"`)
if you want to require a token/password even for Serve traffic.
Serve does **not** replace Gateway auth. Set a token/password (prefer
`CLAWDBOT_GATEWAY_TOKEN` or `CLAWDBOT_GATEWAY_PASSWORD`) and connect with it.
Keep `gateway.auth.allowTailscale: false` (legacy option).
### Bind to tailnet + token
+1 -1
View File
@@ -29,7 +29,7 @@ Authentication is enforced at the WebSocket handshake via `connect.params.auth`
- **Localhost**: open `http://127.0.0.1:18789/`. If you see “unauthorized,” run `clawdbot dashboard` and use the tokenized link (`?token=...`).
- **Token source**: `gateway.auth.token` (or `CLAWDBOT_GATEWAY_TOKEN`); the UI stores it after first load.
- **Not localhost**: use Tailscale Serve (tokenless if `gateway.auth.allowTailscale: true`), tailnet bind with a token, or an SSH tunnel. See [Web surfaces](/web).
- **Not localhost**: use Tailscale Serve with a token/password, tailnet bind with a token, or an SSH tunnel. See [Web surfaces](/web).
## If you see “unauthorized” / 1008
+4 -5
View File
@@ -91,14 +91,13 @@ Open:
## Security notes
- Gateway auth is required by default (token/password or Tailscale identity headers).
- Gateway auth is required by default (token/password).
- Non-loopback binds still **require** a shared token/password (`gateway.auth` or env).
- The wizard generates a gateway token by default (even on loopback).
- The UI sends `connect.params.auth.token` or `connect.params.auth.password`.
- With Serve, Tailscale identity headers can satisfy auth when
`gateway.auth.allowTailscale` is `true` (no token/password required). Set
`gateway.auth.allowTailscale: false` to require explicit credentials. See
[Tailscale](/gateway/tailscale) and [Security](/gateway/security).
- Tailscale Serve does not bypass auth; use token/password and keep
`gateway.auth.allowTailscale: false`. See [Tailscale](/gateway/tailscale) and
[Security](/gateway/security).
- `gateway.tailscale.mode: "funnel"` requires `gateway.auth.mode: "password"` (shared password).
## Building the UI