Commit Graph
533 Commits
Author SHA1 Message Date
Kristoffer Dalby 017ab6b219 derp: skip DERP map sources that fail to load
Warn and start on what loaded; abort only if the served map, policy
derpMap included, has no region. Refresh still keeps the old map.

Fixes #3142
2026-11-06 14:03:08 +01:00
Kristoffer Dalby 059b95bacc db: reject pre-0.23 databases by their machines table
Missing, empty or InitSchema-stamped migrations tables all hid them.
Error follows the one-minor-at-a-time upgrade path.

Fixes #3648
2026-11-06 10:04:31 +01:00
Kristoffer Dalby 0bdc332886 CHANGELOG: note app grants and exit nodes 2026-11-05 17:23:53 +01:00
Kristoffer Dalby 49ddd3d412 docs: describe update-client as Tailscale answers it
auto_update.enabled reaches only nodes with no stored setting.

Updates #3629
2026-11-05 15:51:04 +01:00
Martín Gómez c660713a7c CHANGELOG: link the update-client pull request 2026-11-05 15:51:04 +01:00
Martín Gómez f203c003eb docs: document updating clients remotely 2026-11-05 15:51:04 +01:00
Kristoffer Dalby 6f2c7fbe7d derp: check derp.paths and derp.urls regions like a policy derpMap
Clients count latency by RegionID, so a key mismatch picks a missing home.

Updates #2918
2026-11-05 14:11:33 +01:00
Kristoffer Dalby 1a635e7d08 docs: document the policy derpMap
Updates #2918
2026-11-05 14:11:33 +01:00
Kristoffer Dalby e358a539af derp: reject unknown keys in derp.paths files
SaaS rejects them in a policy derpMap; a misspelt key silently did nothing.

Updates #2918
2026-11-05 14:11:33 +01:00
Kristoffer Dalby 00f9373246 docs: document DERP region scores
Updates #2918
2026-11-05 14:11:33 +01:00
Kristoffer Dalby b20d37289e policy/v2: check SSH user destinations as Tailscale does
A user dst needs every source to be that user; groups count by their
members. Tags and autogroup:tagged reach neither user dsts nor self.

Updates #3335
2026-11-05 13:43:48 +01:00
Kristoffer Dalby 36ea8d9e81 policy/v2: refuse autogroup:member as SSH destination
Tailscale answers invalid dst "autogroup:member" for every source.

Updates #3335
2026-11-05 13:43:48 +01:00
Kristoffer Dalby e93046aa68 policy/v2: word SSH rule errors as Tailscale does
Check src and dst kinds in validate, not in JSON decoding, so they
get the label. Texts from SaaS acl/validate answers.

Updates #3335
2026-11-05 13:43:48 +01:00
Kristoffer Dalby 87b110b335 policy/v2: label SSH rule errors once with [ssh]
Wrap in the SSH loop, so shared tag and group checks get it too.
Tailscale's marker; replaces the per-message ssh: prefix.

Fixes #3335
2026-11-05 13:43:48 +01:00
Jemanuel f8d3703a80 policy: prefix all SSH validation errors with "ssh" 2026-11-05 13:43:48 +01:00
Kristoffer Dalby f32fc9f14a api/v2: refuse expirySeconds outside 0 to 90 days
Matches SaaS status and text.
2026-11-05 12:41:50 +01:00
Kristoffer Dalby f1382e4322 api/v2: accept an auth key create without tags
SaaS takes it; huma marked the field required (422).
2026-11-05 12:41:50 +01:00
Kristoffer Dalby 1a32d031bf api/v1: report a pre-auth key without expiration as null
Zero time read as expired; API keys and 0.29 already emit null.
2026-11-05 12:41:50 +01:00
Seena Fallah 92bc0b6226 api/v1: persist omitted key expiration as NULL, not zero time
CreateAPIKey and CreatePreAuthKey declared a zero-valued time.Time and
passed its address to the state layer, so a request that omitted the
expiration persisted 0001-01-01 instead of NULL. Both key types were
then rejected as already-expired on first use. Pass the request body's
*time.Time straight through (nil when omitted).

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
2026-11-05 12:41:50 +01:00
Kristoffer Dalby 459b157c3b docs: note the posture attributes endpoint and its proxy setting
trusted_proxies now feeds a stored, API-visible address, not only logs.

