Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Standard-Konfiguration von Apache ModSecurity2 unter Debian 11
- # Pakete installieren
- apt-get install modsecurity-crs libapache2-mod-security2
- # Konfiguration anpassen
- cd /etc/modsecurity/
- # Standard-Konfig aktivieren
- cp modsecurity.conf-recommended modsecurity.conf
- # Engine einschalten
- sed -i 's/SecRuleEngine DetectionOnly/SecRuleEngine On/;' modsecurity.conf
- # Modul im Apache aktivieren (wird meist schon beim apt-get gemacht)
- a2enmod security2
- # Konfiguration prüfen
- apachectl configtest
- # Apache neu starten
- apachectl graceful
- # finde blockierende Regeln
- perl -ne 'if (/id "(\d*)"/){print "$1\n"}' /var/log/apache2/modsec_audit.log | sort -u | xargs
- # false positive Regeln für das passende Verzeichnis in der Apache-Konfig deaktivieren
- SecRuleRemoveByID ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement