* cmd/k8s-proxy,ipn/ipnlocal,k8s-operator/api-proxy: drop PROXY protocol
The API server proxy in cmd/k8s-proxy took the caller's address from the
PROXY protocol header on its localhost listener, which any local process
could write. This fixes this by removing the header from both sides, and
making serve register each non-Funnel TCP forward to a loopback address
with the proxy mapper (as netstack does), so WhoIs on the connection's
real remote address returns the caller.
Updates tailscale/corp#48697
Thank you Winfunc for reporting
* ipn/ipnlocal,k8s-operator/api-proxy: add WhoIs and forged header tests
Adds a test that WhoIs on the backend side of a serve TCP forward returns
the source node while the forward is open and fails after it closes, for
IPv4, IPv6 and localhost targets, and that a Funnel flow or a backend on
a non-loopback address gets no node. Also adds a test that the API server
proxy's plain HTTP listener does not take the caller from a PROXY header
that a local client writes.
Updates tailscale/corp#48697
---------
Change-Id: I9bd203355c68eb0e9f62755dbea908d7d5435105
(cherry picked from commit 65114d4eba)
Signed-off-by: chaosinthecrd <[email protected]>
Co-authored-by: Tom Meadows <[email protected]>