|
1 | 1 | ### ipMatchFromFile external resource |
2 | | - |
3 | | -{ |
4 | | - type => "misc", |
5 | | - comment => "ipMatchFromFile", |
6 | | - conf => qq( |
7 | | - SecRuleEngine On |
8 | | - SecDebugLog $ENV{DEBUG_LOG} |
9 | | - SecDebugLogLevel 9 |
10 | | - SecRequestBodyAccess On |
11 | | - SecRule REMOTE_ADDR "\@ipMatchFromFile https://www.modsecurity.org/modsecurity-regression-test.txt" "id:10500,pass" |
12 | | - ), |
13 | | - match_log => { |
14 | | - error => [ qr/ModSecurity: Warning. IPmatchFromFile: \"127.0.0.1\" matched at REMOTE_ADDR./, 1], |
15 | | - debug => [ qr/IPmatchFromFile: \"127.0.0.1\" matched at REMOTE_ADDR./, 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 => "ipMatchFromFile - 404 download", |
33 | | - conf => qq( |
34 | | - SecRuleEngine On |
35 | | - SecDebugLog $ENV{DEBUG_LOG} |
36 | | - SecDebugLogLevel 9 |
37 | | - SecRequestBodyAccess On |
38 | | - SecRemoteRulesFailAction Warn |
39 | | - SecRule REMOTE_ADDR "\@ipMatchFromFile https://www.modsecurity.org/modsecurity-regression-test-404.txt" "id:10500,pass" |
40 | | - ), |
41 | | - match_log => { |
42 | | - 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], |
43 | | - }, |
44 | | - match_response => { |
45 | | - status => qr/^404$/, |
46 | | - }, |
47 | | - request => new HTTP::Request( |
48 | | - POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
49 | | - [ |
50 | | - "Content-Type" => "application/x-www-form-urlencoded", |
51 | | - ], |
52 | | - # Args |
53 | | - "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
54 | | - ), |
55 | | -}, |
56 | | -{ |
57 | | - type => "misc", |
58 | | - comment => "ipMatchFromFile - bad certificate name", |
59 | | - conf => qq( |
60 | | - SecRuleEngine On |
61 | | - SecDebugLog $ENV{DEBUG_LOG} |
62 | | - SecDebugLogLevel 9 |
63 | | - SecRequestBodyAccess On |
64 | | - SecRemoteRulesFailAction Warn |
65 | | - SecRule REMOTE_ADDR "\@ipMatchFromFile https://status.modsecurity.org/modsecurity-regression-test-huge-ip-list.txt" "id:10500,pass" |
66 | | - ), |
67 | | - match_log => { |
68 | | - error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/status.modsecurity.org\/modsecurity-regression-test-huge-ip-list.txt\" error: [SSL peer certificate or SSH remote key was not OK.|Couldn't connect to server.]/, 1], |
69 | | - }, |
70 | | -}, |
| 2 | +# no infrasturcure to test |
| 3 | +# |
| 4 | +# permanently suspended |
| 5 | +#{ |
| 6 | +# type => "misc", |
| 7 | +# comment => "ipMatchFromFile", |
| 8 | +# conf => qq( |
| 9 | +# SecRuleEngine On |
| 10 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 11 | +# SecDebugLogLevel 9 |
| 12 | +# SecRequestBodyAccess On |
| 13 | +# SecRule REMOTE_ADDR "\@ipMatchFromFile https://www.modsecurity.org/modsecurity-regression-test.txt" "id:10500,pass" |
| 14 | +# ), |
| 15 | +# match_log => { |
| 16 | +# error => [ qr/ModSecurity: Warning. IPmatchFromFile: \"127.0.0.1\" matched at REMOTE_ADDR./, 1], |
| 17 | +# debug => [ qr/IPmatchFromFile: \"127.0.0.1\" matched at REMOTE_ADDR./, 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 => "ipMatchFromFile - 404 download", |
| 35 | +# conf => qq( |
| 36 | +# SecRuleEngine On |
| 37 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 38 | +# SecDebugLogLevel 9 |
| 39 | +# SecRequestBodyAccess On |
| 40 | +# SecRemoteRulesFailAction Warn |
| 41 | +# SecRule REMOTE_ADDR "\@ipMatchFromFile https://www.modsecurity.org/modsecurity-regression-test-404.txt" "id:10500,pass" |
| 42 | +# ), |
| 43 | +# match_log => { |
| 44 | +# 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], |
| 45 | +# }, |
| 46 | +# match_response => { |
| 47 | +# status => qr/^404$/, |
| 48 | +# }, |
| 49 | +# request => new HTTP::Request( |
| 50 | +# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", |
| 51 | +# [ |
| 52 | +# "Content-Type" => "application/x-www-form-urlencoded", |
| 53 | +# ], |
| 54 | +# # Args |
| 55 | +# "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
| 56 | +# ), |
| 57 | +#}, |
| 58 | +#{ |
| 59 | +# type => "misc", |
| 60 | +# comment => "ipMatchFromFile - bad certificate name", |
| 61 | +# conf => qq( |
| 62 | +# SecRuleEngine On |
| 63 | +# SecDebugLog $ENV{DEBUG_LOG} |
| 64 | +# SecDebugLogLevel 9 |
| 65 | +# SecRequestBodyAccess On |
| 66 | +# SecRemoteRulesFailAction Warn |
| 67 | +# SecRule REMOTE_ADDR "\@ipMatchFromFile https://status.modsecurity.org/modsecurity-regression-test-huge-ip-list.txt" "id:10500,pass" |
| 68 | +# ), |
| 69 | +# match_log => { |
| 70 | +# error => [ qr/ModSecurity: Problems loading external resources: Failed to download: \"https:\/\/status.modsecurity.org\/modsecurity-regression-test-huge-ip-list.txt\" error: [SSL peer certificate or SSH remote key was not OK.|Couldn't connect to server.]/, 1], |
| 71 | +# }, |
| 72 | +#}, |
71 | 73 |
|
0 commit comments