Files
tailscale/ipn
Kabir Sikand 32d3a7ff10 ipn/ipnlocal: add authenticated funnel session cookie and allowlist
Add the self-contained, security-sensitive primitives for the
authenticated Funnel gate: a stateless AEAD-sealed session cookie and
the allowlist evaluator. No gate wiring yet; this is exercised only by
its unit tests until the gate lands next.

The cookie is sealed with AES-256-GCM under a key derived via HKDF-SHA256
from the node's machine private key, salted by profile ID. The key is
therefore per-node and per-profile, survives restart, and never leaves
the device, so no new persisted secret is introduced. The funnel FQDN is
used as the AEAD additional data, binding a cookie to the host that
minted it and preventing cross-host replay. The same construction seals
the short-lived OIDC login state (original URL + PKCE verifier + CSRF).

The allowlist matches exact emails, "*@domain" (only with a verified,
real email domain, per the cross-repo contract), and "tailnet:" entries;
an empty allowlist admits any authenticated Tailscale user.

Updates tailscale/corp#38806

Change-Id: I4428e54be94614c0a94f8f1532f07336363fefa8
Signed-off-by: Kabir Sikand <[email protected]>
2026-07-27 19:17:22 +00:00
..