Fix SecRemoteRules test - that's need anymore

This commit is contained in:
Ervin Hegedus 2025-07-28 16:14:06 +02:00
parent bc01714ca1
commit 1362a30e93
No known key found for this signature in database
GPG Key ID: 5FA5BC3F5EC41F61

View File

@ -1,43 +1,45 @@
### SecRemoteRules ### SecRemoteRules
# probably no need these anymore
{ # plus it's hard to set up an infrastucture
type => "misc", #
comment => "SecRemoteRules load", #{
conf => qq( # type => "misc",
SecRuleEngine On # comment => "SecRemoteRules load",
SecDebugLog $ENV{DEBUG_LOG} # conf => qq(
SecDebugLogLevel 9 # SecRuleEngine On
SecRequestBodyAccess On # SecDebugLog $ENV{DEBUG_LOG}
SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt" # SecDebugLogLevel 9
), # SecRequestBodyAccess On
match_log => { # SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt"
error => [ qr/ModSecurity: Loaded 1 rule/, 1], # ),
}, # match_log => {
}, # error => [ qr/ModSecurity: Loaded 1 rule/, 1],
{ # },
type => "misc", #},
comment => "SecRemoteRules apply some remote rules", #{
conf => qq( # type => "misc",
SecRuleEngine On # comment => "SecRemoteRules apply some remote rules",
SecDebugLog $ENV{DEBUG_LOG} # conf => qq(
SecDebugLogLevel 9 # SecRuleEngine On
SecRequestBodyAccess On # SecDebugLog $ENV{DEBUG_LOG}
SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt" # SecDebugLogLevel 9
), # SecRequestBodyAccess On
match_log => { # SecRemoteRules 123 "https://www.modsecurity.org/modsecurity-regression-test-secremoterules.txt"
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_log => {
}, # error => [ qr/ModSecurity: Warning. Matched phrase \"127.0.0.1\" at REQUEST_FILENAME./, 1],
match_response => { # debug => [ qr/Matched phrase \"127.0.0.1\" at REQUEST_FILENAME/, 1 ],
status => qr/^404$/, # },
}, # match_response => {
request => new HTTP::Request( # status => qr/^404$/,
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html", # },
[ # request => new HTTP::Request(
"Content-Type" => "application/x-www-form-urlencoded", # POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/127.0.0.1.html",
], # [
# Args # "Content-Type" => "application/x-www-form-urlencoded",
"some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" # ],
), # # Args
}, # "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--"
# ),
#},