---
title: "Web application firewall (WAF)"
description: "A filter in front of a website that checks each incoming request against rules and stops the ones that look like attacks before they reach the site."
url: https://ursy.com/wiki/web-application-firewall/
updated: 2026-11-26T15:46:05+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/web-application-firewall/
---

# Web application firewall (WAF)

> A filter in front of a website that checks each incoming request against rules and stops the ones that look like attacks before they reach the site.

**A web application firewall (WAF) is a filter in front of a website that checks each incoming request against sets of rules and stops the ones that look like attacks before they reach the site.** Rules can look at the [IP address](https://ursy.com/wiki/ip-address/), the address path, headers and the request body. A WAF is useful for almost any site. Its risk is the reverse: a rule set too tight can block customers, payment callbacks, [Googlebot](https://ursy.com/wiki/googlebot/) or the AI crawlers you want.

## What is a WAF? {#what-is-a-waf}

[OWASP](https://community.owasp.org/Web_Application_Firewall), the open web security project, calls it an application firewall for HTTP applications. It applies rule sets to [HTTP](https://ursy.com/wiki/http/) traffic and sits in front of the site like a reverse proxy. OWASP says these rules generally cover common attacks such as cross-site scripting (XSS) and SQL injection. A WAF often comes as part of a [CDN](https://ursy.com/wiki/cdn/), so it filters requests before they reach your [origin server](https://ursy.com/wiki/origin-server/).

## How does it work? {#how-does-it-work}

Every request is compared with the rules. [Cloudflare’s WAF docs](https://developers.cloudflare.com/waf/), as one example, say rules can filter by IP address, [URL](https://ursy.com/wiki/url/) path, headers and body content. A request that matches can be blocked, slowed, or sent a check such as a [managed challenge](https://ursy.com/wiki/managed-challenge/) or [CAPTCHA](https://ursy.com/wiki/captcha/). A blocked visitor usually gets a [status code](https://ursy.com/wiki/http-status-code/) such as [403 Forbidden](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403): MDN says it means the server understood the request but refused to process it.

## The main kinds of rule {#the-main-kinds-of-rule}

Cloudflare’s WAF, as one example, splits the work like this:

| Part | What it does |
| --- | --- |
| Managed rules | Pre-configured rule sets you switch on for immediate protection, kept up to date by the provider |
| Custom rules | Your own rules to protect the site and its APIs from malicious traffic |
| Rate limiting rules | Limits on how many matching requests are allowed in a set time |
| Security Events | A log of the requests the rules stopped or challenged, based on sampled logs |
| Security Analytics | Information about all incoming HTTP requests, including those no rule touched |

[Its managed rules page](https://developers.cloudflare.com/waf/managed-rules/) lists a Free Managed Ruleset on all plans, covering high-impact, widely exploited weaknesses. You can add exceptions that skip rules under set conditions, or overrides that change a rule’s action.

## Why does it matter for security? {#why-does-it-matter-for-security}

Most small sites run on common software, and automated attacks probe it for known weak spots. A WAF can block many of these before they reach your server, often with managed rule sets the provider keeps up to date. It can also slow a flood: see [rate limiting](https://ursy.com/wiki/rate-limiting/) and [DDoS attack](https://ursy.com/wiki/ddos-attack/). Some services add an emergency mode for heavy attacks, such as [Under Attack Mode](https://ursy.com/wiki/under-attack-mode/).

## Why does it matter for search? {#why-does-it-matter-for-search}

[Google](https://ursy.com/wiki/google/) warns about the flip side. In its [post of 24 December 2024](https://developers.google.com/search/blog/2024/12/crawling-december-cdns), it says the [bots](https://ursy.com/wiki/bot-web-robot/) you want on your site may end up in your CDN’s blocklist, typically in a WAF. That stops crawlers reaching your site and can keep pages out of search. Google calls 429 or 503 the preferred way to signal a temporary block, and strongly recommends a 503 for bot-challenge pages, so content is not dropped from its index. See [Cloudflare blocking Googlebot](https://ursy.com/wiki/cloudflare-blocking-googlebot/) and [crawl budget](https://ursy.com/wiki/crawl-budget/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

An [AI crawler](https://ursy.com/wiki/ai-crawler/) such as [GPTBot](https://ursy.com/wiki/gptbot/) or [ClaudeBot](https://ursy.com/wiki/claudebot/) meets the same firewall as Googlebot. If a bot rule blocks it, your pages cannot be read for AI answers, whatever [robots.txt](https://ursy.com/wiki/robots-txt/) says. Bot settings such as [Bot Fight Mode](https://ursy.com/wiki/cloudflare-bot-fight-mode/) and [Super Bot Fight Mode](https://ursy.com/wiki/super-bot-fight-mode/) can catch them. If you do want them out, decide on purpose: see [block AI crawlers](https://ursy.com/wiki/block-ai-crawlers/), [blocking AI crawlers on Cloudflare](https://ursy.com/wiki/block-ai-crawlers-on-cloudflare/) and [pay per crawl](https://ursy.com/wiki/pay-per-crawl/).

## How do I let good bots through safely? {#how-do-i-let-good-bots-through-safely}

Do not trust the name alone. Anyone can send a [user agent](https://ursy.com/wiki/user-agent/) that says Googlebot. [Google offers two checks](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot): a reverse [DNS](https://ursy.com/wiki/dns/) lookup then a forward lookup for one-off cases, or matching the address against its published IP range files, such as `common-crawlers.json`, for large scale. [OpenAI](https://developers.openai.com/api/docs/bots) and [Perplexity](https://docs.perplexity.ai/guides/bots) publish lists for their bots too. Allow [verified bots](https://ursy.com/wiki/verified-bots/) by address, not by name. See [reverse DNS bot check](https://ursy.com/wiki/reverse-dns-bot-check/) and [bot score](https://ursy.com/wiki/bot-score/).

## Worked example: a law firm’s login page {#worked-example-a-law-firms-login-page}

A law firm’s site has a login page for staff at `/login`. Its Security Events show hundreds of attempts a night from addresses abroad. A custom rule that challenges visitors to `/login` only, plus a rate limit on the same path, stops the flood without touching the rest of the site. Clients reading the firm’s guides, and Googlebot [crawling](https://ursy.com/wiki/crawling/) them, never see a check.

| Rule | Applies to | Action |
| --- | --- | --- |
| Challenge | Path starts with `/login` | Managed challenge |
| Rate limit | `/login`, more than a set number of tries per minute from one address | Block for a while, ideally with 429 |
| Everything else | Guides, contact page, sitemap, robots.txt | No check |

[MDN says](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429) 429 Too Many Requests means the client sent too many requests in a given time, and a `Retry-After` header can say how long to wait.

## Common mistakes {#common-mistakes}

- Blocking a whole country when only one path is being attacked, which can also block a payment provider’s callbacks.
- Switching on a strict rule set without reading Security Events for the next few days to see who it caught.
- Challenging `robots.txt`, sitemaps or feeds, which are meant for machines.
- Sending a challenge page with a 200 status. Google asks for a 503.
- Allowing bots by name only, so fakes get through.
- Treating the WAF as the fix and leaving the site’s software out of date. OWASP notes that tuning a WAF can take real effort, and must be kept up as the application changes.

## How to check it {#how-to-check-it}

1. In your WAF’s dashboard (for Cloudflare: Security, then Events), look at what was blocked, from where and by which rule.
2. Look for blocks on Googlebot, Bingbot or AI crawlers you want. Our [Verify an AI Bot](https://ursy.com/verify-ai-bot/) tool checks whether a visitor really is the bot it claims to be, using its address and the published lists.
3. Fetch your own pages from outside. Our [HTTP Header Checker](https://ursy.com/http-header-checker/) shows if you get a 403 or a challenge instead of the page.
4. Check that robots.txt answers 200 through the firewall with the [Robots.txt Checker](https://ursy.com/robots-txt-checker/), and that your sitemap loads with the [XML Sitemap Checker](https://ursy.com/sitemap-checker/).
5. Run the [AI Bot Checker](https://ursy.com/ai-bot-checker/) to see which AI bots your rules let in, then compare with your firewall’s bot settings.
6. Check [redirects](https://ursy.com/wiki/redirect/) added by the firewall or CDN with the [Redirect Checker](https://ursy.com/redirect-checker/), and what AI can read with the [AI Readiness Checker](https://ursy.com/ai-readiness-checker/).
7. In [Google Search Console](https://ursy.com/wiki/google-search-console/), use [URL Inspection](https://ursy.com/wiki/url-inspection/). Google says that if the rendered page shows an empty page, an error or a bot challenge, talk to your CDN.
8. Read your [server logs](https://ursy.com/wiki/server-logs/) for blocked bots. The in-browser [AI Crawler Log Analyser](https://ursy.com/ai-crawler-log-analyzer/) is live.
9. Check the rest of your defences. The [Security Headers Checker](https://ursy.com/security-headers-checker/), [WordPress Security Checker](https://ursy.com/wordpress-security-checker/) and [SSL Certificate Checker](https://ursy.com/ssl-checker/) are live. See [SSL certificate](https://ursy.com/wiki/ssl-certificate/) and [prompt injection](https://ursy.com/wiki/prompt-injection/).
10. Set your headers and bot rules beside a rival’s with [Compare Two Websites](https://ursy.com/compare-websites/).
11. Over time, the [bot rules manager](https://ursy.com/pro/bot-rules-manager/) (robots.txt and firewall rules written for you), the [fake bot detector](https://ursy.com/pro/fake-bot-detector/), the [bot verification log](https://ursy.com/pro/bot-verification-log/), the [scraper and flood detector](https://ursy.com/pro/scraper-and-flood-detector/) and [bot cost](https://ursy.com/pro/bot-cost/) are in URSY Pro, opening in stages.

## What URSY.com counts {#what-ursy-counts}

We read the CDN’s own edge log, which lists every request with its user agent, path, status, country and cache status. So a bot that your firewall answers with a 403 still shows up, with the status it got. Requests for secrets such as `.env`, `.git` or `wp-config`, xmlrpc, injection patterns and scanner paths are counted as attacks, whatever name they send, and never as people. Each named bot is marked real, fake or unknown against the company’s published IP list. We keep only the [network block](https://ursy.com/wiki/network-block/), never the full address. The rules are on our [methodology](https://ursy.com/methodology/) page.

## Questions {#questions}

### Do I need a WAF for a small site? {#do-i-need-a-waf-for-a-small-site}

It helps, because automated attacks do not care how small you are. Some CDNs include a free rule set; Cloudflare’s docs list one on all plans. Keep your software updated as well.

### Can a WAF hurt my SEO? {#can-a-waf-hurt-my-seo}

Yes, if it blocks or challenges Googlebot. Google says this can keep pages out of search. Check Security Events and URL Inspection after any change.

### Will a WAF block AI crawlers? {#will-a-waf-block-ai-crawlers}

It can, if its bot settings say so. Decide which AI bots you want, then check with our tools.

### Is a WAF the same as a firewall on my computer? {#is-a-waf-the-same-as-a-firewall-on-my-computer}

No. A WAF reads web requests to one site: paths, headers and form data. It does not protect your office network.

### What status code should a block send? {#what-status-code-should-a-block-send}

For a temporary block, Google prefers 429 or 503. For a bot-challenge page, it strongly recommends 503.

## Related words {#related-words}

- [DDoS attack](https://ursy.com/wiki/ddos-attack/)
- [Rate limiting](https://ursy.com/wiki/rate-limiting/)
- [Cloudflare blocking Googlebot](https://ursy.com/wiki/cloudflare-blocking-googlebot/)
- [Managed challenge](https://ursy.com/wiki/managed-challenge/)
- [Verified bots](https://ursy.com/wiki/verified-bots/)
- [CDN](https://ursy.com/wiki/cdn/)
- [Cloudflare Bot Fight Mode](https://ursy.com/wiki/cloudflare-bot-fight-mode/)
- [Block AI crawlers](https://ursy.com/wiki/block-ai-crawlers/)

## Sources {#sources}

- [Cloudflare Docs: Web Application Firewall (WAF)](https://developers.cloudflare.com/waf/), checked 24 November 2026
- [Cloudflare Docs: WAF managed rules](https://developers.cloudflare.com/waf/managed-rules/), checked 24 November 2026
- [OWASP: Web Application Firewall](https://community.owasp.org/Web_Application_Firewall), checked 24 November 2026
- [Google Search Central Blog: Crawling December, CDNs and crawling (24 December 2024)](https://developers.google.com/search/blog/2024/12/crawling-december-cdns), checked 24 November 2026
- [Google Search Central: Verifying Googlebot and other Google crawlers](https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot), checked 24 November 2026
- [OpenAI: Overview of OpenAI crawlers](https://developers.openai.com/api/docs/bots), checked 24 November 2026
- [Perplexity Docs: Perplexity crawlers](https://docs.perplexity.ai/guides/bots), checked 24 November 2026
- [MDN Web Docs: 403 Forbidden](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403), checked 24 November 2026
- [MDN Web Docs: 429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
