mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Analog of what we have for Lua, Python support is now added by this commit. This is very experimental.
22 lines
403 B
Python
Executable File
22 lines
403 B
Python
Executable File
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from modsecurity import ModSecurity
|
|
|
|
class ModSecurityExtension(ModSecurity):
|
|
def process(self):
|
|
self.log(8, "Python test message.")
|
|
return False
|
|
|
|
if __name__ == "__main__":
|
|
myExtension = ModSecurityExtension()
|
|
|
|
# Process the content.
|
|
ret = myExtension.process()
|
|
|
|
if ret == True:
|
|
print("Matched!")
|
|
else:
|
|
print("_not_ matched")
|
|
|