Bug 434896

Summary: Hack for proxy pass through to get real client IP address
Product: [Community] Bugzilla Reporter: David Lawrence <dkl>
Component: Bugzilla GeneralAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 3.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://en.wikipedia.org/wiki/X-Forwarded-For
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-26 04:23:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to pass through real client IP address when going through a proxy none

Description David Lawrence 2008-02-26 04:13:27 UTC
# HACK FOR PROXY PASS-THROUGH
# If client if one of the proxy servers then we try to use the
# HTTP_X_FORWARDED_FOR address as the client's real address
my %rx = (
    proxy_ip         => qr/^10\.8\.2\.15\d$/,
    last_ip_in_chain => qr/([^,\s]+)$/,
);
if (i_am_cgi() && $ENV{REMOTE_ADDR} =~ $rx{proxy_ip}) {
    $ENV{REMOTE_ADDR} = $ENV{HTTP_X_FORWARDED_FOR} =~ $rx{last_ip_in_chain}
}

Comment 1 David Lawrence 2008-02-26 04:13:27 UTC
Created attachment 295869 [details]
Patch to pass through real client IP address when going through a proxy