Skip to content

Commit 530fdc9

Browse files
author
Felipe Zimmerle
committed
test: Not yet supported by version 3
1 parent 7d50157 commit 530fdc9

11 files changed

Lines changed: 14 additions & 901 deletions

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

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -442,152 +442,4 @@
442442
),
443443
},
444444

445-
# Proxy
446-
{
447-
type => "action",
448-
comment => "proxy in phase:1 (get)",
449-
conf => qq(
450-
SecRuleEngine On
451-
SecRequestBodyAccess On
452-
SecResponseBodyAccess On
453-
SecResponseBodyMimeType null
454-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500005"
455-
),
456-
match_log => {
457-
error => {
458-
apache => [qr/ModSecurity: Access denied using proxy to \(phase 1\)/, 1],
459-
nginx => [qr/ModSecurity: Access denied with code 500 \(phase 1\) \(Configuration Error: Proxy action to .* requested but proxy is only available in Apache version\)./, 1],
460-
},
461-
},
462-
match_response => {
463-
status => {
464-
apache => qr/^200$/,
465-
nginx => qr/^500$/,
466-
},
467-
content => {
468-
apache => qr/^TEST$/,
469-
nginx => qr/^*$/,
470-
},
471-
},
472445

473-
request => new HTTP::Request(
474-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
475-
),
476-
},
477-
{
478-
type => "action",
479-
comment => "nocanon proxy in phase:1 (get)",
480-
conf => qq(
481-
SecRuleEngine On
482-
SecRequestBodyAccess On
483-
SecResponseBodyAccess On
484-
SecResponseBodyMimeType null
485-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,proxy:'[nocanon]http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500005"
486-
),
487-
match_log => {
488-
error => {
489-
apache => [qr/ModSecurity: Access denied using proxy to \(phase 1\)/, 1],
490-
nginx => [qr/ModSecurity: Access denied with code 500 \(phase 1\) \(Configuration Error: Proxy action to .* requested but proxy is only available in Apache version\)./, 1],
491-
},
492-
},
493-
match_response => {
494-
status => {
495-
apache => qr/^200$/,
496-
nginx => qr/^500$/,
497-
},
498-
content => {
499-
apache => qr/^TEST$/,
500-
nginx => qr/^*$/,
501-
},
502-
},
503-
504-
request => new HTTP::Request(
505-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
506-
),
507-
},
508-
{
509-
type => "action",
510-
comment => "proxy in phase:2 (get)",
511-
conf => qq(
512-
SecRuleEngine On
513-
SecRequestBodyAccess On
514-
SecResponseBodyAccess On
515-
SecResponseBodyMimeType null
516-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500006"
517-
),
518-
match_log => {
519-
error => {
520-
apache => [qr/ModSecurity: Access denied using proxy to \(phase 2\)/, 1],
521-
nginx => [qr/ModSecurity: Access denied with code 500 \(phase 2\) \(Configuration Error: Proxy action to .* requested but proxy is only available in Apache version\)./, 1],
522-
},
523-
},
524-
match_response => {
525-
status => {
526-
apache => qr/^200$/,
527-
nginx => qr/^500$/,
528-
},
529-
content => {
530-
apache => qr/^TEST$/,
531-
nginx => qr/^*$/,
532-
},
533-
},
534-
request => new HTTP::Request(
535-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
536-
),
537-
},
538-
{
539-
type => "action",
540-
comment => "proxy in phase:3 (get)",
541-
conf => qq(
542-
SecRuleEngine On
543-
SecRequestBodyAccess On
544-
SecResponseBodyAccess On
545-
SecResponseBodyMimeType null
546-
SecDebugLog "$ENV{DEBUG_LOG}"
547-
SecDebugLogLevel 4
548-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500007"
549-
),
550-
match_log => {
551-
error => {
552-
apache => [qr/ModSecurity: Access denied with code 500 \(phase 3\) \(Configuration Error: Proxy action requested but it does not work in output phases\)./, 1],
553-
nginx => [qr/ModSecurity: Access denied with code 500 \(phase 3\) \(Configuration Error: Proxy action to .* requested but proxy is only available in Apache version\)./, 1],
554-
}
555-
},
556-
match_response => {
557-
status => {
558-
apache => qr/^500$/,
559-
nginx => qr/^500$/,
560-
},
561-
},
562-
request => new HTTP::Request(
563-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
564-
),
565-
},
566-
{
567-
type => "action",
568-
comment => "proxy in phase:4 (get)",
569-
conf => qq(
570-
SecRuleEngine On
571-
SecRequestBodyAccess On
572-
SecResponseBodyAccess On
573-
SecResponseBodyMimeType null
574-
SecDebugLog "$ENV{DEBUG_LOG}"
575-
SecDebugLogLevel 4
576-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',id:500008"
577-
),
578-
match_log => {
579-
error => {
580-
apache => [qr/ModSecurity: Access denied with code 500 \(phase 4\) \(Configuration Error: Proxy action requested but it does not work in output phases\)./, 1],
581-
nginx => [qr/ModSecurity: Access denied with code 500 \(phase 4\) \(Configuration Error: Proxy action to .* requested but proxy is only available in Apache version\)./, 1],
582-
}
583-
},
584-
match_response => {
585-
status => {
586-
apache => qr/^500$/,
587-
nginx => qr/^500$/,
588-
},
589-
},
590-
request => new HTTP::Request(
591-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
592-
),
593-
},

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/regression/action/10-detectiononly-actions.t

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -452,94 +452,4 @@
452452
),
453453
},
454454

