A PrestaShop module by Carles Mateo. Block abusive IPs and URL scanners
(.env,
wp-config.php,
.git and custom patterns).
Manual IP/range deny rules, automatic offender collection, CSV & ufw export.
Description
PHP PrestaShop Firewall protects your shop by blocking abusive visitors as early as possible in the request, before PrestaShop dispatches the controller.
When protection is enabled, every request is checked:
Built-in scanner signatures: .env, wp-config.php, .git
and a large list of known probes. You can add your own substring patterns too.
Choose which header carries the real visitor IP: REMOTE_ADDR,
Cloudflare (CF-Connecting-IP), X-Forwarded-For,
X-Real-IP, or a custom header — so the module works correctly behind nginx,
Varnish, a load balancer or a CDN.
When protection is enabled, the deny check runs as the dispatcher resolves the controller, before it executes, so bad requests are rejected while consuming as little CPU and resources as possible.
ufw insert 1 deny from 185.225.69.214 to any.Specifications
Frequently Asked Questions
Yes. In the settings, choose the header that carries the real client IP for your setup. Only trust a forwarded header if your server genuinely sits behind that proxy, otherwise the value can be spoofed.
Nothing is blocked and no offenders are collected. Your existing rules are kept.
Scalar settings live in PrestaShop's configuration store; the manual deny rules, the automatic offenders and the request log each live in their own custom database table created by the module on install.
Yes. Export the automatic offenders as a ufw script or as CSV from the settings page.
It is very fast and really useful. Every site should have a plugin like this.