Free, independent guides since 2010

Security & privacy

Web application firewalls (WAF) explained

What a web application firewall does, cloud WAFs versus plugin and server firewalls, rate limiting, bot protection, false positives and whether a small website needs one.

<guide section="Security & privacy" type="article" read="1 min"/>

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

TypeWhere it runsProsCons
Cloud / CDN WAFAt the provider’s edgeBlocks traffic before it reaches your server, also helps against DDoSDNS or proxy change needed
Server WAFOn the web server (e.g. ModSecurity rules)Often provided by hostsUses server resources
CMS pluginInside your applicationKnows the CMS, easy to installAttacks 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.