455-
# Proxy
456-
{
457-
type => "action",
458-
comment => "proxy in phase:1 (get)",
459-
conf => qq(
460-
SecRuleEngine DetectionOnly
461-
SecRequestBodyAccess On
462-
SecResponseBodyAccess On
463-
SecResponseBodyMimeType null
464-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:1,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',msg:'PROXIED',id:500013"
465-
),
466-
match_log => {
467-
error => [ qr/ModSecurity: Warning. String match "\/test2.txt" at REQUEST_URI.*PROXIED/, 1 ],
468-
-error => [ qr/Access denied/, 1 ],
469-
},
470-
match_response => {
471-
status => qr/^200$/,
472-
content => qr/^TEST 2$/,
473-
},
474-
request => new HTTP::Request(
475-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
476-
),
477-
},
478-
{
479-
type => "action",
480-
comment => "proxy in phase:2 (get)",
481-
conf => qq(
482-
SecRuleEngine DetectionOnly
483-
SecRequestBodyAccess On
484-
SecResponseBodyAccess On
485-
SecResponseBodyMimeType null
486-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:2,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',msg:'PROXIED',id:500014"
487-
),
488-
match_log => {
489-
error => [ qr/ModSecurity: Warning. String match "\/test2.txt" at REQUEST_URI.*PROXIED/, 1 ],
490-
-error => [ qr/Access denied/, 1 ],
491-
},
492-
match_response => {
493-
status => qr/^200$/,
494-
content => qr/^TEST 2$/,
495-
},
496-
request => new HTTP::Request(
497-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
498-
),
499-
},
500-
{
501-
type => "action",
502-
comment => "proxy in phase:3 (get)",
503-
conf => qq(
504-
SecRuleEngine DetectionOnly
505-
SecRequestBodyAccess On
506-
SecResponseBodyAccess On
507-
SecResponseBodyMimeType null
508-
SecDebugLog "$ENV{DEBUG_LOG}"
509-
SecDebugLogLevel 4
510-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:3,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',msg:'PROXIED',id:500015"
511-
),
512-
match_log => {
513-
error => [ qr/ModSecurity: Warning. String match "\/test2.txt" at REQUEST_URI.*PROXIED/, 1 ],
514-
-error => [ qr/Access denied/, 1 ],
515-
},
516-
match_response => {
517-
status => qr/^200$/,
518-
},
519-
request => new HTTP::Request(
520-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
521-
),
522-
},
523-
{
524-
type => "action",
525-
comment => "proxy in phase:4 (get)",
526-
conf => qq(
527-
SecRuleEngine DetectionOnly
528-
SecRequestBodyAccess On
529-
SecResponseBodyAccess On
530-
SecResponseBodyMimeType null
531-
SecDebugLog "$ENV{DEBUG_LOG}"
532-
SecDebugLogLevel 4
533-
SecRule REQUEST_URI "\@streq /test2.txt" "phase:4,proxy:'http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt',msg:'PROXIED',id:500016"
534-
),
535-
match_log => {
536-
error => [ qr/ModSecurity: Warning. String match "\/test2.txt" at REQUEST_URI.*PROXIED/, 1 ],
537-
-error => [ qr/Access denied/, 1 ],
538-
},
539-
match_response => {
540-
status => qr/^200$/,
541-
},
542-
request => new HTTP::Request(
543-
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test2.txt",
544-
),
545-
},
455+

