Dies ist eine alte Version des Dokuments!
WAF Web Application Firewall
Bei Hetzner habe ich ein paar WAFs, genauer gesagt ModSecurity unter NGINX konfiguriert.
Dafür habe ich ein paar Cusom Rules konfiguriert die Zugriff nur von bestimmten IPs zulassen:
Custom Rules
- custom.conf
SecRule REQUEST_FILENAME "@endsWith /api.php" \ "id:2000, \ chain, \ phase:1, \ log, \ pass" SecRule REMOTE_ADDR "@ipMatchFromFile ip_allowlist.txt" \ ctl:ruleEngine=DetectionOnly SecRule REQUEST_FILENAME "@endsWith /api.php" \ "id:2001, \ phase:1, \ t:lowercase, \ log, \ deny, \ msg:'Zugriff verboten'" SecRule REQUEST_URI "@eq /api/getContact.php" \ "id:2002, \ chain, \ phase:1, \ log, \ pass" SecRule REMOTE_ADDR "@ipMatchFromFile ip_allowlist.txt" \ ctl:ruleEngine=DetectionOnly SecRule REQUEST_URI "@eq /api/getContact.php" \ "id:2003, \ phase:1, \ t:lowercase, \ log, \ deny, \ msg:'Zugriff verboten'"