mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Merge 2.5.x changes into trunk.
This commit is contained in:
parent
a16eb9677c
commit
31ddf4c86c
@ -362,7 +362,7 @@
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
# Zero length part name should not crash
|
# Zero length part name should not crash
|
||||||
{
|
{
|
||||||
type => "misc",
|
type => "misc",
|
||||||
comment => "multipart parser (zero length part name)",
|
comment => "multipart parser (zero length part name)",
|
||||||
@ -371,16 +371,16 @@
|
|||||||
SecDebugLog $ENV{DEBUG_LOG}
|
SecDebugLog $ENV{DEBUG_LOG}
|
||||||
SecDebugLogLevel 9
|
SecDebugLogLevel 9
|
||||||
SecRequestBodyAccess On
|
SecRequestBodyAccess On
|
||||||
SecRule MULTIPART_STRICT_ERROR "\@eq 1" "phase:2,deny"
|
#SecRule MULTIPART_STRICT_ERROR "\@eq 1" "phase:2,deny,status:403"
|
||||||
SecRule MULTIPART_UNMATCHED_BOUNDARY "\@eq 1" "phase:2,deny"
|
SecRule MULTIPART_UNMATCHED_BOUNDARY "\@eq 1" "phase:2,deny,status:403"
|
||||||
SecRule REQBODY_PROCESSOR_ERROR "\@eq 1" "phase:2,deny"
|
SecRule REQBODY_PROCESSOR_ERROR "\@eq 1" "phase:2,deny,status:403"
|
||||||
),
|
),
|
||||||
match_log => {
|
match_log => {
|
||||||
debug => [ qr/Adding request argument \(BODY\): name "a", value "1".*Invalid part header \(header name missing\)/s, 1 ],
|
debug => [ qr/name: a.*variable: 1.*Invalid part header \(header name missing\)/s, 1 ],
|
||||||
-debug => [ qr/Adding request argument \(BODY\): name "b"/s, 1 ],
|
-debug => [ qr/Adding request argument \(BODY\): name "b"/s, 1 ],
|
||||||
},
|
},
|
||||||
match_response => {
|
match_response => {
|
||||||
status => qr/^200$/,
|
status => qr/^403$/,
|
||||||
},
|
},
|
||||||
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",
|
||||||
|
@ -482,31 +482,29 @@
|
|||||||
# GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt?host=www.modsecurity.org",
|
# GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt?host=www.modsecurity.org",
|
||||||
# ),
|
# ),
|
||||||
#},
|
#},
|
||||||
{
|
#{
|
||||||
type => "target",
|
# type => "target",
|
||||||
comment => "GEO (failed lookup)",
|
# comment => "GEO (failed lookup)",
|
||||||
conf => qq(
|
# conf => qq(
|
||||||
SecRuleEngine On
|
# SecRuleEngine On
|
||||||
SecDebugLog $ENV{DEBUG_LOG}
|
# SecDebugLog $ENV{DEBUG_LOG}
|
||||||
SecDebugLogLevel 9
|
# SecDebugLogLevel 9
|
||||||
SecGeoLookupDB GeoLiteCity.dat
|
# SecGeoLookupDB GeoLiteCity.dat
|
||||||
SecRule REMOTE_ADDR "\@geoLookup" "pass,nolog"
|
|
||||||
SecRule \&GEO "\@eq 0" "deny,status:403,msg:'Failed to lookup IP'"
|
|
||||||
# SecRule ARGS:ip "\@geoLookup" "phase:2,log,pass,t:none"
|
# SecRule ARGS:ip "\@geoLookup" "phase:2,log,pass,t:none"
|
||||||
# SecRule \&GEO "\@eq 0" "phase:2,log,deny,status:403,t:none"
|
# SecRule \&GEO "\@eq 0" "phase:2,log,deny,status:403,t:none"
|
||||||
# SecRule ARGS:badip "\@geoLookup" "phase:2,log,pass,t:none"
|
# SecRule ARGS:badip "\@geoLookup" "phase:2,log,pass,t:none"
|
||||||
# SecRule \&GEO "!\@eq 0" "phase:2,log,deny,status:403,t:none"
|
# SecRule \&GEO "!\@eq 0" "phase:2,log,deny,status:403,t:none"
|
||||||
),
|
# ),
|
||||||
match_log => {
|
# match_log => {
|
||||||
-debug => [ qr/Geo lookup for "127\.0\.0\.1" succeeded/si, 1 ],
|
# -debug => [ qr/Geo lookup for "127\.0\.0\.1" succeeded/si, 1 ],
|
||||||
},
|
# },
|
||||||
match_response => {
|
# match_response => {
|
||||||
status => qr/^200$/,
|
# status => qr/^200$/,
|
||||||
},
|
# },
|
||||||
request => new HTTP::Request(
|
# request => new HTTP::Request(
|
||||||
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt?ip=216.75.21.122&badip=127.0.0.1",
|
# GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt?ip=216.75.21.122&badip=127.0.0.1",
|
||||||
),
|
# ),
|
||||||
},
|
#},
|
||||||
|
|
||||||
# TODO: ENV
|
# TODO: ENV
|
||||||
# TODO: FILES
|
# TODO: FILES
|
||||||
|
Loading…
x
Reference in New Issue
Block a user