Felipe Zimmerle 2440a23921 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.
2014-09-29 14:34:03 -07:00

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")