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

Commit 4a5ffc6

Browse files
authored
Merge pull request #900 from fgsch/fgsch/update-examples
Update examples to match the current cleanup
2 parents 8565447 + 1ac45ce commit 4a5ffc6

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@
8888
#
8989
# ModSec Rule Exclusion: Disable Rule Engine for known ASV IP
9090
# SecRule REMOTE_ADDR "@ipMatch 192.168.1.100" \
91-
# "phase:1,id:1000,pass,nolog,ctl:ruleEngine=Off"
91+
# "id:1000,\
92+
# phase:1,\
93+
# pass,\
94+
# nolog,\
95+
# ctl:ruleEngine=Off"
9296
#
9397
#
9498
# Example Exclusion Rule: Removing a specific ARGS parameter from inspection
@@ -99,7 +103,10 @@
99103
# ModSecurity Rule Exclusion: 942100 SQL Injection Detected via libinjection
100104
#
101105
# SecRule REQUEST_URI "@beginsWith /index.php" \
102-
# "id:1001,phase:1,pass,nolog, \
106+
# "id:1001,\
107+
# phase:1,\
108+
# pass,\
109+
# nolog,\
103110
# ctl:ruleRemoveTargetById=942100;ARGS:password"
104111
#
105112
#
@@ -112,7 +119,10 @@
112119
# ModSecurity Rule Exclusion: Disable inspection of ARGS:pwd
113120
# for all rules tagged attack-sqli
114121
# SecRule REQUEST_FILENAME "@endsWith /wp-login.php" \
115-
# "id:1002,phase:request,pass,nolog,\
122+
# "id:1002,\
123+
# phase:2,\
124+
# pass,\
125+
# nolog,\
116126
# ctl:ruleRemoveTargetByTag=attack-sqli;ARGS:pwd"
117127
#
118128

@@ -127,7 +137,10 @@
127137
# ModSecurity Rule Exclusion: Disable inspection of ARGS:pwd
128138
# for all CRS rules
129139
# SecRule REQUEST_FILENAME "@endsWith /wp-login.php" \
130-
# "id:1003,phase:request,pass,nolog,\
140+
# "id:1003,\
141+
# phase:2,\
142+
# pass,\
143+
# nolog,\
131144
# ctl:ruleRemoveTargetByTag=CRS;ARGS:pwd"
132145

133146
#
@@ -139,7 +152,10 @@
139152
#
140153
# ModSecurity Rule Exclusion: Disable all SQLi and XSS rules
141154
# SecRule REQUEST_FILENAME "@beginsWith /admin" \
142-
# "id:1004,phase:request,pass,nolog,\
155+
# "id:1004,\
156+
# phase:2,\
157+
# pass,\
158+
# nolog,\
143159
# ctl:ruleRemoveById=941000-942999"
144160
#
145161
#

rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ SecRule REQUEST_HEADERS:Content-Type "@rx ^(?:application\/x-www-form-urlencoded
422422
SecRule REQUEST_BODY|XML:/* "@rx \%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
423423
"chain"
424424
SecRule REQUEST_BODY|XML:/* "@validateUrlEncoding" \
425-
"setvar:'tx.msg=%{rule.msg}',\
426-
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
427-
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/EVASION-%{matched_var_name}=%{matched_var}"
425+
"setvar:'tx.msg=%{rule.msg}',\
426+
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
427+
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/EVASION-%{matched_var_name}=%{matched_var}"
428428

429429

430430
#
@@ -642,10 +642,10 @@ SecRule REQUEST_HEADERS:Accept "@rx ^$" \
642642
SecRule REQUEST_METHOD "!@rx ^OPTIONS$" \
643643
"chain"
644644
SecRule REQUEST_HEADERS:User-Agent "!@pm AppleWebKit Android Business Enterprise Entreprise" \
645-
"t:none,\
646-
setvar:'tx.msg=%{rule.msg}',\
647-
setvar:tx.anomaly_score=+%{tx.notice_anomaly_score},\
648-
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/MISSING_HEADER-%{matched_var_name}=%{matched_var}"
645+
"t:none,\
646+
setvar:'tx.msg=%{rule.msg}',\
647+
setvar:tx.anomaly_score=+%{tx.notice_anomaly_score},\
648+
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/MISSING_HEADER-%{matched_var_name}=%{matched_var}"
649649

650650
#
651651
# This rule is a sibling of rule 920310.

rules/RESPONSE-951-DATA-LEAKAGES-SQL.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ SecRule TX:sql_error_match "@eq 1" \
174174
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
175175
setvar:tx.%{rule.id}-OWASP_CRS/LEAKAGE/ERRORS-%{matched_var_name}=%{tx.0}"
176176

177-
177+
178178
SecRule TX:sql_error_match "@eq 1" \
179179
"id:951160,\
180180
phase:4,\

0 commit comments

Comments
 (0)