forked from owasp-modsecurity/ModSecurity
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds SecRemoteRules regression tests.
Added two test cases for SecRemoteRules. Contents are loaded from https://www.modsecurity.org
- Loading branch information
Felipe Zimmerle
committed
Nov 14, 2014
1 parent
b5398ab
commit 86787f2
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### SecRemoteRules | ||
|
||
{ | ||
type => "misc", | ||
comment => "SecRemoteRules load", | ||
conf => qq( | ||
SecRuleEngine On | ||
SecDebugLog $ENV{DEBUG_LOG} | ||
SecDebugLogLevel 9 | ||
SecRequestBodyAccess On | ||
SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt" | ||
), | ||
match_log => { | ||
error => [ qr/ModSecurity: Loaded 1 rule/, 1], | ||
}, | ||
}, | ||
{ | ||
type => "misc", | ||
comment => "SecRemoteRules apply some remote rules", | ||
conf => qq( | ||
SecRuleEngine On | ||
SecDebugLog $ENV{DEBUG_LOG} | ||
SecDebugLogLevel 9 | ||
SecRequestBodyAccess On | ||
SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt" | ||
), | ||
match_log => { | ||
error => [ qr/ModSecurity: Warning. Matched phrase \"127.0.0.1\" at REQUEST_FILENAME./, 1], | ||
debug => [ qr/Matched phrase \"127.0.0.1\" at REQUEST_FILENAME/, 1 ], | ||
}, | ||
match_response => { | ||
status => qr/^404$/, | ||
}, | ||
request => new HTTP::Request( | ||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", | ||
[ | ||
"Content-Type" => "application/x-www-form-urlencoded", | ||
], | ||
# Args | ||
"some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" | ||
), | ||
}, | ||
|