Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit 08ed24e

Browse files
committed
stop using X-Forwarded-For header for determining real_ip
1 parent 4f150d3 commit 08ed24e

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

rules/REQUEST-901-INITIALIZATION.conf

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -241,25 +241,7 @@ SecRule REQUEST_HEADERS:User-Agent "^(.*)$" \
241241
nolog, \
242242
pass"
243243

244-
SecRule REQUEST_HEADERS:x-forwarded-for "^\b(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b" \
245-
"id:901319, \
246-
phase:1, \
247-
t:none, \
248-
capture, \
249-
setvar:tx.real_ip=%{tx.1}, \
250-
nolog, \
251-
pass"
252-
253-
SecRule &TX:REAL_IP "!@eq 0" \
254-
"id:901320, \
255-
phase:1, \
256-
t:none, \
257-
initcol:global=global, \
258-
initcol:ip=%{tx.real_ip}_%{tx.ua_hash}, \
259-
nolog, \
260-
pass"
261-
262-
SecRule &TX:REAL_IP "@eq 0" \
244+
SecAction \
263245
"id:901321, \
264246
phase:1, \
265247
t:none, \

0 commit comments

Comments
 (0)