mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-06 23:36:34 +09:00
On macsys tailscaled runs as root inside a system extension and serves every local user over a loopback TCP port, so the only thing deciding what a caller may do is which token they can read. The one token we published, sameuserproof-$port, is root:admin 0640, which leaves a user outside the admin group with no access at all: not even the handlers that only read the state of the node. Publish a second token beside it in sameuserproof-ro-$port at 0644 and fall back to it when the sameuserproof file cannot be read. The extension recognizes the token through safesocket.ReadOnlyToken and serves such a client a LocalAPI without PermitWrite. The advice attached to an access-denied error was wrong for these users. "Use sudo" is no help when it is membership in the same admin group that grants sudo, so when our credentials are the read-only ones, say that write access requires being in the admin group instead. Updates tailscale/corp#48949 Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>