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/ipnauth
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>
1 month ago
..
access.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
access_check.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
access_check_test.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
access_test.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
identity.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
identity_test.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
ipnauth.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
ipnauth_notwindows.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
ipnauth_windows.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
nonwin_test.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
self.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
testutils.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
unix.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
win.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago
win_test.go ipn, ipn/ipnauth: implement API surface for LocalBackend access checking 1 month ago