tailscale/cmd
Nick Khyl 961ee321e8 ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend
Currently, we use PermitRead/PermitWrite/PermitCert permission flags to determine which operations are allowed for a LocalAPI client.
These checks are performed when localapi.Handler handles a request. Additionally, certain operations (e.g., changing the serve config)
requires the connected user to be a local admin. This approach is inherently racey and is subject to TOCTOU issues.
We consider it to be more critical on Windows environments, which are inherently multi-user, and therefore we prevent more than one
OS user from connecting and utilizing the LocalBackend at the same time. However, the same type of issues is also applicable to other
platforms when switching between profiles that have different OperatorUser values in ipn.Prefs.

We'd like to allow more than one Windows user to connect, but limit what they can see and do based on their access rights on the device
(e.g., an local admin or not) and to the currently active LoginProfile (e.g., owner/operator or not), while preventing TOCTOU issues on Windows
and other platforms. Therefore, we'd like to pass an actor from the LocalAPI to the LocalBackend to represent the user performing the operation.
The LocalBackend, or the profileManager down the line, will then check the actor's access rights to perform a given operation on the device
and against the current (and/or the target) profile.

This PR does not change the current permission model in any way, but it introduces the concept of an actor and includes some preparatory
work to pass it around. Temporarily, the ipnauth.Actor interface has methods like IsLocalSystem and IsLocalAdmin, which are only relevant
to the current permission model. It also lacks methods that will actually be used in the new model. We'll be adding these gradually in the next
PRs and removing the deprecated methods and the Permit* flags at the end of the transition.

Updates tailscale/corp#18342

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2024-08-28 13:49:58 -05:00
..
addlicense all: update tools that manage copyright headers 2023-01-27 15:36:29 -08:00
build-webclient client/web: precompress assets 2023-12-07 20:57:31 -05:00
cloner cmd/cloner, cmd/viewer, util/codegen: add support for aliases of cloneable types 2024-08-23 15:43:40 -05:00
connector-gen cmd/connector-gen: add helper tool for wide app connector configurations 2023-12-15 09:29:42 -08:00
containerboot cmd/containerboot: optionally serve health check endpoint (#12899) 2024-08-14 05:28:29 +01:00
derper usermetric: add initial user-facing metrics 2024-08-27 11:21:35 +02:00
derpprobe cmd/derpprobe: use a status page from the prober library 2024-08-06 11:27:59 +01:00
dist release/dist/qnap: add qnap target builder 2024-04-22 17:43:28 -04:00
get-authkey util/cmpx: delete now that we're using Go 1.22 2024-02-07 18:10:15 -08:00
gitops-pusher cmd/gitops-pusher: ignore previous etag if local acls match control (#13068) 2024-08-08 13:23:06 -07:00
hello cmd/hello: link to the Hello KB article (#11022) 2024-02-02 15:48:31 -08:00
k8s-nameserver cmd/k8s-nameserver: fix AAAA record query response (#12412) 2024-06-10 17:57:22 +01:00
k8s-operator ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend 2024-08-28 13:49:58 -05:00
mkmanifest cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 2023-03-01 15:45:12 -07:00
mkpkg go.mod: upgrade nfpm to v2 (#8786) 2023-08-03 13:00:45 -07:00
mkversion version/mkversion: open-source version generation logic 2023-02-18 05:21:05 +00:00
nardump all: update copyright and license headers 2023-01-27 15:36:29 -08:00
natc go.mod: bump bart 2024-07-08 19:10:44 -07:00
netlogfmt all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
nginx-auth tailcfg,all: add and use Node.IsTagged() 2023-03-13 08:44:25 -07:00
pgproxy tsnet: split user facing and backend logging 2024-05-10 15:29:13 -07:00
printdep cmd/printdep: print correct toolchain URL 2023-02-11 17:57:36 +00:00
proxy-to-grafana cmd/proxy-to-grafana: add flag for alternative control server 2024-06-21 12:17:39 +02:00
sniproxy all: use math/rand/v2 more 2024-06-05 15:24:04 -07:00
speedtest all: update copyright and license headers 2023-01-27 15:36:29 -08:00
ssh-auth-none-demo all: replace deprecated ioutil references 2023-08-23 23:53:19 +01:00
stunc cmd/stunc: support user-specified port (#12469) 2024-06-14 09:46:16 -07:00
stund tsweb/varz: remove pprof 2024-08-27 11:21:35 +02:00
stunstamp cmd/stunstamp: refactor connection construction (#13110) 2024-08-12 14:09:45 -07:00
sync-containers all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
systray cmd/systray: set ipn.NotifyNoPrivateKeys, permit non-operator use 2024-08-23 10:15:49 -07:00
tailscale usermetric: add initial user-facing metrics 2024-08-27 11:21:35 +02:00
tailscaled ipn/{ipnauth,ipnlocal,ipnserver,localapi}: start baby step toward moving access checks from the localapi.Handler to the LocalBackend 2024-08-28 13:49:58 -05:00
testcontrol all: use Go 1.22 range-over-int 2024-04-16 15:32:38 -07:00
testwrapper cmd/testwrapper: apply results of all unit tests to coverage for all packages 2024-02-21 13:08:17 -06:00
tl-longchain cmd/tl-longchain: tool to re-sign nodes with long rotation signatures 2024-08-21 18:22:22 +01:00
tsconnect all: use math/rand/v2 more 2024-06-05 15:24:04 -07:00
tsidp cmd/tsidp: add funnel support (#12591) 2024-08-08 10:46:45 -04:00
tsshd all: update copyright and license headers 2023-01-27 15:36:29 -08:00
tta cmd/tta: pull out test driver dialing into a type, fix bugs 2024-08-26 15:36:30 -07:00
viewer cmd/cloner, cmd/viewer, util/codegen: add support for aliases of cloneable types 2024-08-23 15:43:40 -05:00
vnet tstest/natlab/vnet: add start of IPv6 support 2024-08-24 18:02:38 -07:00
xdpderper all: add test for package comments, fix, add comments as needed 2024-07-10 09:57:00 -07:00