headscale/hscontrol/policy/v2
Kristoffer Dalby c7a0ca709f policy: surface exit nodes via autogroup:internet (#3212)
compileFilterRules skipped autogroup:internet destinations to keep them
out of the wire-format PacketFilter, but those same compiled rules are
the source of pm.matchers — and Node.CanAccess relies on a matcher whose
DestsIsTheInternet covers the public internet to surface exit-node peers
to ACL sources. With the skip in place no such matcher existed, exit
nodes silently dropped out of the source's peer list, and the docs'
exit-node walkthrough stopped working: `tailscale exit-node list`
returned "no exit nodes found" and `tailscale set --exit-node=<ip>`
returned "no node found in netmap with IP".

Drop the compile-time skip so autogroup:internet flows through normal
matcher derivation, and teach ReduceFilterRules to keep the resulting
client packet-filter rule on exit-route advertisers — Tailscale SaaS
sends those rules to exit nodes so the kernel filter accepts traffic
forwarded by autogroup:internet sources.

Verified against a live tailnet on 2026-04-28 via tscap; the b17/b18
captures land under testdata/issue_3212/ as a regression guard. The
captures are isolated from testdata/routes_results/ because the broader
TestRoutesCompat machinery assumes a CIDR-prefix wire format that
differs from the IPSet-range form SaaS emits for autogroup:internet —
aligning that wire format is tracked separately.

Fixes #3212
2026-04-29 11:24:33 +01:00
..
testdata policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
compiled.go policy/v2: fix empty grants/acls returning FilterAllowAll 2026-04-29 08:55:07 +01:00
filter.go policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
filter_test.go policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
issue_3212_test.go policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
main_test.go all: fix test flakiness and improve test infrastructure 2026-03-14 02:52:28 -07:00
policy.go policy/v2: fix empty grants/acls returning FilterAllowAll 2026-04-29 08:55:07 +01:00
policy_test.go policy: surface exit nodes via autogroup:internet (#3212) 2026-04-29 11:24:33 +01:00
tailscale_acl_data_compat_test.go policy/v2: overhaul compat test infrastructure 2026-04-17 16:31:49 +01:00
tailscale_grants_compat_test.go policy/v2: overhaul compat test infrastructure 2026-04-17 16:31:49 +01:00
tailscale_routes_data_compat_test.go policy/v2: overhaul compat test infrastructure 2026-04-17 16:31:49 +01:00
tailscale_ssh_data_compat_test.go policy/v2: overhaul compat test infrastructure 2026-04-17 16:31:49 +01:00
types.go Update links to Tailscale documentation 2026-04-18 09:33:41 +02:00
types_test.go policy/v2: fix empty grants/acls returning FilterAllowAll 2026-04-29 08:55:07 +01:00
utils.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00
utils_test.go policy/v2: exclude exit routes from ReduceFilterRules 2026-04-01 14:10:42 +01:00