Support mixed protocol (IPv6 -> IPv4) PROXY headers in multiplexer #39205
Labels
c-dd
Internal Customer Reference
feature-request
Used for new features in Teleport, improvements to current should be #enhancements
ipv6
networking
Network connectivity features/problems
tls-routing
Issues related to TLS routing
What would you like Teleport to do?
Support an IPv6 source header connecting to an IPv4 target as part of PROXY protocol headers.
Currently, when traffic ingresses to Teleport via an IPv6 source address (for example an IPv6-capable host connecting to an proxied IPv6 edge POP on Cloudflare) but the Teleport server only accepts connections on an IPv4 address (such the Teleport origin being on a home connection without IPv6 support), Teleport rejects the connection:
This appears to be related to the content of the
X-Forwarded-For
header and happens whenproxy_service.trust_x_forwarded_for
is set totrue
- which is needed to have accurate client source IPs in audit logs and for IP pinning.What problem does this solve?
Now that Teleport supports pure websocket connection upgrades (introduced in v15.1.0 by #36343) it will become more common to use Cloudflare's free DNS proxying service to expose Teleport servers more securely. Cloudflare always serves IPv6 records on its free tier and this cannot be disabled due to an ideological stance on their end. It will still be more common than not to have this traffic directed to IPv4-only Teleport servers.
If a workaround exists, please include it.
Cloudflare provides a method called "Pseudo IPv4" which rewrites the
X-Forwarded-For
header to a Class E IPv4 address instead: https://developers.cloudflare.com/network/pseudo-ipv4/Enabling the Pseudo IPv4 "Overwrite Headers" option under the "Network" settings for a Cloudflare domain causes Cloudflare to send the
X-Forwarded-For
address as a 250.x.x.x address instead of the actual IPv6 address. This does enable connectivity by meaning that the multiplexer won't reject IPv6 -> IPv4 PROXY protocol headers, but unfortunately makes the source IP for connections inaccurate.The text was updated successfully, but these errors were encountered: