Some Bits: Nelson's log

Tailscale key expiry

I had my first real problem with Tailscale. Not coincidentally, six months after first using and loving it. Tailscale expires keys every 180 days and you have to manually re-authenticate every single host. This is the first bad user experience I’ve had with Tailscale, the product is usually much friendlier.

I got no notice that this expiration was coming. And it’s potentially catastrophic; what if your host is unreachable except via Tailscale? (See below). I don’t use Tailscale a lot and I don’t have any proper monitoring. Maybe if I were paying closer attention I’d have known it was coming?

The rest of this note is a little ranty because I’m experiencing the indignation of a sharp corner on an otherwise very nicely designed product. Tailscale folks, I love your product. This part of it needs some attention. To be fair, key management and updates are a hard problem in all of software, Tailscale is not unusual.

How to update Tailscale key

Re-authenticating isn’t hard with the CLI: just run tailscale up --force-reauth. This gives you a URL that you load in a browser logged in to Tailscale’s management console. It’s a remarkably manual process. The Android GUI client is a little easier; you’re prompted to log in directly on the device itself.

But here’s the shit sandwich: “tailscale up --force-reauth currently involves bringing down the Tailscale connection and thus should not be done remotely over SSH or RDP.” Can confirm; I tried to update a remote host via ssh over Tailscale and the update hung before I saw the authentication URL. A terrible experience for a networking product whose major purpose is remote administration of machines. And the auth process is interactive, you can’t just fire it off in a cron job or something. (There’s a hint that maybe there’s a “Reauthenticate” option in the dashboard after a machine “has already signed a new authentication URL” but I no longer have an expired host to test that with.)

I do give the product team credit, they did think about the “what if I can’t access the host to update it?” problem. There’s a button you can press to temporarily enable an expired key (for 30 minutes), giving you access. You still have the “how do you update remotely” problem but at least you can get to the host.

There may be a better way to do all this; you can generate auth keys and automate using them. Maybe a more serious Tailscale deployment is managed that way, I haven’t looked into it. The default keys are a great user experience right until they expire.

Determining Tailscale key status

The software tools for detecting whether your Tailscale key is expired are not good. The best tool is the Machines dashboard; this does have a status line and you can filter for expired machines.

On a host with an expired key your first clue that something isn’t working is probably when you can’t access other hosts on the Tailnet. tailscale status reports a confusing message, “Health check: not connected to home DERP region 12. Logged out.”. If you try tailscale up it will prompt you to reauthenticate and afterwards tailscale status will keep showing you the auth URL until you reauth.

On a working connected host elsewhere on a tailnet tailscale status does not show you if another host has an expired key. The status shown is - which I think means “unknown”. It’s not offline or some special expired status. tailscale ping will report peer's node key has expired.

I could not find a way to see what machines were soon to be expired in the machine dashboard; the keys page doesn’t show the automatic keys that the default path uses. The command line tools don’t seem to tell you either, or at least I can’t find it. I guess you can periodically tailscale up --force-auth to refresh the keys but it’s up to you to know when to do that? Again, I assume using managed auth keys is the real solution for this.

Why expire at all?

I don’t quite understand why Tailscale expires host keys at all. There’s a general idea that expiring logins, etc is good security practice to solve various corner cases like a years-old server that gets recycled or is running an old insecure version. Sorta? But for that kind of thing I much prefer a system where an old auth token is only expired if it has not been used for awhile; expiring something that was trusted just minutes ago seems like a bad decision.

It’s possible to disable key expiration for specific hosts via the machines dashboard. The docs suggest this is for “trusted servers, subnet routers, or remote IoT devices that are hard to reach.” There’s no way to disable expiration for a whole tailnet; all you can do is set the expiration time from 1 to 180 days.

Windows update

This isn’t about key expiration really, but the Windows client still has no auto-updater. I was still running 1.30 with a security hole! They’re working on it (and recently changed the installer they use) but it doesn’t seem a high priority. Installing an update is easy enough but it really needs to be automatic.