mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Fix status engine tests
This commit is contained in:
parent
33791eb14a
commit
bc01714ca1
@ -1,28 +1,28 @@
|
|||||||
### Test the SecStatusEngine
|
### Test the SecStatusEngine
|
||||||
|
|
||||||
# On
|
## On
|
||||||
{
|
#{
|
||||||
type => "misc",
|
# type => "misc",
|
||||||
comment => "Setting SecStatusEngine to On",
|
# comment => "Setting SecStatusEngine to On",
|
||||||
conf => qq(
|
# conf => qq(
|
||||||
SecRuleEngine On
|
# SecRuleEngine On
|
||||||
SecStatusEngine On
|
# SecStatusEngine On
|
||||||
),
|
# ),
|
||||||
match_log => {
|
# match_log => {
|
||||||
error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
# error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
||||||
-error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
|
# -error => [ qr/Status engine is currently disabled, enable it by set SecStatusEngine to On/, 1],
|
||||||
},
|
# },
|
||||||
match_response => {
|
# match_response => {
|
||||||
status => qr/^200$/,
|
# status => qr/^200$/,
|
||||||
},
|
# },
|
||||||
request => new HTTP::Request(
|
# request => new HTTP::Request(
|
||||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||||
[
|
# [
|
||||||
"Content-Type" => "application/x-www-form-urlencoded",
|
# "Content-Type" => "application/x-www-form-urlencoded",
|
||||||
],
|
# ],
|
||||||
"arg1=val1&arg2=val2",
|
# "arg1=val1&arg2=val2",
|
||||||
),
|
# ),
|
||||||
},
|
#},
|
||||||
# Off
|
# Off
|
||||||
{
|
{
|
||||||
type => "misc",
|
type => "misc",
|
||||||
@ -46,78 +46,78 @@
|
|||||||
"arg1=val1&arg2=val2",
|
"arg1=val1&arg2=val2",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
# On and SecServerSignature
|
## On and SecServerSignature
|
||||||
{
|
#{
|
||||||
type => "misc",
|
# type => "misc",
|
||||||
comment => "SecStatusEngine On using SecServerSignature",
|
# comment => "SecStatusEngine On using SecServerSignature",
|
||||||
conf => qq(
|
# conf => qq(
|
||||||
SecRuleEngine On
|
# SecRuleEngine On
|
||||||
SecServerSignature "SpiderServer v0.1a"
|
# SecServerSignature "SpiderServer v0.1a"
|
||||||
SecStatusEngine On
|
# SecStatusEngine On
|
||||||
),
|
# ),
|
||||||
match_log => {
|
# match_log => {
|
||||||
error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
# error => [ qr/ModSecurity: StatusEngine call successfully sent/, 1],
|
||||||
-error => [ qr/StatusEngine call: .*SpiderServer v0.1a.*/, 1],
|
# -error => [ qr/StatusEngine call: .*SpiderServer v0.1a.*/, 1],
|
||||||
},
|
# },
|
||||||
match_response => {
|
# match_response => {
|
||||||
status => qr/^200$/,
|
# status => qr/^200$/,
|
||||||
},
|
# },
|
||||||
request => new HTTP::Request(
|
# request => new HTTP::Request(
|
||||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||||
[
|
# [
|
||||||
"Content-Type" => "application/x-www-form-urlencoded",
|
# "Content-Type" => "application/x-www-form-urlencoded",
|
||||||
],
|
# ],
|
||||||
"arg1=val1&arg2=val2",
|
# "arg1=val1&arg2=val2",
|
||||||
),
|
# ),
|
||||||
},
|
#},
|
||||||
# On and SecServerSignature
|
## On and SecServerSignature
|
||||||
{
|
#{
|
||||||
type => "misc",
|
# type => "misc",
|
||||||
comment => "SecStatusEngine On/SecServerSignature - checking signature",
|
# comment => "SecStatusEngine On/SecServerSignature - checking signature",
|
||||||
conf => qq(
|
# conf => qq(
|
||||||
SecRuleEngine On
|
# SecRuleEngine On
|
||||||
SecServerSignature "SpiderServer v0.1a"
|
# SecServerSignature "SpiderServer v0.1a"
|
||||||
SecStatusEngine On
|
# SecStatusEngine On
|
||||||
),
|
# ),
|
||||||
match_log => {
|
# match_log => {
|
||||||
error => {
|
# error => {
|
||||||
apache => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,Apache/, 1],
|
# apache => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,Apache/, 1],
|
||||||
nginx => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,nginx/, 1],
|
# nginx => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,nginx/, 1],
|
||||||
}
|
# }
|
||||||
},
|
# },
|
||||||
match_response => {
|
# match_response => {
|
||||||
status => qr/^200$/,
|
# status => qr/^200$/,
|
||||||
},
|
# },
|
||||||
request => new HTTP::Request(
|
# request => new HTTP::Request(
|
||||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||||
[
|
# [
|
||||||
"Content-Type" => "application/x-www-form-urlencoded",
|
# "Content-Type" => "application/x-www-form-urlencoded",
|
||||||
],
|
# ],
|
||||||
"arg1=val1&arg2=val2",
|
# "arg1=val1&arg2=val2",
|
||||||
),
|
# ),
|
||||||
},
|
#},
|
||||||
# On and SecServerSignature
|
## On and SecServerSignature
|
||||||
{
|
#{
|
||||||
type => "misc",
|
# type => "misc",
|
||||||
comment => "SecStatusEngine On - checking signature",
|
# comment => "SecStatusEngine On - checking signature",
|
||||||
conf => qq(
|
# conf => qq(
|
||||||
SecStatusEngine On
|
# SecStatusEngine On
|
||||||
),
|
# ),
|
||||||
match_log => {
|
# match_log => {
|
||||||
error => {
|
# error => {
|
||||||
apache => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,Apache/, 1],
|
# apache => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,Apache/, 1],
|
||||||
nginx => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,nginx/, 1],
|
# nginx => [ qr/StatusEngine call: \"[0-9]+.[0-9]+.[0-9]+[-RC]*[0-9]*\,nginx/, 1],
|
||||||
}
|
# }
|
||||||
},
|
# },
|
||||||
match_response => {
|
# match_response => {
|
||||||
status => qr/^200$/,
|
# status => qr/^200$/,
|
||||||
},
|
# },
|
||||||
request => new HTTP::Request(
|
# request => new HTTP::Request(
|
||||||
POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
# POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt",
|
||||||
[
|
# [
|
||||||
"Content-Type" => "application/x-www-form-urlencoded",
|
# "Content-Type" => "application/x-www-form-urlencoded",
|
||||||
],
|
# ],
|
||||||
"arg1=val1&arg2=val2",
|
# "arg1=val1&arg2=val2",
|
||||||
),
|
# ),
|
||||||
},
|
#},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user