can modsecurity check response body for substrings like password, admin, config and etc…
- User
can modsecurity check response body for substrings like password, admin, config and etc and block it with 403 code ?
- Assistant
Yes, ModSecurity can inspect the response body and block responses based on matching substrings like "password", "admin", "config", etc., returning a 403 status code if such content is found.
How to do it:
- Enable Response Body Inspection:
By default, ModSecurity focuses on the request (client to server), but you can configure it to inspect the response (server to client).
To inspect the response body, you need to enable
SecResponseBodyAccess:SecResponseBodyAccess On