This document defines an HTTP extension header field that allows proxy components to disclose information lost in the proxying process, for example, the originating IP address of a request or IP address of the proxy on the user-agent-facing interface. In a path of proxying components, this makes it possible to arrange it so that each subsequent component will have access to, for example, all IP addresses used in the chain of proxied HTTP requests. This document also specifies guidelines for a proxy administrator to anonymize the origin of a request.
βAs a long time IR guy, this is an evergreen reminder.
Year after year, engagement after engagement.
@eric_capuano Reminder that this has to be configured in 3 places: Load balancer, web server, log aggregation tool (SIEM).
And, the header is not always called X-Forwarded-For. Depends on the load balancer setup. Then, the web server needs to be configured to log the header, and you SIEM needs to understand how to ingest the header.
You want to log both IPs: (1) the X-Forwarded-For IP of the "real client", and (2), the IP that accessed the web server directly. The value of collecting the "direct IP" is that it will tell you if the client connected via your load balancer or if they bypassed the load balancer. If you skip the "direct IP" then your logs will have no IP address at all when someone bypasses your load balancer, and that's a real bummer.
But, yeah, holy cow, the sadness of not having real client IPs in your logs is intense.