A normal firewall decides which network connections are allowed. A web application firewall looks inside web requests and blocks known attack patterns: SQL injection, cross-site scripting, malicious bots and brute-force logins. It sits in front of your site like a doorman.
Types of WAF
| Type | Where it runs | Pros | Cons |
|---|---|---|---|
| Cloud / CDN WAF | At the provider’s edge | Blocks traffic before it reaches your server, also helps against DDoS | DNS or proxy change needed |
| Server WAF | On the web server (e.g. ModSecurity rules) | Often provided by hosts | Uses server resources |
| CMS plugin | Inside your application | Knows the CMS, easy to install | Attacks still reach your server |
Background on CDNs: CDN explained and DDoS protection.
Useful rules for small sites
- Rate limiting on login pages, password reset and contact forms.
- Blocking access to admin areas from countries you never work from – with care.
- Managed rule sets that block known exploits.
- Challenging suspicious bots instead of blocking them outright.
- Blocking requests for files that should never be public (backups,
.env,.git).
Monitoring
Look at the WAF events after enabling: which rules fire, and are real visitors affected? Adjust before switching from “log” to “block” mode where possible.
Frequently asked questions
Does a small website need a WAF?
Not strictly, but many hosts and CDNs include basic WAF rules for free. If you run WordPress or a webshop, it is a valuable extra layer.
Can a WAF block real visitors?
Yes, overly strict rules cause false positives. Monitor the logs after enabling and whitelist legitimate traffic where needed.