Updates #2272
2026-11-05 12:38:53 +01:00
Kristoffer Dalby 9fa176b211 CHANGELOG: note the SaaS filter form 2026-11-05 12:32:04 +01:00
Kristoffer Dalby 1b53713e05 CHANGELOG: name the via exit fix #3566 still makes
Updates #3562
2026-11-05 12:32:04 +01:00
mineiwik 6a1f8d1579 policy/v2: keep via exit routes when two via grants match a viewer 2026-11-05 12:32:04 +01:00
Kristoffer Dalby 5651bf4c5c hscontrol: leave reverse DNS for the Tailscale ranges to the client
SaaS sends no reverse routes for any ipPool; clients from v1.84 add
them for 100.64.0.0/10 and fd7a:115c:a1e0::/48 themselves.

Updates #3482
2026-11-04 16:25:09 +01:00
Michael Gooden 8f49f4713d CHANGELOG: Note the octet-aligned MagicDNS search domain generation fix
Updates #3482
2026-11-04 16:25:09 +01:00
Kristoffer Dalby 9bed1e0353 CHANGELOG: note the SaaS compatibility fixes 2026-11-03 17:05:00 +01:00
Kristoffer Dalby 6fe0df64e1 CHANGELOG: note the map field changes
Updates #3626
2026-11-03 16:29:03 +01:00
Kristoffer Dalby 1986b52983 CHANGELOG: note via applying only to the ip part of a grant
Updates #3626
2026-11-03 15:53:04 +01:00
Kristoffer Dalby 8b41925a1f nix: support systemctl reload in the headscale service
Fixes #3027

Claude-Session: https://claude.ai/code/session_01RHEZM1qJ2hgndiXio7P56h
2026-11-03 15:52:52 +01:00
Kristoffer Dalby b3ffec4269 hscontrol: reload manual TLS certificate on SIGHUP
Files that fail to load or are not valid now keep the previous certificate.

Fixes #3027

Claude-Session: https://claude.ai/code/session_01RHEZM1qJ2hgndiXio7P56h
2026-11-03 15:52:52 +01:00
Igor Serganov d0e10f2d46 util: read .json files as HuJSON in UnmarshalByExt (#3634)
dns.extra_records_path and derp.paths files ending in .json were decoded
with encoding/json, so a comment or trailing comma in otherwise valid
JSON made headscale refuse to load the file. Policy files already accept
HuJSON regardless of extension. HuJSON is a superset of JSON, so
standardizing .json input the same way as .hujson keeps every valid JSON
file decoding exactly as before.

Add tests for comments and trailing commas in extra records, in generic
.json decoding and in ACL policies, and for comment markers inside
string values.

Fixes #3627
2026-11-02 20:35:24 +01:00
Michael Lopez 42a97be25f state: validate the new name and refuse OIDC users in RenameUser (#3642)
State.RenameUser went through UpdateUser and skipped the checks
db.RenameUser applies, so the API could rename an OIDC user, whose
name the identity provider owns, or rename any user to an invalid
name. Apply both checks in the update function and map the username
validation errors to 400.
2026-11-02 20:22:23 +01:00
Kristoffer Dalby 697eff7474 CHANGELOG: enumerate policy, lifetime and API compatibility breaks 2026-11-02 19:15:40 +01:00
Kristoffer Dalby 7721d8c299 hscontrol: keep a re-keyed node from its stale ephemeral GC timer
Re-registering with a permanent key left the timer armed, and the poll
path only cancels for ephemeral nodes. Recheck when the timer fires.
2026-10-30 17:05:36 +01:00
Igor SerganovandClaude Opus 5.5 1ff8e368b6 hscontrol: arm ephemeral GC when a node registers with an auth key
The ephemeral garbage collector was only armed when a long-poll
session ended, or for every ephemeral node at startup. A client that
registered and went away before its first long-poll reached Connect,
for example a pod killed right after login, never ended a session,
so no deletion timer was armed. The node then stayed until headscale
restarted, well past node.ephemeral.inactivity_timeout.

Schedule the GC right after the auth-key registration, before the
error check: a failed policy refresh still returns the saved node. The
existing Cancel in serveLongPoll stops the timer once the node
connects. A timer that fires while a session is live is still skipped
by the ActiveSessions check.

TestEphemeralGCDoesNotDeleteReconnectedNode now checks that
registration arms the timer and cancels it before replaying its
sessions. Otherwise the 50ms timer could fire while the test's Connect
was still waiting for a NodeStore flush.

TestFailedReconnectDoesNotCancelEphemeralGC and
TestDeleteNodeCancelsEphemeralGC ran with a zero inactivity timeout,
so the registration timer deleted the node at once, and the delete
cancelled the timer the tests armed themselves. They now use 5s, which
outlasts the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 17:05:36 +01:00
Kristoffer Dalby 8e45958341 CHANGELOG: align the 0.29.x sections with the releases
0.29.7 now matches what ships; 0.30.0 drops entries 0.29.7 already
released. #3398 never shipped in 0.29.3, #3236 missed 0.29.0.
2026-10-30 10:35:22 +01:00
Kristoffer Dalby c0925962c2 hscontrol: bound pending authentication without evicting sessions 2026-10-29 20:51:50 +01:00
Kristoffer Dalby a9508935b9 CHANGELOG: document SSH acceptEnv fix
Updates #3559
2026-10-29 20:51:36 +01:00
Kristoffer Dalby c285eff776 CHANGELOG: list the oss-scanner findings for 0.29.7
Move the #3603 entries to 0.29.7 and link the pull request.
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 208043c88d oidc: keep email_verified with the address it came with
Fixes ANT-2026-MX8FKG4K
2026-10-29 14:00:02 +01:00
Kristoffer Dalby b5bebf9b32 db, state: let only the delete that removed a node free its addresses
Fixes ANT-2026-NWTIBB02
2026-10-29 14:00:02 +01:00
Kristoffer Dalby c9e9f72857 state: drop registration locks once unused
The lock is taken before any credential check, so client-chosen machine
keys grew the map forever. Ref-count entries; delete at zero.

Fixes ANT-2026-ZC18AF82
2026-10-29 14:00:02 +01:00
Kristoffer Dalby b833be283c types, auth, noise: let one request wait on each auth session
One verdict per session, so one waiter: the newest. A displaced one
returns at once (register error, SSH re-delegate), not at session end.
A waiter keeps only the follow-up URL and the cached registration.

Fixes ANT-2026-NM50ZP4N
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 7892a8462c auth: check the follow-up's machine key before it waits
A session has one verdict; another machine holding the URL could take
it.

Fixes ANT-2026-NM50ZP4N
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 28959cb27c noise: time out stalled bodies and idle tunnels
The hijack drops the outer server's deadlines; any machine key gets a
tunnel.

Fixes ANT-2026-K903ZEUA
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 5a4d366ce1 auth, state: keep only hostname, OS and tags in pending registrations
The rest arrives with the first MapRequest. A relogin keeps the node's
current Hostinfo, endpoints and disco key; an oversized merge is a 400.

Fixes ANT-2026-RQS7JAPP
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 4ce928411e state: bound client reports of nodes loaded at startup
Rows stored before the bounds are trimmed the same way at load; a
Hostinfo still over budget is dropped until the node reports again.

Fixes ANT-2026-RQS7JAPP
Fixes ANT-2026-5B6KE87K
Fixes ANT-2026-KFCFFM34
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 2e563635d0 types, noise: bound the Hostinfo and endpoints a client reports
Keep the first 256 endpoints and 4096 routes; refuse longer hostnames,
too many tags, zoned endpoints and >64 KiB NetInfo or other Hostinfo.
The body limit counted wire bytes, not what NodeStore and peers keep.

Fixes ANT-2026-RQS7JAPP
Fixes ANT-2026-5B6KE87K
Fixes ANT-2026-KFCFFM34
2026-10-29 14:00:02 +01:00
Kristoffer Dalby 15a8c7584e hscontrol: refuse a key expiry that cannot be encoded
handleRegister, the OIDC auth path and SetNodeExpiry refuse it. Expiries
are stored in UTC, which SQLite can read back, and loaded in UTC, as
PostgreSQL returns the server's zone. The v1 API answers 400.

Fixes ANT-2026-QMCAFJ1Q
2026-10-29 14:00:02 +01:00
Kristoffer Dalby e3c1bfd68e mapper: skip peers whose key expiry cannot be encoded
json.Marshal refuses a year outside [0,9999], so one stored expiry
failed every map with that node. TailNode and key patches send UTC, the
builder drops what fails and the boot scan names the node.

Fixes ANT-2026-QMCAFJ1Q
2026-10-29 14:00:02 +01:00