mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-18 15:16:13 +03:00
Analog of what we have for Lua, Python support is now added by this commit. This is very experimental.
25 lines
511 B
Perl
25 lines
511 B
Perl
### Test for SecRuleScript
|
|
|
|
# Python
|
|
{
|
|
type => "rule",
|
|
comment => "SecRuleScript (Python match)",
|
|
conf => qq(
|
|
SecRuleEngine On
|
|
SecDebugLog $ENV{DEBUG_LOG}
|
|
SecDebugLogLevel 9
|
|
SecRuleScript "script.py" "phase:2,deny"
|
|
),
|
|
match_log => {
|
|
-error => [ qr/Python script matched\./, 1 ],
|
|
debug => [ qr/Python test message\./, 1 ],
|
|
},
|
|
match_response => {
|
|
status => qr/^200$/,
|
|
},
|
|
request => new HTTP::Request(
|
|
GET => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/test.txt?foo=bar&foo2=bar2",
|
|
),
|
|
}
|
|
|