owasp-modsecurity / ModSecurity-nginx

ModSecurity v3 Nginx Connector
Apache License 2.0
1.59k stars 282 forks source link

Adding more info to the blocking response (403) #161

Closed kjakub closed 5 years ago

kjakub commented 5 years ago

Can i somehow add more info such as which rule blocking etc to the response ?

victorhora commented 5 years ago

You mean providing info on which rule was blocked on the actual response body that gets sent to the user? If this is what you need, I'm afraid it's not supported by the engine or the connector itself. This information is available on the audit_log or Nginx error_log.

But you might be able to write a Lua script to extract the log content once a rule a triggered and save or send that data somewhere else, like in a text/HTML file that could be read and accessible by the client.

Hope that helps.