When IIS sits behind Imperva Cloud WAF (formerly Incapsula), your logs show Imperva addresses instead of your visitors. Here is which headers carry the client address, what Imperva's public documentation leaves open, and how to record the real client IP in the standard IIS log.
Short answer. Imperva's Customer Setup Checklist says that by default Imperva inserts the original client IP into two request headers, X-Forwarded-For and Incap-Client-IP. IIS reads neither, and its c-ip field is filled from the TCP connection, so it records an Imperva address. Log the header as a column to see the visitor, as below, or use something that validates the header against Imperva's published ranges to put the visitor into c-ip itself.
To see the visitor in your log today, add the header as a custom column (elevated PowerShell):
Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' `
-filter "system.applicationHost/sites/siteDefaults/logFile/customFields" `
-name "." `
-value @{logFieldName='Incap-Client-IP';sourceName='Incap-Client-IP';sourceType='RequestHeader'}
It adds a cs(Incap-Client-IP) column and does not change c-ip. Only need the column? The free custom log field covers that, and the section below says where it stops being enough.
| Header | Default | What the documentation says |
|---|---|---|
X-Forwarded-For | On | Inserted with the client IP, per the Customer Setup Checklist. Imperva's public pages do not say whether an inbound value is appended to or replaced. |
Incap-Client-IP | On | Inserted with the client IP, per the same checklist. Its format is not described in the pages we could read. A reply in Imperva's community forums says the name can be changed in the site's Delivery advanced settings; we could not find this in current documentation, so check the name that actually arrives. |
Rather than guess at the open points, test them. Add both headers as custom log fields, send one request through the Imperva hostname with a made-up X-Forwarded-For: 203.0.113.9 header of your own, and read the log. You will see whether Imperva appended to your value, replaced it or passed it through, and what the other header looks like.
Every header-based approach assumes requests reached IIS through Imperva. Imperva's article on allowlisting its IP addresses says there should be no reason to accept traffic from any source other than Imperva, and lists the ranges to allow. It also publishes them through an API at my.imperva.com/api/integration/v1/ips, with response formats for Apache, Nginx, iptables, JSON and plain text. IIS is not among the listed formats, so build the allowlist from the JSON or text output.
The list changes. Imperva's May 2023 release notes announced a new range, 131.125.128.0/17, and warned that origins that did not allowlist it could see a site outage, so refresh your firewall rules and the Proxy Trust List from the current list rather than copying addresses from a page like this one.
Winfrasoft X-Forwarded-For for IIS is an ISAPI web filter that reads the header Imperva sends and writes the real client address into the standard IIS c-ip log field. Same log file, same W3C schema, same column your collector already parses. No application changes and no second log file.
c-ip now holds the client address.If all you need is the address somewhere in the log, IIS 8.5 and later can record the header as an extra column with no product, using the snippet at the top of this page. That appends a cs(Incap-Client-IP) column to the W3C log. It does not change c-ip.
It stops being enough when:
c-ip. SIEM connectors, geo-IP reporting and compliance parsers key off the standard field, so they carry on seeing an Imperva address. A new column means changing every one of them; rewriting c-ip changes none.The click-through steps, and the log-file naming caveat, are in how to log X-Forwarded-For in IIS. If any of the points above applies, X-Forwarded-For for IIS 10 is the supported way to put the validated client address into c-ip itself.
Per Imperva's Customer Setup Checklist, X-Forwarded-For and Incap-Client-IP, both inserted by default. Neither changes the IIS c-ip field, which records the TCP peer, so IIS logs an Imperva address until something reads the header.
Imperva's public documentation does not say, so do not assume either. Send a request through Imperva with an X-Forwarded-For value of your own, log the header as a custom field, and read what arrives. If your value survives at the left of the chain, a forged entry can reach your origin.
From Imperva's article on allowlisting its IP addresses, or from the my.imperva.com/api/integration/v1/ips API, which returns JSON or plain text, among other formats (IIS is not one of them). Imperva says the list changes periodically, so refresh it rather than hard-coding it.
Yes, as a custom log field on IIS 8.5 and later, and it costs nothing. It gives you an extra column and leaves c-ip unchanged. Imperva's pages we could read do not describe its format, and like any header it can be forged by someone who reaches your origin directly, so lock the origin down either way.
Log the real client IP in the standard IIS c-ip field behind Imperva, with a Proxy Trust List so the value is validated rather than merely copied. IIS 10 on Windows Server 2016–2025, with a free 14-day trial.
Stuck on your setup? Email us with your proxy and what c-ip shows, and we will take a look.