ModSecurity Web Application Firewall

ModSecurity is a Web Application Firewall. Protect sites from SQL injection and Application level hacking.

To install ModSecurity on Ubuntu/Debian with Apache, run

apt install libapache2-mod-security2 -y

verify Apache module is installed with

Advertisement

apachectl -M | grep security

Enable config file

mv /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf

Update config

sed -i "s/SecRuleEngine DetectionOnly/SecRuleEngine On/" /etc/modsecurity/modsecurity.conf
sed -i "s/SecResponseBodyAccess On/SecResponseBodyAccess Off/" /etc/modsecurity/modsecurity.conf

Restart Apache

systemctl restart apache2
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement