Web application firewall

Web application firewall (WAF)

A web application firewall (WAF) filters the web traffic going to your site and blocks requests that look like attacks, such as SQL injection or cross-site scripting.

Checked 27/11/2026 against 4 sources. Next review 27/05/2027.

A WAF helps protect web applications by filtering and monitoring HTTP traffic between the application and the internet [1]. It applies a set of rules to each request, and those rules generally cover common attacks such as cross-site scripting (XSS) and SQL injection [2]. It acts as a reverse proxy: visitors pass through it before they reach your server [1]. A WAF works at layer 7 and is not designed to stop every kind of attack, so it is one tool among several [1]. A cloud-based one can be as simple as a DNS change [1].

What does a WAF actually block?

Cloudflare says a WAF typically protects against cross-site forgery, cross-site scripting, file inclusion and SQL injection [1]. Its managed rulesets add zero-day vulnerabilities, top-10 attack techniques, use of stolen or leaked credentials and extraction of sensitive data [4]. You can also write your own rules, and set rate limits for requests matching an expression, with an action when the limit is reached [3].

A login page under pressure

Say a bot sends 3,000 login attempts a minute to your members' page, and your normal peak is 60. A rate limiting rule can slow or block that address. Cloudflare notes that during a DDoS attack, rate limiting can be applied quickly by changing WAF policies [1].

How is a WAF different from a normal firewall or proxy?

A proxy usually protects the visitor. A WAF protects the server: all clients must pass through it before they reach the application [1][2]. OWASP puts it briefly: proxies generally protect clients, WAFs protect servers [2]. Cloudflare places a WAF at layer 7 of the OSI model [1]. Part of its value is how fast rules can change: a new policy can answer a new attack vector quickly [1]. Cloudflare's rules use a flexible expression syntax that filters traffic by request properties such as IP address, URL path, headers and body content [3]. OWASP adds that a WAF may be customised to an application, and that the effort can be significant and has to be kept up as the application changes [2].

Does a WAF use a blocklist or an allowlist?

ModelHow it decides
Blocklist (negative security)Blocks known attacks and lets the rest through [1]
Allowlist (positive security)Admits only traffic that has been pre-approved [1]
HybridApplies both, which many WAFs offer [1]

Should the WAF run on my server, my network or in the cloud?

TypeTrade-off
Network-basedUsually hardware. Low latency, but the most expensive and needs physical upkeep [1]
Host-basedBuilt into the application's software. Cheaper and more customisable, but uses server resources and engineering time [1]
Cloud-basedEasy to start, often just a DNS change to redirect traffic, with a monthly or annual fee. You hand control to a third party [1]

Of the three, cloud-based is the one that needs only a DNS change rather than new equipment [1]. Cloudflare's WAF is available on all of its plans [3].

What does Cloudflare's free plan include?

FeatureFree planPaid plans
Managed rulesFree Managed Ruleset only, covering high-impact and widely exploited vulnerabilities [3][4]Cloudflare Managed Ruleset and Cloudflare OWASP Core Ruleset on Pro and above [4]
Rate limiting rulesOne rule [3]Rate limiting rules on Pro, Business and Enterprise; Advanced Rate Limiting is a paid add-on on Enterprise [3]
Custom rulesYes [3]Yes [3]

Cloudflare's OWASP Core Ruleset uses a scoring model: each matching rule adds to a threat score, and the WAF acts when the score passes a threshold [4].

Questions people ask

Do I need a WAF if I already use a CDN?

A CDN delivers your content from nearby servers. A WAF filters requests for attacks. They are separate jobs, though one provider can offer both. Cloudflare lists its WAF as available on all plans [3].

Will a WAF stop every attack?

No. Cloudflare says a WAF is a layer 7 defence and is not designed to defend against all types of attack. It is usually one part of a set of tools [1].

What is the difference between a blocklist and an allowlist WAF?

A blocklist WAF protects against known attacks. An allowlist WAF only admits traffic that has been pre-approved. Cloudflare says many WAFs offer a hybrid of both [1].

See also

  • CDN A CDN is a group of servers in many places that keep copies of your website's files so each visitor gets them from a server close to them.
  • HTTPS HTTPS is the secure version of HTTP, the language browsers and websites speak, with everything sent between them encrypted.
  • SSL certificate An SSL certificate is a digital file that proves your website is who it claims to be and lets browsers connect to it over encrypted HTTPS.
  • DNS DNS is the internet's address book: it turns a domain name like example.com into the number a computer needs to find your website or mail server.
  • Web hosting Web hosting is renting space on a web server that stays connected to the internet, so your website's files can be sent to anyone who asks.
  • Data breach A data breach is unauthorised access to or loss of personal data. In Singapore, a notifiable one must be reported to the PDPC within 3 calendar days of your assessment.

References

  1. What is a WAF? Web Application Firewall explained, Cloudflare Learning Center. Read 27/11/2026.A WAF or web application firewall helps protect web applications by filtering and monitoring HTTP traffic between a web application and the Internet.
  2. Web Application Firewall, OWASP Foundation. Read 27/11/2026.While proxies generally protect clients, WAFs protect servers.
  3. Web Application Firewall (WAF) overview, Cloudflare Docs. Read 27/11/2026.Define rate limits for incoming requests matching an expression, and the action to take when those rate limits are reached.
  4. WAF Managed Rules, Cloudflare Docs. Read 27/11/2026.Available on all Cloudflare plans. Provides protection against high-impact and widely exploited vulnerabilities.