Skip to content
Cloud · Secret guide

Leaked Tailscale auth key: what to do in the first hour

Critical severityDetected onlyLast verified · 4 min read

A Tailscale auth key lets a new machine join your tailnet, the private network that links your devices and servers. Whoever holds an unused auth key can add their own device to that network and reach whatever it can reach: internal services, databases and admin pages that are not on the public internet. That makes a leaked auth key one of the more serious secrets in this list, even though it looks harmless at a glance. Revoke it first, then look at the machines that joined.

Check your GitHub account for leaked secrets — free

Provider
Tailscale
Severity
Critical
Impact
Cloud infrastructure access
Checked live by LeakWatch
No

What a Tailscale auth key looks like

Tailscale auth keys start with a fixed prefix that marks them as auth keys, followed by a short identifier, a control marker and a random tail. The shape is distinctive, so the value is easy to recognise in a file:

tskey-auth-…CNTRL-…   Tailscale auth key (masked)

Keys are generated in the admin console and can be reusable or single-use, tagged, ephemeral or pre-approved, depending on the options chosen. Each key has an expiry of up to 90 days. Scripts often store a key in an environment variable so that a server or container can join the network when it boots, and that is where many of them are exposed.

How Tailscale auth keys get leaked

  • Provisioning scripts committed to a repository. A cloud-init file, Terraform configuration or Ansible variable that contains a reusable key.
  • Container images. A key baked into a Dockerfile or an image layer, which is then pushed to a registry that others can read.
  • Startup scripts in shared templates. A virtual machine template or snippet shared with a team or posted publicly, with the key still in it.
  • CI logs. A pipeline step that prints the command it runs, including the key passed as an argument.
  • Chat and tickets. A key pasted into a message to help a colleague bring up a device.

What to do in the first hour

  1. Revoke the key. Open the account settings, find the Keys page, locate the key in the table and select Revoke. Revoking stops it from being used to register new machines. Do this before anything else.
  2. Check the machines. Revoking the key does not remove machines that already joined with it. Open the Machines page and look for devices you do not recognise, especially ones added since the exposure began. Tailscale’s documentation says you must delete those machines separately.
  3. Review the logs. Look at the audit and configuration logs for key creation, machine approval and access-control changes during the exposure window.
  4. Review access rules. Check the access controls for the machines that were added. A new device with broad access is the real risk, so tighten rules until you know what happened.
  5. Replace the key properly. Create a new key with a short expiry, a description and the smallest set of tags needed. Use one-off or ephemeral keys wherever a device only joins once.
  6. Clean the repository and images. Remove the key from files, rebuild images without it and check the logs. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same script or image? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Tailscale

Go to the account settings of your tailnet, open the Keys page and select Revoke next to the auth key. Revoking the key does not deauthorize devices that already used it, so delete any unknown machine from the Machines page as well. Only an owner, admin, IT admin or network admin can revoke keys, and in Tailscale’s model you can revoke only the keys you generated yourself. If the key was created by someone else, ask that person or an admin to revoke it. Keys that expire or are revoked remain visible for a while, which helps with the audit.

How LeakWatch detects it

The rule is called “Tailscale Auth Key”. It looks for the fixed auth-key prefix, a short identifier, the control marker and the random tail, with word boundaries on both sides. No surrounding text is needed, because the format is distinctive. The severity is critical. This type is not checked live: LeakWatch does not try to register a device with the value, so a hit means the key was present in the scanned content and may still be valid until its expiry.

LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

FAQ

Does an expired key still matter?

An expired key cannot register new devices, but any device it joined stays authorized until its own node key expires. Check the machines list even when the key has expired.

Why is a one-off key safer?

A one-off key is revoked automatically after its first use, so a copy taken later cannot be used. Reusable keys stay valid for every registration until they expire or are revoked.

Can I rotate keys automatically?

Tailscale suggests creating keys programmatically through an OAuth client, so that automation gets short-lived keys without a long-lived value in a file. Check Tailscale’s current documentation before you set that up.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Tailscale.