tailscale/cmd/tailscaled
Aaron Klotz 95671b71a6 ipn, safesocket: use Windows token in LocalAPI
On Windows, the idiomatic way to check access on a named pipe is for
the server to impersonate the client on its current OS thread, perform
access checks using the client's access token, and then revert the OS
thread's access token back to its true self.

The access token is a better representation of the client's rights than just
a username/userid check, as it represents the client's effective rights
at connection time, which might differ from their normal rights.

This patch updates safesocket to do the aforementioned impersonation,
extract the token handle, and then revert the impersonation. We retain
the token handle for the remaining duration of the connection (the token
continues to be valid even after we have reverted back to self).

Since the token is a property of the connection, I changed ipnauth to wrap
the concrete net.Conn to include the token. I then plumbed that change
through ipnlocal, ipnserver, and localapi as necessary.

I also added a PermitLocalAdmin flag to the localapi Handler which I intend
to use for controlling access to a few new localapi endpoints intended
for configuring auto-update.

Updates https://github.com/tailscale/tailscale/issues/755

Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2023-10-26 09:43:19 -06:00
..
childproc all: update copyright and license headers 2023-01-27 15:36:29 -08:00
debug.go net/netmon: make ChangeFunc's signature take new ChangeDelta, not bool 2023-08-23 10:42:14 -07:00
depaware.txt ipn, safesocket: use Windows token in LocalAPI 2023-10-26 09:43:19 -06:00
generate.go cmd/mkmanifest, cmd/tailscale, cmd/tailscaled: remove Windows arm32 resources from OSS 2023-03-01 15:45:12 -07:00
install_darwin.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
install_windows.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
manifest_windows_386.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
manifest_windows_amd64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
manifest_windows_arm64.syso cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
proxy.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
required_version.go all: require Go 1.21 2023-08-08 21:15:08 -07:00
sigpipe.go all: adjust some build tags for plan9 2023-08-24 15:42:35 -07:00
ssh.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
taildrop.go various: add detection and Taildrop for Unraid 2023-05-04 13:40:13 -07:00
tailscaled_bird.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
tailscaled_notwindows.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
tailscaled_test.go util/linuxfw: remove yet-unused code to fix linux/arm64 crash 2023-07-20 23:18:40 -07:00
tailscaled_windows.go util/syspolicy: add read boolean setting (#9592) 2023-09-29 21:27:04 -04:00
tailscaled.defaults cmd/tailscaled: rename relaynode reference in defaults file comment 2020-03-13 14:38:04 -07:00
tailscaled.go cmd/tailscaled,*: add start of configuration file support 2023-10-16 10:40:27 -07:00
tailscaled.openrc tstest/integration/vms: use an in-process logcatcher (#2360) 2021-07-08 14:39:45 -04:00
tailscaled.service cmd/tailscaled: use explicit equal sign in --port=$PORT in tailscaled.service 2022-09-22 11:54:22 -07:00
windows-manifest.xml cmd/{tailscale,tailscaled}: embed manifest into Windows binaries 2022-11-21 18:15:51 -05:00
with_cli.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00