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

Commit b616b2d

Browse files
committed
Merge remote-tracking branch 'upstream/v3.1/dev' into v3.1/dev-contributing
2 parents a822ebd + 4304b9e commit b616b2d

32 files changed

+1753
-2014
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ branches:
99
only:
1010
- v3.0/dev
1111
- v3.0/master
12+
- v3.1/dev

KNOWN_BUGS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ or the CRS mailinglist at
2020
with an error such as:
2121
Error parsing actions: Unknown action: \\
2222
Action 'configtest' failed.
23-
This bug is known to plague RHEL 7 and Ubuntu 14.04 LTS users.
23+
This bug is known to plague RHEL/Centos 7 below v7.4 or
24+
httpd v2.4.6 release 67 and Ubuntu 14.04 LTS users.
2425
https://bz.apache.org/bugzilla/show_bug.cgi?id=55910
2526
We advise to upgrade your Apache version. If upgrading is not possible,
2627
we have provided a script in the util/join-multiline-rules directory

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-901-INITIALIZATION.conf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ SecComponentSignature "OWASP_CRS/3.0.2"
5353
SecRule &TX:crs_setup_version "@eq 0" \
5454
"id:901001,\
5555
phase:1,\
56-
auditlog,\
57-
log,\
5856
deny,\
5957
status:500,\
58+
auditlog,\
59+
log,\
6060
severity:CRITICAL,\
6161
msg:'ModSecurity Core Rule Set is deployed without configuration! Please copy the crs-setup.conf.example template to crs-setup.conf, and include the crs-setup.conf file in your webserver configuration before including the CRS rules. See the INSTALL file in the CRS directory for detailed instructions.'"
6262

@@ -207,9 +207,9 @@ SecRule &TX:static_extensions "@eq 0" \
207207
SecAction \
208208
"id:901200,\
209209
phase:1,\
210-
nolog,\
211210
pass,\
212211
t:none,\
212+
nolog,\
213213
setvar:tx.anomaly_score=0,\
214214
setvar:tx.sql_injection_score=0,\
215215
setvar:tx.xss_score=0,\
@@ -232,23 +232,23 @@ SecAction \
232232
# have already been initiated.
233233
#
234234

235-
SecRule REQUEST_HEADERS:User-Agent "^(.*)$" \
235+
SecRule REQUEST_HEADERS:User-Agent "@rx ^.*$" \
236236
"id:901318, \
237237
phase:1, \
238+
pass, \
238239
t:none,t:sha1,t:hexEncode, \
239-
setvar:tx.ua_hash=%{matched_var}, \
240240
nolog, \
241-
pass"
241+
setvar:tx.ua_hash=%{matched_var}"
242242

243243
SecAction \
244244
"id:901321, \
245245
phase:1, \
246+
pass, \
246247
t:none, \
248+
nolog, \
247249
initcol:global=global, \
248250
initcol:ip=%{remote_addr}_%{tx.ua_hash}, \
249-
setvar:tx.real_ip=%{remote_addr}, \
250-
nolog, \
251-
pass"
251+
setvar:tx.real_ip=%{remote_addr}"
252252

253253

254254
#
@@ -290,9 +290,9 @@ SecRule UNIQUE_ID "@rx ^." \
290290
"id:901410,\
291291
phase:1,\
292292
pass,\
293-
nolog,\
294293
t:sha1,\
295294
t:hexEncode,\
295+
nolog,\
296296
setvar:TX.sampling_rnd100=%{MATCHED_VAR}"
297297

298298
SecRule DURATION "@rx (..)$" \
@@ -307,8 +307,8 @@ SecRule TX:sampling_rnd100 "@rx ^[a-f]*([0-9])[a-f]*([0-9])" \
307307
"id:901430,\
308308
phase:1,\
309309
pass,\
310-
nolog,\
311310
capture,\
311+
nolog,\
312312
setvar:TX.sampling_rnd100=%{TX.1}%{TX.2}"
313313

314314
SecRule TX:sampling_rnd100 "@rx ^0([0-9])" \
@@ -339,8 +339,8 @@ SecRule TX:sampling_rnd100 "!@lt %{tx.sampling_percentage}" \
339339
pass,\
340340
log,\
341341
noauditlog,\
342-
ctl:ruleEngine=off,\
343342
msg:'Sampling: Disable the rule engine based on sampling_percentage \
344-
%{TX.sampling_percentage} and random number %{TX.sampling_rnd100}.'"
343+
%{TX.sampling_percentage} and random number %{TX.sampling_rnd100}.', \
344+
ctl:ruleEngine=off"
345345

346346
SecMarker "END-SAMPLING"

0 commit comments

Comments
 (0)