mirror of
https://github.com/tailscale/tailscale.git
synced 2026-12-03 07:02:33 -08:00
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]>