Skip to content

Feature req: Spoof original source IP on internal connection #179

@Steltek

Description

@Steltek

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.
  1. TCP packet from client IP to 'internalserver.domain.com': src IP 8.8.8.8, dst IP 80.80.80.80 port 443
  2. sniproxy opens an internal connection (on internal interface): src IP 8.8.8.8, dst IP 10.0.0.2 port 8443
  3. Internal webserver responds: src IP 10.0.0.2, port 8443, dst IP 8.8.8.8
  4. Packet arrives on GW which uses rule to redirect traffic from internal port 8443 to sniproxy
  5. 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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions