Artica Wiki

HotLogs — Client address from X-Forwarded-For

Show the real client address from X-Forwarded-For in HotLogs when the reverse proxy sits behind a trusted front proxy.

« Back to HotLogs

Client address from X-Forwarded-For is a HotLogs option for reverse proxies that sit behind another proxy: 
a load balancer, a CDN, a cloud WAF, or a front Nginx that terminates IPv6.

In that layout every request reaches the Artica reverse proxy from the same address — the front proxy's. 
Without the option, HotLogs shows that single address on every line, and the Source IP filter and the Top source IPs chart become useless.
With the option enabled, HotLogs shows the real client address that the front proxy recorded in the X-Forwarded-For header.

The problem it solves

The real-time views of the reverse proxy already take the
 X-Forwarded-For header into account, so they display the client addresses. 

Benefits

Use cases

When NOT to enable it

Any client can send an X-Forwarded-For header with any value. 
The header can only be trusted when it was written by your own front proxy.

How HotLogs picks the client address

A proxy appends the address it received the connection from to the X-Forwarded-For header. Everything written before that last entry comes from the client itself and may be forged. HotLogs therefore uses the last entry of the header:

X-Forwarded-For received by Artica Source IP shown by HotLogs (option ON) Why
2001:db8:4::17 2001:db8:4::17 The single entry written by the front proxy.
198.51.100.66, 2001:db8:4::17 2001:db8:4::17 The first entry was sent by the client and is ignored; 
the last one was added by the front proxy.
2001:db8:4::17, unknown Front proxy address The last entry is not an IP address. 
HotLogs never falls back to an entry the client could have forged.
(no header) Front proxy address Nothing to use: 
the connection address is kept.

The option applies to the Source IP column, the CSV export, the Source IP filter and the charts of the report. 
A search whose Source IP filter is the front proxy's address still matches its lines.

Only one front proxy is supported. If the traffic crosses several proxies, the last entry is the address seen by the last one, which may be the previous proxy rather than the client.

Enabling the option

  1. Open Web Services > Monitoring > HotLogs and click Parameters in the page header.

HotLogs page header with the Parameters button

  1. The Parameters dialog shows the option Client address from X-Forwarded-For, disabled by default (Inactive).

Parameters dialog, option inactive

  1. Click the switch. 
    The option turns Active and is saved immediately: 
    there is no Apply button, and the dialog closes by itself.

Parameters dialog, option active

  1. Run a new search, or re-run an existing one. 
    The Source IP column now shows the client addresses. 
    No restart is needed: the option is read each time a search starts.

To go back to the connection addresses, open Parameters again and click the switch to turn the option off.

If the Parameters button is missing from the HotLogs page, update Artica first: the option needs both the WebConsole page and the reverse-proxy daemon that ship it.

Checking the result

Scope

« Back to HotLogs