summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2024-01-09client/web: switch to custom fork of gorilla/csrfwill/webclient-csrfWill Norris5-21/+13
This fork removes the dependency on the html/template package, so we should be able to enable the web client on mobile in the near future. Updates #10261 Signed-off-by: Will Norris <will@tailscale.com>
2024-01-09cli/set: add printout when web client startedSonia Appasamy1-1/+10
Prints a helpful message with the web UI's address when running tailscale set --webclient. Updates tailscale/corp#16345 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2024-01-09taildrop: remove breaking abstraction layers for apple (#10728)Rhea Ghosh6-58/+20
Removes the avoidFinalRename logic and all associated code as it is no longer required by the Apple clients. Enables resume logic to be usable for Apple clients. Fixes tailscale/corp#14772 Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
2024-01-09.github/workflows/govulncheck: migrate to a Github App (#10793)Andrew Lytvynov1-11/+24
Send failures to a new channel using a github app token instead of webhook URL. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-01-09net/netutil: allow 16-bit 4via6 site IDsAndrew Dunham3-7/+26
The prefix has space for 32-bit site IDs, but the validateViaPrefix function would previously have disallowed site IDs greater than 255. Fixes tailscale/corp#16470 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I4cdb0711dafb577fae72d86c4014cf623fa538ef
2024-01-09cmd/k8s-operator,k8s-operator: allow the operator to deploy exit nodes via ↵Irbe Krumina10-792/+1052
Connector custom resource (#10724) cmd/k8s-operator/deploy/crds,k8s-operator/apis/v1alpha1: allow to define an exit node via Connector CR. Make it possible to define an exit node to be deployed to a Kubernetes cluster via Connector Custom resource. Also changes to Connector API so that one Connector corresponds to one Tailnet node that can be either a subnet router or an exit node or both. The Kubernetes operator parses Connector custom resource and, if .spec.isExitNode is set, configures that Tailscale node deployed for that connector as an exit node. Signed-off-by: Irbe Krumina <irbe@tailscale.com> Co-authored-by: Anton Tolchanov <anton@tailscale.com>
2024-01-08cmd/{derper,stund},net/stunserver: add standalone stun serverJames Tucker8-110/+474
Add a standalone server for STUN that can be hosted independently of the derper, and factor that back into the derper. Fixes #8434 Closes #8435 Closes #10745 Signed-off-by: James Tucker <james@tailscale.com>
2024-01-08client/web: ensure path prefix has a leading slashWill Norris2-22/+52
This is simply an extra check to prevent hypothetical issues if a prefix such as `--prefix="javascript:alert(1)"` was provided. This isn't really necessary since the prefix is a configuration flag provided by the device owner, not user input. But it does enforce that we are always interpreting the provided value as a path relative to the root. Fixes: tailscale/corp#16268 Signed-off-by: Will Norris <will@tailscale.com>
2024-01-08licenses: update win/apple licensesLicense Updater2-9/+25
Signed-off-by: License Updater <noreply+license-updater@tailscale.com>
2024-01-08licenses: update tailscale{,d} licensesLicense Updater1-4/+4
Signed-off-by: License Updater <noreply+license-updater@tailscale.com>
2024-01-08tstest/integration: add tests for auto-update defaulting behavior (#10763)Andrew Lytvynov1-0/+95
Updates #16244 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-01-08client/web: rename Disconnect to Log outSonia Appasamy3-12/+30
For consistency w/ the CLI command. And to be more accurate to what is actually happening on this action - node key is expired. Also updates the disconnected view shown after logout. Updates #10261 Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
2024-01-08cmd/containerboot: add EXPERIMENTAL_TS_CONFIGFILE_PATH env var to allow ↵Irbe Krumina2-56/+148
passing tailscaled config in a file (#10759) * cmd/containerboot: optionally configure tailscaled with a configfile. If EXPERIMENTAL_TS_CONFIGFILE_PATH env var is set, only run tailscaled with the provided config file. Do not run 'tailscale up' or 'tailscale set'. * cmd/containerboot: store containerboot accept_dns val in bool pointer So that we can distinguish between the value being set to false explicitly bs being unset. Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2024-01-05ipn: apply ControlURL policy before loginAdrian Dewhurst3-5/+16
Unlike most prefs, the ControlURL policy needs to take effect before login. This resolves an issue where on first start, even when the ControlURL policy is set, it will generate a login URL to the Tailscale SaaS server. Updates tailscale/coral#118 Fixes #10736 Change-Id: I6da2a521f64028c15dbb6ac8175839fc3cc4e858 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2024-01-05docs: add Windows administrative templateAdrian Dewhurst2-0/+478
To make setting Windows policies easier, this adds ADMX policy descriptions. Fixes #6495 Updates ENG-2515 Change-Id: If4613c9d8ec734afec8bd781575e24b4aef9bb73 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2024-01-05net/dns/resolver: add ID to verbose logs in forwarderAndrew Dunham1-2/+7
To make it easier to correlate the starting/ending log messages. Updates #cleanup Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I2802d53ad98e19bc8914bc58f8c04d4443227b26
2024-01-05taildrop: Allow category Z unicode characters (#10750)Rhea Ghosh2-1/+2
This will expand the unicode character categories that we allow for valid filenames to go from "L, M, N, P, S, and the ASCII space character" to "L, M, N, P, S, Zs" Fixes #10105 Signed-off-by: Rhea Ghosh <rhea@tailscale.com>
2024-01-05cmd/tailscale, ipn/ipnlocal: add 'debug dial-types' commandAndrew Dunham2-0/+139
This command allows observing whether a given dialer ("SystemDial", "UserDial", etc.) will successfully obtain a connection to a provided host, from inside tailscaled itself. This is intended to help debug a variety of issues from subnet routers to split DNS setups. Updates #9619 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Ie01ebb5469d3e287eac633ff656783960f697b84
2024-01-05util/winutil: add some missing docs to restartmgr errorsAaron Klotz1-0/+5
Just a quick #cleanup. Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2024-01-05cmd/tailscaled, tsnet: don't return an interface containing a nil pointerAndrew Dunham2-2/+14
This tripped me up when I was testing something and wrote: if conn != nil { conn.Close() } In netstack mode, when an error occurred we were getting a non-nil error and a non-nil interface that contained a nil pointer. Instead, just return a nil interface value. Updates #cleanup Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Id9ef3dd24529e0e8c53adc60ed914c31fbb10cc4
2024-01-05ssh/tailssh: use a local error instead of gossh.ErrDenied (#10743)Andrew Lytvynov1-9/+13
ErrDenied was added in [our fork of x/crypto/ssh](https://github.com/golang/crypto/commit/acc6f8fe8d618cba34d44e89fdde304f98c576df) to short-circuit auth attempts once one fails. In the case of our callbacks, this error is returned when SSH policy check determines that a connection should not be allowed. Both `NoClientAuthCallback` and `PublicKeyHandler` check the policy and will fail anyway. The `fakePasswordHandler` returns true only if `NoClientAuthCallback` succeeds the policy check, so it checks it indirectly too. The difference here is that a client might attempt all 2-3 auth methods instead of just `none` but will fail to authenticate regardless. Updates #8593 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2024-01-05controlclient,tailcfg,types: expose MaxKeyDuration via localapi (#10401)James 'zofrex' Sanderson6-4/+18
Updates tailscale/corp#16016 Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2024-01-04net/interfaces: handle iOS network transitions (#10680)Andrea Gottardo3-15/+134
Updates #8022 Updates #6075 On iOS, we currently rely on delegated interface information to figure out the default route interface. The NetworkExtension framework in iOS seems to set the delegate interface only once, upon the *creation* of the VPN tunnel. If a network transition (e.g. from Wi-Fi to Cellular) happens while the tunnel is connected, it will be ignored and we will still try to set Wi-Fi as the default route because the delegated interface is not getting updated as connectivity transitions. Here we work around this on the Swift side with a NWPathMonitor instance that observes the interface name of the first currently satisfied network path. Our Swift code will call into `UpdateLastKnownDefaultRouteInterface`, so we can rely on that when it is set. If for any reason the Swift machinery didn't work and we don't get any updates, here we also have some fallback logic: we try finding a hardcoded Wi-Fi interface called en0. If en0 is down, we fall back to cellular (pdp_ip0) as a last resort. This doesn't handle all edge cases like USB-Ethernet adapters or multiple Ethernet interfaces, but it is good enough to ensure connectivity isn't broken. I tested this on iPhones and iPads running iOS 17.1 and it appears to work. Switching between different cellular plans on a dual SIM configuration also works (the interface name remains pdp_ip0). Signed-off-by: Andrea Gottardo <andrea@tailscale.com>
2024-01-04ipn/ipnlocal: refresh node key without blocking if cap enabled (#10529)James 'zofrex' Sanderson3-7/+35
Updates tailscale/corp#16016 Signed-off-by: James Sanderson <jsanderson@tailscale.com> Co-authored-by: Maisem Ali <maisem@tailscale.com>
2024-01-04cmd/containerboot: don't parse empty subnet routes (#10738)Irbe Krumina1-1/+1
Updates#cleanup Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2024-01-04cmd/containerboot: ensure that subnet routes can be unset. (#10734)Irbe Krumina2-11/+54
A Tailnet node can be told to stop advertise subnets by passing an empty string to --advertise-routes flag. Respect an explicitly passed empty value to TS_ROUTES env var so that users have a way to stop containerboot acting as a subnet router without recreating it. Distinguish between TS_ROUTES being unset and empty. Updates tailscale/tailscale#10708 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2024-01-03cmd/tailscaled: don't create a network monitor in the parent tailscaled on ↵Aaron Klotz1-9/+12
Windows The service is only used as a watchdog and for piping logs from the child process. We shouldn't be creating a network monitor in that case. Fixes #10732 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2024-01-03net/portmapper: check returned epoch from PMP and PCP protocolsAndrew Dunham2-3/+65
If the epoch that we see during a Probe is less than the existing epoch, it means that the gateway has either restarted or reset its configuration, and an existing mapping is no longer valid. Reset any saved mapping(s) if we detect this case so that a future createOrGetMapping will not attempt to re-use it. Updates #10597 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: Ie3cddaf625cb94a29885f7a1eeea25dbf6b97b47
2024-01-03wgengine/magicsock: fix typos in docs (#10729)Jordan Whited1-4/+4
Updates #cleanup Signed-off-by: Jordan Whited <jordan@tailscale.com>
2024-01-03tsweb: use object-src instead of plugin-types (#10719)Chris Palmer2-2/+2
plugin-types is deprecated, and setting object-src: 'none' is best practice. This should result in no functional change. Fixes #10718 Signed-off-by: Chris Palmer <cpalmer@tailscale.com>
2024-01-03logpolicy: use syspolicy to override LogTargetAdrian Dewhurst1-9/+3
Previously, for Windows clients only, a registry value named LogTarget could override the log server, but only if the environment variable was unset. To allow administrators to enforce using a particular log server, switch this to make the registry value take precedence over the environment variable, and switch to the newer syspolicy.GetString so that the log target can be specified by a GPO more easily. Updates ENG-2515 Change-Id: Ia618986b0e07715d7db4c6df170a24d511c904c9 Signed-off-by: Adrian Dewhurst <adrian@tailscale.com>
2024-01-02go.mod.sri: update SRI hash for go.mod changesFlakes Updater3-3/+3
Signed-off-by: Flakes Updater <noreply+flakes-updater@tailscale.com>
2024-01-03go.{mod,sum}: bump mkctr (#10722)Irbe Krumina2-18/+18
go get github.com/tailscale/mkctr@bf50773ba7349ced8de812c3d5437e8618bd4fa7 Updates tailscale/tailscale#9902 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
2024-01-03release: add shebang to the debian postinst scriptAnton Tolchanov1-0/+1
Seems like an omission, since we have it in postrm and prerm. Fixes #10705 Signed-off-by: Anton Tolchanov <anton@tailscale.com>
2024-01-02cmd/tailscale/cli: document usage more clearly (#10681)Chris Palmer1-1/+1
The IP argument is required; only the port is optional. Updates #10605 Signed-off-by: Chris Palmer <cpalmer@tailscale.com>
2023-12-22util/winutil: publicize existing functions for opening read-only connections ↵Aaron Klotz1-9/+9
to the Windows Service Control Manager We're going to need to access these from code outside winutil. Updates #10215 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
2023-12-21ipn/ipnlocal: fix data race with capForcedNetfilter fieldAndrew Dunham1-3/+6
Updates #cleanup Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I1fdad454198d7ea4a898dbff3062818b0db35167
2023-12-21all: cleanup unused code, part 2 (#10670)Andrew Lytvynov52-578/+115
And enable U1000 check in staticcheck. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-21net/netmon: fix goroutine leak in winMon if the monitor is never startedNick Khyl2-1/+30
When the portable Monitor creates a winMon via newOSMon, we register address and route change callbacks with Windows. Once a callback is hit, it starts a goroutine that attempts to send the event into messagec and returns. The newly started goroutine then blocks until it can send to the channel. However, if the monitor is never started and winMon.Receive is never called, the goroutines remain indefinitely blocked, leading to goroutine leaks and significant memory consumption in the tailscaled service process on Windows. Unlike the tailscaled subprocess, the service process creates but never starts a Monitor. This PR adds a check within the callbacks to confirm the monitor's active status, and exits immediately if the monitor hasn't started. Updates #9864 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2023-12-21safesocket: remove ConnectionStrategy (#10662)Andrew Lytvynov10-62/+16
This type seems to be a migration shim for TCP tailscaled sockets (instead of unix/windows pipes). The `port` field was never set, so it was effectively used as a string (`path` field). Remove the whole type and simplify call sites to pass the socket path directly to `safesocket.Connect`. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-20all: cleanup unused code, part 1 (#10661)Andrew Lytvynov26-274/+81
Run `staticcheck` with `U1000` to find unused code. This cleans up about a half of it. I'll do the other half separately to keep PRs manageable. Updates #cleanup Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-20net/portmapper: add logs about obtained mapping(s)Andrew Dunham4-1/+69
This logs additional information about what mapping(s) are obtained during the creation process, including whether we return an existing cached mapping. Updates #10597 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I9ff25071f064c91691db9ab0b9365ccc5f948d6e
2023-12-20api.md: add docs for setting an IP addressDavid Crawshaw1-1/+48
Updates tailscale/corp#16453 Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2023-12-20net/interfaces: better handle multiple interfaces in LikelyHomeRouterIPAndrew Dunham6-25/+83
Currently, we get the "likely home router" gateway IP and then iterate through all IPs for all interfaces trying to match IPs to determine the source IP. However, on many platforms we know what interface the gateway is through, and thus we don't need to iterate through all interfaces checking IPs. Instead, use the IP address of the associated interface. This better handles the case where we have multiple interfaces on a system all connected to the same gateway, and where the first interface that we visit (as iterated by ForeachInterfaceAddress) isn't also the default internet route. Updates #8992 Signed-off-by: Andrew Dunham <andrew@du.nham.ca> Change-Id: I8632f577f1136930f4ec60c76376527a19a47d1f
2023-12-20ipn: remove use of reflect.MethodByName (#10652)Andrew Lytvynov1-5/+13
Using reflect.MethodByName disables some linked deadcode optimizations and makes our binaries much bigger. Difference before/after this commit: ``` -rwxr-xr-x 1 awly awly 30M Dec 19 15:28 tailscaled.after* -rwxr-xr-x 1 awly awly 43M Dec 19 15:27 tailscaled.before* ``` Fixes #10627 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
2023-12-20net/netutil: add function to check rp_filter value (#5703)Andrew Dunham2-0/+128
Updates #4432 Change-Id: Ifc332a5747fc1feffdbb87437308cf8ecb21b0b0 Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
2023-12-19api.md: add device.postureIdentity fieldPaul Scott1-0/+10
Updates tailscale/corp#15445 Signed-off-by: Paul Scott <paul@tailscale.com>
2023-12-19client/tailscale: add Device.PostureIdentity fieldPaul Scott1-0/+11
New API fields being added in tailscale/corp#15445. Updates tailscale/corp#15203 Signed-off-by: Paul Scott <paul@tailscale.com>
2023-12-19tool/gocross: make all Windows DLLs build with static libgccNick Khyl1-0/+1
In this commit, we have updated the build process for our Windows DLLs to link statically with libgcc, ensuring our Windows DLLs are self-contained. Updates #10617 Signed-off-by: Nick Khyl <nickk@tailscale.com>
2023-12-19appc,ipn: prevent undesirable route advertisementsJames Tucker3-11/+64
Individual route advertisements that are covered by existing routes are no longer advertised. If an upstream returns 0.0.0.0, 127.x, and other common unwanted addresses those are also rejected. Updates #16425 Signed-off-by: James Tucker <james@tailscale.com>