You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/ipn
Nick Khyl 551d6ae0f3 ipn, ipn/ipnauth: implement API surface for LocalBackend access checking
We have a lot of access checks spread around the
ipnserver, ipnlocal, localapi, and ipnauth
packages, with a significant number of
platform-specific checks that are used exclusively
on either Windows or Unix-like platforms.
Additionally, with the exception of a few
Windows-specific checks, most of these checks are
per-device rather than per-profile, which is not
always correct even on single-user/single-session
environments, but even more problematic on
multi-user/multi-session environments such as
Windows.

We initially attempted to map all possible
operations onto the permitRead/permitWrite access
flags. However, these flags are not utilized on
Windows and prove insufficient on Unix machines.
Specifically, on Windows, the first user to
connect is granted full access, while subsequent
logged-in users have no access to the LocalAPI at
all. This restriction applies regardless of the
environment, local user roles (e.g., whether a
Windows user is a local admin), or whether they
are the active user on a shared Windows client
device. Conversely, on Unix, we introduced the
permitCert flag to enable granting non-root web
servers (such as www-data, caddy, nginx, etc.)
access to certificates. We also added additional
access check to distinguish local admins (root
on Unix-like platforms, elevated admins on
Windows) from users with permitWrite access,
and used it as a fix for the serve path LPE.

A more fine-grained access control system could
better suit our current and future needs, especially
in improving the UX across various scenarios on
corporate and personal Windows devices.

This adds an API surface in ipnauth that will be
used in LocalBackend to check access to individual
Tailscale profiles as well as any device-wide
information and operations.

Updates tailscale/corp#18342

Signed-off-by: Nick Khyl <nickk@tailscale.com>
4 weeks ago
..
conffile ipn/{conffile,ipnlocal}: start booting tailscaled from a config file w/ auth key 7 months ago
ipnauth ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
ipnlocal ipn/ipnlocal,clientupdate: disallow auto-updates in containers (#11814) 4 weeks ago
ipnserver all: use Go 1.22 range-over-int 1 month ago
ipnstate ipn/ipnlocal: populate peers' capabilities (#11365) 1 month ago
localapi all: use Go 1.22 range-over-int 1 month ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 6 months ago
store ipn/store: omit AWS & Kubernetes support on 'small' Linux GOARCHes 1 month ago
backend.go ipn: remove unused Options.LegacyMigrationPrefs 1 month ago
conf.go cmd/k8s-operator,ipn/conf.go: fix --accept-routes for proxies (#11453) 2 months ago
doc.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
errors.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
ipn_clone.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
ipn_test.go net/packet: split off checksum munging into different pkg 7 months ago
ipn_view.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
prefs.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 4 weeks ago
prefs_test.go all: use Go 1.22 range-over-int 1 month ago
serve.go all: deprecate Node.Capabilities (more), remove PeerChange.Capabilities [capver 89] 2 months ago
serve_test.go {ipn/serve,cmd/tailscale/cli}: move some shared funcs to ipn 2 months ago
store.go ipn: add comment about thread-safety to StateStore 2 months ago
store_test.go ipn: avoid useless no-op WriteState calls 9 months ago