Closed sharmashivanand closed 2 years ago
Hello @sharmashivanand ,
One option available to you is to use a TX variable to hold the string that you want to share with your lua script and use that same TX variable content for your 'logdata' (etc.) action. Have a look at https://github.com/SpiderLabs/ModSecurity/issues/2527 for a roughly similar idea.
How to access rule.msg or rule.tag via lua?
modsecurity_rules 'SecRule RESPONSE_STATUS "@streq 403" "id:221,log,logdata:\'!!!!!!!!!!!!! CAUGHT !!!!!!!!!!!!!!!!\',exec:/tmp/test.lua"';
Here's the Lua script