|
1 | 1 | ### pmfromfile external resource |
2 | | - |
3 | | -{ |
4 | | - type => "misc", |
5 | | - comment => "pmfromfile", |
6 | | - conf => qq( |
7 | | - SecRuleEngine On |
8 | | - SecDebugLog $ENV{DEBUG_LOG} |
9 | | - SecDebugLogLevel 9 |
10 | | - SecRequestBodyAccess On |
11 | | - SecRule REQUEST_FILENAME "\@pmFromFile https://www.modsecurity.org/modsecurity-regression-test.txt" "id:'123',phase:2,log,pass,t:none" |
12 | | - ), |
13 | | - match_log => { |
14 | | - error => [ qr/ModSecurity: Warning. Matched phrase \"127.0.0.1\" at REQUEST_FILENAME./, 1], |
15 | | - debug => [ qr/Matched phrase \"127.0.0.1\" at REQUEST_FILENAME/, 1 ], |
16 | | - -error => [ qr/ModSecurity: Problems loading external resources:/, 1], |
17 | | - }, |
18 | | - match_response => { |
19 | | - status => qr/^404$/, |
20 | | - }, |
21 | | - request => new HTTP::Request( |
22 | | - POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
23 | | - [ |
24 | | - "Content-Type" => "application/x-www-form-urlencoded", |
25 | | - ], |
26 | | - # Args |
27 | | - "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
28 | | - ), |
29 | | -}, |
30 | | -{ |
31 | | - type => "misc", |
32 | | - comment => "pmfromfile - 404 download", |
33 | | - conf => qq( |
34 | | - SecRuleEngine On |
35 | | - SecDebugLog $ENV{DEBUG_LOG} |
36 | | - SecDebugLogLevel 9 |
37 | | - SecRequestBodyAccess On |
38 | | - SecRemoteRulesFailAction Warn |
39 | | - SecRule REQUEST_FILENAME "\@pmFromFile https://www.modsecurity.org/modsecurity-regression-test-404.txt" "id:'123',phase:2,log,pass,t:none" |
40 | | - |
41 | | - ), |
42 | | - match_log => { |
43 | | - error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/www.modsecurity.org\/modsecurity-regression-test-404.txt\" error: HTTP response code said error./, 1], |
44 | | - }, |
45 | | - match_response => { |
46 | | - status => qr/^404$/, |
47 | | - }, |
48 | | - request => new HTTP::Request( |
49 | | - POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
50 | | - [ |
51 | | - "Content-Type" => "application/x-www-form-urlencoded", |
52 | | - ], |
53 | | - # Args |
54 | | - "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
55 | | - ), |
56 | | -}, |
57 | | -{ |
58 | | - type => "misc", |
59 | | - comment => "pmfromfile - bad certificate name", |
60 | | - conf => qq( |
61 | | - SecRuleEngine On |
62 | | - SecDebugLog $ENV{DEBUG_LOG} |
63 | | - SecDebugLogLevel 9 |
64 | | - SecRequestBodyAccess On |
65 | | - SecRemoteRulesFailAction Warn |
66 | | - SecRule REQUEST_FILENAME "\@pmFromFile https://status.modsecurity.org/modsecurity-regression-test.txt" "id:'123',phase:2,log,pass,t:none" |
67 | | - |
68 | | - ), |
69 | | - match_log => { |
70 | | - error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/status.modsecurity.org\/modsecurity-regression-test.txt\" error: [SSL peer certificate or SSH remote key was not OK.|Couldn't connect to server.]/, 1], |
71 | | - }, |
72 | | - match_response => { |
73 | | - status => qr/^404$/, |
74 | | - }, |
75 | | - request => new HTTP::Request( |
76 | | - POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
77 | | - [ |
78 | | - "Content-Type" => "application/x-www-form-urlencoded", |
79 | | - ], |
80 | | - # Args |
81 | | - "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
82 | | - ), |
83 | | -}, |
| 2 | +# all tests need an external infrastructure |
| 3 | +# termporary suspended |
| 4 | +# |
| 5 | +#{ |
| 6 | +# type => "misc", |
| 7 | +# comment => "pmfromfile", |
| 8 | +# conf => qq( |
| 9 | +# SecRuleEngine On |
| 10 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 11 | +# SecDebugLogLevel 9 |
| 12 | +# SecRequestBodyAccess On |
| 13 | +# SecRule REQUEST_FILENAME "\@pmFromFile https://www.modsecurity.org/modsecurity-regression-test.txt" "id:'123',phase:2,log,pass,t:none" |
| 14 | +# ), |
| 15 | +# match_log => { |
| 16 | +# error => [ qr/ModSecurity: Warning. Matched phrase \"127.0.0.1\" at REQUEST_FILENAME./, 1], |
| 17 | +# debug => [ qr/Matched phrase \"127.0.0.1\" at REQUEST_FILENAME/, 1 ], |
| 18 | +# -error => [ qr/ModSecurity: Problems loading external resources:/, 1], |
| 19 | +# }, |
| 20 | +# match_response => { |
| 21 | +# status => qr/^404$/, |
| 22 | +# }, |
| 23 | +# request => new HTTP::Request( |
| 24 | +# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
| 25 | +# [ |
| 26 | +# "Content-Type" => "application/x-www-form-urlencoded", |
| 27 | +# ], |
| 28 | +# # Args |
| 29 | +# "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
| 30 | +# ), |
| 31 | +#}, |
| 32 | +#{ |
| 33 | +# type => "misc", |
| 34 | +# comment => "pmfromfile - 404 download", |
| 35 | +# conf => qq( |
| 36 | +# SecRuleEngine On |
| 37 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 38 | +# SecDebugLogLevel 9 |
| 39 | +# SecRequestBodyAccess On |
| 40 | +# SecRemoteRulesFailAction Warn |
| 41 | +# SecRule REQUEST_FILENAME "\@pmFromFile https://www.modsecurity.org/modsecurity-regression-test-404.txt" "id:'123',phase:2,log,pass,t:none" |
| 42 | +# |
| 43 | +# ), |
| 44 | +# match_log => { |
| 45 | +# error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/www.modsecurity.org\/modsecurity-regression-test-404.txt\" error: HTTP response code said error./, 1], |
| 46 | +# }, |
| 47 | +# match_response => { |
| 48 | +# status => qr/^404$/, |
| 49 | +# }, |
| 50 | +# request => new HTTP::Request( |
| 51 | +# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
| 52 | +# [ |
| 53 | +# "Content-Type" => "application/x-www-form-urlencoded", |
| 54 | +# ], |
| 55 | +# # Args |
| 56 | +# "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
| 57 | +# ), |
| 58 | +#}, |
| 59 | +#{ |
| 60 | +# type => "misc", |
| 61 | +# comment => "pmfromfile - bad certificate name", |
| 62 | +# conf => qq( |
| 63 | +# SecRuleEngine On |
| 64 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 65 | +# SecDebugLogLevel 9 |
| 66 | +# SecRequestBodyAccess On |
| 67 | +# SecRemoteRulesFailAction Warn |
| 68 | +# SecRule REQUEST_FILENAME "\@pmFromFile https://status.modsecurity.org/modsecurity-regression-test.txt" "id:'123',phase:2,log,pass,t:none" |
| 69 | +# |
| 70 | +# ), |
| 71 | +# match_log => { |
| 72 | +# error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/status.modsecurity.org\/modsecurity-regression-test.txt\" error: [SSL peer certificate or SSH remote key was not OK.|Couldn't connect to server.]/, 1], |
| 73 | +# }, |
| 74 | +# match_response => { |
| 75 | +# status => qr/^404$/, |
| 76 | +# }, |
| 77 | +# request => new HTTP::Request( |
| 78 | +# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
| 79 | +# [ |
| 80 | +# "Content-Type" => "application/x-www-form-urlencoded", |
| 81 | +# ], |
| 82 | +# # Args |
| 83 | +# "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
| 84 | +# ), |
| 85 | +#}, |
84 | 86 |
|
0 commit comments