tests/regression/config/10-debug-directives.t

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
SecRuleEngine On
6060
SecDebugLog $ENV{DEBUG_LOG}
6161
SecDebugLogLevel 1
62-
SecRuleScript "test.lua" "phase:1"
63-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500242"
62+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500242"
6463
),
6564
match_log => {
6665
debug => [ qr/\]\[[1]\] /, 1 ],
@@ -84,8 +83,7 @@
8483
SecRuleEngine DetectionOnly
8584
SecDebugLog $ENV{DEBUG_LOG}
8685
SecDebugLogLevel 2
87-
SecRuleScript "test.lua" "phase:1"
88-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500243"
86+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500243"
8987
),
9088
match_log => {
9189
debug => [ qr/\]\[2\] /, 1 ],
@@ -109,8 +107,7 @@
109107
SecRuleEngine On
110108
SecDebugLog $ENV{DEBUG_LOG}
111109
SecDebugLogLevel 3
112-
SecRuleScript "test.lua" "phase:1"
113-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500244"
110+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500244"
114111
),
115112
match_log => {
116113
debug => [ qr/\]\[3\] /, 1 ],
@@ -134,8 +131,7 @@
134131
SecRuleEngine On
135132
SecDebugLog $ENV{DEBUG_LOG}
136133
SecDebugLogLevel 4
137-
SecRuleScript "test.lua" "phase:1"
138-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500245"
134+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500245"
139135
),
140136
match_log => {
141137
debug => [ qr/\]\[4\] /, 1 ],
@@ -159,8 +155,7 @@
159155
SecRuleEngine On
160156
SecDebugLog $ENV{DEBUG_LOG}
161157
SecDebugLogLevel 5
162-
SecRuleScript "test.lua" "phase:1"
163-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500246"
158+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500246"
164159
),
165160
match_log => {
166161
debug => [ qr/\]\[5\] /, 1 ],
@@ -184,8 +179,7 @@
184179
SecRuleEngine On
185180
SecDebugLog $ENV{DEBUG_LOG}
186181
SecDebugLogLevel 6
187-
SecRuleScript "test.lua" "phase:1"
188-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500247"
182+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500247"
189183
),
190184
match_log => {
191185
debug => [ qr/\]\[6\] /, 1 ],
@@ -209,8 +203,7 @@
209203
SecRuleEngine On
210204
SecDebugLog $ENV{DEBUG_LOG}
211205
SecDebugLogLevel 7
212-
SecRuleScript "test.lua" "phase:1"
213-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500248"
206+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500248"
214207
),
215208
match_log => {
216209
debug => [ qr/\]\[7\] /, 1 ],
@@ -234,8 +227,7 @@
234227
SecRuleEngine On
235228
SecDebugLog $ENV{DEBUG_LOG}
236229
SecDebugLogLevel 8
237-
SecRuleScript "test.lua" "phase:1"
238-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500249"
230+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500249"
239231
),
240232
match_log => {
241233
debug => [ qr/\]\[8\] /, 1 ],
@@ -259,8 +251,7 @@
259251
SecRuleEngine On
260252
SecDebugLog $ENV{DEBUG_LOG}
261253
SecDebugLogLevel 9
262-
SecRuleScript "test.lua" "phase:1"
263-
SecRule REQUEST_URI "(.)" "phase:4,deny,deprecatevar:bogus,id:500250"
254+
SecRule REQUEST_URI "(.)" "phase:4,deny,id:500250"
264255
),
265256
match_log => {
266257
debug => [ qr/\]\[9\] /, 1 ],

0 commit comments

Comments
 (0)