Skip to content

Instantly share code, notes, and snippets.



Last active Nov 8, 2017
What would you like to do?
[modsecurity][apache] Mod_Security > 2.9 installation for CentOS 7 / Fedora 25 with owasp rules
echo "Installing ModSecurity ... "
yum install yajl -y 1>/dev/null
rpm -ivh 1>/dev/null
rpm -ivh 1>/dev/null
cd /etc/httpd
mkdir crs
cd crs
echo "Installing ModSecurity Rules ... "
git clone 1>/dev/null
mv owasp-modsecurity-crs/crs-setup.{conf.example,conf}
mv owasp-modsecurity-crs/rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.{conf.example,conf}
mv owasp-modsecurity-crs/rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.{conf.example,conf}
cd ..
sed -in 's/modsecurity.d\/activated_rules/crs\/owasp-modsecurity-crs/g' conf.d/mod_security.conf
sed -in 's/modsecurity.d\/local_rules/crs\/owasp-modsecurity-crs\/rules/g' conf.d/mod_security.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment