mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 02:10:36 +03:00
Adds support to Python scripts on ModSecurity core.
Analog of what we have for Lua, Python support is now added by this commit. This is very experimental.
This commit is contained in:
24
tests/regression/rule/01-python-script.t
Normal file
24
tests/regression/rule/01-python-script.t
Normal file
@@ -0,0 +1,24 @@
|
||||
### 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",
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user