-
Notifications
You must be signed in to change notification settings - Fork 409
Description
Rather than try to pass the source IP via a header (which isn't possible without decrypting and mangling the HTTPS traffic), would it be possible to add an option to have sniproxy spoof the original source IP on the internal requests? That way, the target server could see the source IP.
(Of course, the user installing sniproxy would have to ensure it is 'in-path', i.e. all return traffic from the internal server gets funneled back to sniproxy for processing, and the OS allows for such spoofing.)
Example:
Client IP: 8.8.8.8
Gateway external IP: 80.80.80.80 (internalserver.domain.com)
Gateway internal IP: 10.0.0.1
Internal webserver IP: 10.0.0.2
- sniproxy installed on gateway.
- TCP packet from client IP to 'internalserver.domain.com': src IP 8.8.8.8, dst IP 80.80.80.80 port 443
- sniproxy opens an internal connection (on internal interface): src IP 8.8.8.8, dst IP 10.0.0.2 port 8443
- Internal webserver responds: src IP 10.0.0.2, port 8443, dst IP 8.8.8.8
- Packet arrives on GW which uses rule to redirect traffic from internal port 8443 to sniproxy
- sniproxy sends response to Client via external interface: src IP 80.80.80.80 port 443, dst IP 8.8.8.8
-> The server thinks it is talking to 8.8.8.8 but in reality has all its return traffic intercepted by the gateway and sent to sniproxy instead.
References: haproxy's transparent mode:
http://blog.haproxy.com/2011/08/03/layer-7-load-balancing-transparent-proxy-mode
http://blog.haproxy.com/2012/06/05/preserve-source-ip-address-despite-reverse-proxies/