A web application firewall — commonly abbreviated to WAF — is a security layer that sits between your website and incoming internet traffic. It inspects each request before it reaches your server and blocks anything that matches the patterns of known malicious activity. Think of it as a security filter that catches suspicious traffic before it has the chance to cause damage.
How a WAF Differs from a Network Firewall
A traditional network firewall works at the IP and port level — it blocks or allows traffic based on source, destination, and protocol. A WAF operates at the application layer, understanding the content of HTTP requests. It can identify and block attacks like SQL injection, cross-site scripting (XSS), path traversal, and bot traffic that would pass straight through a network firewall because they look like normal web requests on the surface.
What Threats Does a WAF Protect Against?
- SQL injection — attempts to manipulate your database by embedding malicious SQL code in form inputs or URL parameters
- Cross-site scripting (XSS) — injecting malicious scripts into your pages that execute in visitors' browsers
- DDoS attacks — some WAFs rate-limit requests from individual IP addresses to mitigate distributed denial-of-service attacks
- Bad bots — automated scrapers, vulnerability scanners, and credential stuffing bots that consume server resources and probe for weaknesses
- Known exploit patterns — attacks targeting vulnerabilities in specific software versions
- Brute-force login attempts — repeated automated attempts to guess passwords
Types of WAF
Cloud-based WAF — traffic passes through a third-party service before reaching your server. Cloudflare's free tier is a widely used example. These are easy to set up and require no changes to your hosting configuration.
Host-based WAF — a WAF built into or installed on your hosting server. Some hosting providers include this at the server level. ModSecurity is a commonly used open-source host-based WAF.
Plugin-based WAF (for WordPress) — plugins like Wordfence implement a WAF at the PHP application level. This is the easiest option for WordPress users and provides meaningful protection, though it operates after the request reaches the server rather than before.
Does Your Website Need a WAF?
Any website that is publicly accessible benefits from WAF protection. For small business websites and blogs, the most practical options are:
- Cloudflare's free CDN and WAF — easy to set up via your domain's DNS, provides good baseline protection
- Wordfence (for WordPress) — free plugin with built-in WAF functionality
- Hosting that includes server-level WAF and security scanning as standard
You do not need to pay for an enterprise WAF to get meaningful protection. Cloudflare's free tier and a reputable security plugin provide a solid foundation at no cost.
Common Mistakes
- Assuming a WAF alone is sufficient. A WAF is one layer of defence, not a complete security solution. It works best alongside updated software, strong passwords, SSL, and regular backups.
- Setting a WAF to blocking mode without testing first. Some legitimate requests can trigger WAF rules, temporarily blocking real visitors. Start in monitoring mode and review false positives before enabling full blocking.
- Choosing hosting with no server-level security features. If your host provides no firewall, malware scanning, or DDoS protection, you are relying entirely on application-level measures.
A web application firewall is an effective and often low-cost way to add a meaningful security layer to your website. For most small websites, the free options are entirely adequate.
Need hosting with server-level security features? View Eazyhosting's security features — or explore our hosting plans.