Skip to content

Commit ca78eba

Browse files
committed
Fixed: Regression tests with no ID present
1 parent e8189d9 commit ca78eba

19 files changed

+356
-354
lines changed

tests/regression/action/00-disruptive-actions.t

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
SecRequestBodyAccess On
1010
SecResponseBodyAccess On
1111
SecResponseBodyMimeType null
12-
SecAction "phase:1,pass"
13-
SecAction "phase:1,deny"
12+
SecAction "phase:1,pass,id:500033"
13+
SecAction "phase:1,deny,id:500034"
1414
),
1515
match_log => {
1616
error => [ qr/ModSecurity: Warning. Unconditional match in SecAction/, 1 ],
@@ -30,8 +30,8 @@
3030
SecRequestBodyAccess On
3131
SecResponseBodyAccess On
3232
SecResponseBodyMimeType null
33-
SecAction "phase:2,pass"
34-
SecAction "phase:2,deny"
33+
SecAction "phase:2,pass,id:500035"
34+
SecAction "phase:2,deny,id:500036"
3535
),
3636
match_log => {
3737
error => [ qr/ModSecurity: Warning. Unconditional match in SecAction/, 1 ],
@@ -53,8 +53,8 @@
5353
SecResponseBodyMimeType null
5454
SecDebugLog "$ENV{DEBUG_LOG}"
5555
SecDebugLogLevel 4
56-
SecAction "phase:3,pass"
57-
SecAction "phase:3,deny"
56+
SecAction "phase:3,pass,id:500037"
57+
SecAction "phase:3,deny,id:500038"
5858
),
5959
match_log => {
6060
error => [ qr/ModSecurity: Warning. Unconditional match in SecAction/, 1 ],
@@ -76,8 +76,8 @@
7676
SecResponseBodyMimeType null
7777
SecDebugLog "$ENV{DEBUG_LOG}"
7878
SecDebugLogLevel 4
79-
SecAction "phase:4,pass"
80-
SecAction "phase:4,deny"
79+
SecAction "phase:4,pass,id:500039"
80+
SecAction "phase:4,deny,id:500040"
8181
),
8282
match_log => {
8383
error => [ qr/ModSecurity: Warning. Unconditional match in SecAction/, 1 ],
@@ -99,8 +99,8 @@
9999
SecRequestBodyAccess On
100100
SecResponseBodyAccess On
101101
SecResponseBodyMimeType null
102-
SecAction "phase:1,allow"
103-
SecAction "phase:1,deny"
102+
SecAction "phase:1,allow,id:500041"
103+
SecAction "phase:1,deny,id:500042"
104104
),
105105
match_log => {
106106
error => [ qr/ModSecurity: Access allowed \(phase 1\). Unconditional match in SecAction/, 1 ],
@@ -120,8 +120,8 @@
120120
SecRequestBodyAccess On
121121
SecResponseBodyAccess On
122122
SecResponseBodyMimeType null
123-
SecAction "phase:2,allow"
124-
SecAction "phase:2,deny"
123+
SecAction "phase:2,allow,id:500043"
124+
SecAction "phase:2,deny,id:500044"
125125
),
126126
match_log => {
127127
error => [ qr/ModSecurity: Access allowed \(phase 2\). Unconditional match in SecAction/, 1 ],
@@ -143,8 +143,8 @@
143143
SecResponseBodyMimeType null
144144
SecDebugLog "$ENV{DEBUG_LOG}"
145145
SecDebugLogLevel 4
146-
SecAction "phase:3,allow"
147-
SecAction "phase:3,deny"
146+
SecAction "phase:3,allow,id:500045"
147+
SecAction "phase:3,deny,id:500046"
148148
),
149149
match_log => {
150150
error => [ qr/ModSecurity: Access allowed \(phase 3\). Unconditional match in SecAction/, 1 ],
@@ -166,8 +166,8 @@
166166
SecResponseBodyMimeType null
167167
SecDebugLog "$ENV{DEBUG_LOG}"
168168
SecDebugLogLevel 4
169-
SecAction "phase:4,allow"
170-
SecAction "phase:4,deny"
169+
SecAction "phase:4,allow,id:500047"
170+
SecAction "phase:4,deny,id:500048"
171171
),
172172
match_log => {
173173
error => [ qr/ModSecurity: Access allowed \(phase 4\). Unconditional match in SecAction/, 1 ],
@@ -189,7 +189,7 @@
189189
SecRequestBodyAccess On
190190
SecResponseBodyAccess On
191191
SecResponseBodyMimeType null
192-
SecAction "phase:1,deny"
192+
SecAction "phase:1,deny,id:500049"
193193
),
194194
match_log => {
195195
error => [ qr/Access denied with code 403 \(phase 1\). Unconditional match in SecAction./, 1 ],
@@ -209,7 +209,7 @@
209209
SecRequestBodyAccess On
210210
SecResponseBodyAccess On
211211
SecResponseBodyMimeType null
212-
SecAction "phase:2,deny"
212+
SecAction "phase:2,deny,id:500050"
213213
),
214214
match_log => {
215215
error => [ qr/Access denied with code 403 \(phase 2\). Unconditional match in SecAction./, 1 ],
@@ -231,7 +231,7 @@
231231
SecResponseBodyMimeType null
232232
SecDebugLog "$ENV{DEBUG_LOG}"
233233
SecDebugLogLevel 4
234-
SecAction "phase:3,deny"
234+
SecAction "phase:3,deny,id:500051"
235235
),
236236
match_log => {
237237
error => [ qr/Access denied with code 403 \(phase 3\). Unconditional match in SecAction./, 1 ],
@@ -253,7 +253,7 @@
253253
SecResponseBodyMimeType null
254254
SecDebugLog "$ENV{DEBUG_LOG}"
255255
SecDebugLogLevel 4
256-
SecAction "phase:4,deny"
256+
SecAction "phase:4,deny,id:500052"
257257
),
258258
match_log => {
259259
error => [ qr/Access denied with code 403 \(phase 4\). Unconditional match in SecAction./, 1 ],
@@ -275,7 +275,7 @@
275275
SecRequestBodyAccess On
276276
SecResponseBodyAccess On
277277
SecResponseBodyMimeType null
278-
SecAction "phase:1,drop"
278+
SecAction "phase:1,drop,id:500053"
279279
),
280280
match_log => {
281281
error => [ qr/Access denied with connection close \(phase 1\). Unconditional match in SecAction./, 1 ],
@@ -295,7 +295,7 @@
295295
SecRequestBodyAccess On
296296
SecResponseBodyAccess On
297297
SecResponseBodyMimeType null
298-
SecAction "phase:2,drop"
298+
SecAction "phase:2,drop,id:500054"
299299
),
300300
match_log => {
301301
error => [ qr/Access denied with connection close \(phase 2\). Unconditional match in SecAction./, 1 ],
@@ -317,7 +317,7 @@
317317
SecResponseBodyMimeType null
318318
SecDebugLog "$ENV{DEBUG_LOG}"
319319
SecDebugLogLevel 4
320-
SecAction "phase:3,drop"
320+
SecAction "phase:3,drop,id:500055"
321321
),
322322
match_log => {
323323
error => [ qr/Access denied with connection close \(phase 3\). Unconditional match in SecAction./, 1 ],
@@ -339,7 +339,7 @@
339339
SecResponseBodyMimeType null
340340
SecDebugLog "$ENV{DEBUG_LOG}"
341341
SecDebugLogLevel 4
342-
SecAction "phase:4,drop"
342+
SecAction "phase:4,drop,id:500056"
343343
),
344344
match_log => {
345345
error => [ qr/Access denied with connection close \(phase 4\). Unconditional match in SecAction./, 1 ],
@@ -361,7 +361,7 @@
361361
SecRequestBodyAccess On
362362
SecResponseBodyAccess On
363363
SecResponseBodyMimeType null
364-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
364+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500001"
365365
),
366366
match_log => {
367367
error => [ qr/ModSecurity: Access denied with redirection to .* using status 302 \(phase 1\)/, 1 ],
@@ -382,7 +382,7 @@
382382
SecRequestBodyAccess On
383383
SecResponseBodyAccess On
384384
SecResponseBodyMimeType null
385-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
385+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500002"
386386
),
387387
match_log => {
388388
error => [ qr/ModSecurity: Access denied with redirection to .* using status 302 \(phase 2\)/, 1 ],
@@ -405,7 +405,7 @@
405405
SecResponseBodyMimeType null
406406
SecDebugLog "$ENV{DEBUG_LOG}"
407407
SecDebugLogLevel 4
408-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
408+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500003"
409409
),
410410
match_log => {
411411
error => [ qr/ModSecurity: Access denied with redirection to .* using status 302 \(phase 3\)/, 1 ],
@@ -428,7 +428,7 @@
428428
SecResponseBodyMimeType null
429429
SecDebugLog "$ENV{DEBUG_LOG}"
430430
SecDebugLogLevel 4
431-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
431+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,redirect:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500004"
432432
),
433433
match_log => {
434434
error => [ qr/ModSecurity: Access denied with redirection to .* using status 302 \(phase 4\)/, 1 ],
@@ -451,7 +451,7 @@
451451
SecRequestBodyAccess On
452452
SecResponseBodyAccess On
453453
SecResponseBodyMimeType null
454-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
454+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500005"
455455
),
456456
match_log => {
457457
error => [ qr/ModSecurity: Access denied using proxy to \(phase 1\)/, 1 ],
@@ -472,7 +472,7 @@
472472
SecRequestBodyAccess On
473473
SecResponseBodyAccess On
474474
SecResponseBodyMimeType null
475-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
475+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500006"
476476
),
477477
match_log => {
478478
error => [ qr/ModSecurity: Access denied using proxy to \(phase 2\)/, 1 ],
@@ -495,7 +495,7 @@
495495
SecResponseBodyMimeType null
496496
SecDebugLog "$ENV{DEBUG_LOG}"
497497
SecDebugLogLevel 4
498-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
498+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500007"
499499
),
500500
match_log => {
501501
error => [ qr/ModSecurity: Access denied with code 500 \(phase 3\) \(Configuration Error: Proxy action requested but it does not work in output phases\)./, 1 ],
@@ -517,7 +517,7 @@
517517
SecResponseBodyMimeType null
518518
SecDebugLog "$ENV{DEBUG_LOG}"
519519
SecDebugLogLevel 4
520-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt'"
520+
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500008"
521521
),
522522
match_log => {
523523
error => [ qr/ModSecurity: Access denied with code 500 \(phase 4\) \(Configuration Error: Proxy action requested but it does not work in output phases\)./, 1 ],

tests/regression/action/10-append-prepend.t

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
SecContentInjection On
1010
SecDebugLog "$ENV{DEBUG_LOG}"
1111
SecDebugLogLevel 9
12-
SecAction "phase:1,setvar:tx.test=test"
13-
SecAction "phase:2,append:'APPEND: \%{tx.test}'"
12+
SecAction "phase:1,setvar:tx.test=test,id:500002"
13+
SecAction "phase:2,append:'APPEND: \%{tx.test}',id:500003"
1414
),
1515
match_log => {
1616
debug => [ "Added content to bottom: APPEND: test", 1 ],
@@ -33,8 +33,8 @@
3333
SecContentInjection On
3434
SecDebugLog "$ENV{DEBUG_LOG}"
3535
SecDebugLogLevel 9
36-
SecAction "phase:1,setvar:tx.test=test"
37-
SecAction "phase:2,prepend:'PREPEND: \%{tx.test}'"
36+
SecAction "phase:1,setvar:tx.test=test,id:500004"
37+
SecAction "phase:2,prepend:'PREPEND: \%{tx.test}',id:500005"
3838
),
3939
match_log => {
4040
debug => [ "Added content to top: PREPEND: test", 1 ],

tests/regression/action/10-ctl.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
conf => qq(
88
SecRuleEngine On
99
SecAction "phase:2,id:666,deny"
10-
SecAction "phase:1,pass,ctl:ruleRemoveById=666"
10+
SecAction "phase:1,pass,ctl:ruleRemoveById=666,id:500030"
1111
),
1212
match_log => {
1313
},
@@ -23,7 +23,7 @@
2323
comment => "ruleRemoveById future rule across phases",
2424
conf => qq(
2525
SecRuleEngine On
26-
SecAction "phase:1,pass,ctl:ruleRemoveById=666"
26+
SecAction "phase:1,pass,ctl:ruleRemoveById=666,id:500031"
2727
SecAction "phase:2,id:666,deny"
2828
),
2929
match_log => {
@@ -40,7 +40,7 @@
4040
comment => "ruleRemoveById future rule same phase",
4141
conf => qq(
4242
SecRuleEngine On
43-
SecAction "phase:1,pass,ctl:ruleRemoveById=666"
43+
SecAction "phase:1,pass,ctl:ruleRemoveById=666,id:500032"
4444
SecAction "phase:1,id:666,deny"
4545
),
4646
match_log => {

0 commit comments

Comments
 (0)