All services / Security / Web Application Firewall
๐Ÿ›ก๏ธ
Security

Web Application Firewall

Block SQL injectionSQL injectionAn attack that sneaks malicious database commands in through input fields to steal or damage data., XSSXSSCross-Site Scripting โ€” an attack that injects malicious scripts into web pages other people view., and zero-day exploits at the edgethe edgeโ€œThe edgeโ€ means Cloudflare's servers spread across the world, close to your users โ€” as opposed to one central data center. with managed rulesmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. Cloudflare updates for you.

What it is

The Web Application FirewallWAFWeb Application Firewall โ€” inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site. inspects every incoming HTTP request at Cloudflare's edgethe edgeโ€œThe edgeโ€ means Cloudflare's servers spread across the world, close to your users โ€” as opposed to one central data center. and blocks application-layerL7Layer 7 โ€” the application (HTTP) layer, where smart, web-specific attacks happen. attacks โ€” SQL injectionSQL injectionAn attack that sneaks malicious database commands in through input fields to steal or damage data., cross-site scriptingXSSCross-Site Scripting โ€” an attack that injects malicious scripts into web pages other people view., and known CVECVECommon Vulnerabilities and Exposures โ€” a publicly catalogued security flaw, each with a unique ID. exploits โ€” using managed rulesetsmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. that Cloudflare's threat intelligence keeps continuously up to date. Custom rules let you enforce your own business logic.

Why it helps the client

  • Protection against the OWASP Top 10 and common web exploits out of the box.
  • Virtual patching โ€” new CVEs are covered by managed rules automatically, often before you can patch.
  • Custom rules with a no-regex expression builder for business-specific logic.
  • Less load and risk on your origin, plus support for PCI-DSS requirements.

Why they'd want it

  • Managed protection maintained by Cloudflare's view of ~20% of the web โ€” not a rule set you must babysit.
  • Deploy in seconds with low false positives, and full logging of every action.
  • One place to enforce both known-threat protection and custom guardrails.

๐Ÿ”ฌ How it actually works

  • The WAFWAFWeb Application Firewall โ€” inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site. evaluates every proxied L7L7Layer 7 โ€” the application (HTTP) layer, where smart, web-specific attacks happen. request before it reaches originoriginYour own web server or host where your website actually lives. Cloudflare sits in front of it., running Cloudflare Managed Rulesmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. (curated signatures for the OWASP Top 10OWASP Top 10The industry-standard list of the ten most critical web-application security risks, published by the OWASP nonprofit. and known CVEsCVECommon Vulnerabilities and Exposures โ€” a publicly catalogued security flaw, each with a unique ID.), the OWASP Core Ruleset (anomaly scoring), and your Custom Rules โ€” all through the same Ruleset Engine and wirefilter expression language.
  • Custom Rules use a point-and-click expression builder over fields like URI, headers, method, IPIP addressA numeric address that identifies a device or server on the Internet., country, ASN, bot scorebot scoreCloudflare's 1โ€“99 rating of how likely a request came from a bot (1) versus a real human (99)., and threat score, with actions block, managed challenge, JS challenge, skip, or log. Regex is supported but not required.
  • Managed Rulesmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. are updated continuously by Cloudflare threat intelligence โ€” new high-profile CVEsCVECommon Vulnerabilities and Exposures โ€” a publicly catalogued security flaw, each with a unique ID. get emergency 'virtual patch' rules, often before customers can patch code. Any rule can run in Log mode first, then be switched to Block to tune false positives.
  • Everything is observable in Security Events with full request detail and the matched rule, and rule changes deploy across all 330+ cities in seconds.

๐Ÿ“– Key terms on this page hover any underlined term anywhere on the site for its definition

L7
Layer 7 โ€” the application (HTTP) layer, where smart, web-specific attacks happen.
origin
Your own web server or host where your website actually lives. Cloudflare sits in front of it.
SQL injection
An attack that sneaks malicious database commands in through input fields to steal or damage data.
the edge
โ€œThe edgeโ€ means Cloudflare's servers spread across the world, close to your users โ€” as opposed to one central data center.
WAF
Web Application Firewall โ€” inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site.
XSS
Cross-Site Scripting โ€” an attack that injects malicious scripts into web pages other people view.
managed ruleset
A set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them.
OWASP Top 10
The industry-standard list of the ten most critical web-application security risks, published by the OWASP nonprofit.
OWASP
Open Worldwide Application Security Project โ€” a nonprofit best known for its โ€œTop 10โ€ list of common web security risks.
virtual patching
Blocking exploitation of a known vulnerability with an edge rule before you've fixed the underlying code.
CVE
Common Vulnerabilities and Exposures โ€” a publicly catalogued security flaw, each with a unique ID.
bot
Automated software making requests instead of a human. Some bots are good (search engines); many are malicious.
DDoS
Distributed Denial of Service โ€” an attack that floods a site with junk traffic from many sources to knock it offline.
IP address
A numeric address that identifies a device or server on the Internet.
bot score
Cloudflare's 1โ€“99 rating of how likely a request came from a bot (1) versus a real human (99).
PCI DSS
Payment Card Industry Data Security Standard โ€” the security rules everyone handling credit-card data must follow.

Live demo walkthrough

6 steps

Screens below are annotated recreations of the Cloudflare dashboard. The numbered orange pin marks exactly where to click.

1

Select the website

๐Ÿ‘† Account Home โ†’ example.com
๐Ÿ”’dash.cloudflare.com

๐Ÿ‘‰ Do this

Open the site you want to protect.

๐Ÿ’ฌ Say this

โ€œSecurity in Cloudflare is configured per site. I'll open our demo site to walk through the application security stack, starting with the WAF.โ€

2

Open Security โ†’ WAF

๐Ÿ‘† Left nav โ†’ Security โ†’ WAF
๐Ÿ”’dash.cloudflare.com/example.com/security/waf
example.com โ–พ
Test Account NickN

Security

WAF

Managed rulesCustom rulesRate limiting rules
Cloudflare Managed RulesetCore protection against the OWASP Top 10 and common exploits, curated by Cloudflare.
Deployed
Cloudflare OWASP Core RulesetParanoia-level scoring for anomaly-based detection.
Deployed
Cloudflare Exposed Credentials CheckDetects logins using known-leaked username/password pairs.
Available

๐Ÿ‘‰ Do this

Expand Security in the sidebar and click WAF.

๐Ÿ’ฌ Say this

โ€œAll application security lives under Security. The WAF is our first line of defense at the application layer โ€” Layer 7.โ€

3

Show the Managed Rulesets

๐Ÿ‘† WAF โ†’ Managed rules โ†’ Cloudflare Managed Ruleset
๐Ÿ”’dash.cloudflare.com/example.com/security/waf
example.com โ–พ
Test Account NickN

Security

WAF

Managed rulesCustom rulesRate limiting rules
Cloudflare Managed RulesetCore protection against the OWASP Top 10 and common exploits, curated by Cloudflare.
Deployed
3
Cloudflare OWASP Core RulesetParanoia-level scoring for anomaly-based detection.
Deployed
Cloudflare Exposed Credentials CheckDetects logins using known-leaked username/password pairs.
Available

๐Ÿ‘‰ Do this

Point to the Cloudflare Managed Ruleset, deployed and enabled.

๐Ÿ’ฌ Say this

โ€œThese are Cloudflare-managed rules, updated by our threat intelligence drawn from a huge share of the web's traffic. When a new CVE drops, customers get virtual patching automatically โ€” usually before their own teams can deploy a fix.โ€

4

Add a custom rule

๐Ÿ‘† WAF โ†’ Custom rules โ†’ Create rule โ†’ Action
๐Ÿ”’dash.cloudflare.com/example.com/security/waf?tab=custom
example.com โ–พ
Test Account NickN

Security

WAF › Create custom rule

Rule builder
Block admin from outside office
Field: URI Path Operator: starts with Value: /admin
And Field: IP Source Address Operator: is not in Value: Office IPs
Action: Block โ–พ4

๐Ÿ‘‰ Do this

Build an expression, then set the Action to Block and Deploy.

๐Ÿ’ฌ Say this

โ€œFor business-specific logic we add custom rules with a point-and-click builder โ€” no regex. Here: block anyone hitting /admin from outside our office IPs. Choose the action, hit Deploy, and it's live at the edge in seconds.โ€

5

Review Security Events

๐Ÿ‘† Left nav โ†’ Security โ†’ Events
๐Ÿ”’dash.cloudflare.com/example.com/security/events
example.com โ–พ
Test Account NickN

Security

Events

Add filter โ–พ5
Sampled logs
ActionServiceHostSource IPRule
BlockWAFexample.com203.0.113.9SQLi โ€“ Managed
BlockRate limitingapi.example.com198.51.100.2Login throttle
Managed challengeBot Managementexample.com192.0.2.44Score < 30
BlockAPI Shieldapi.example.com203.0.113.5Schema violation
BlockWAFexample.com203.0.113.77XSS โ€“ Managed

๐Ÿ‘‰ Do this

Open Events and filter to WAF actions.

๐Ÿ’ฌ Say this

โ€œEvery action is logged in real time. We can show the customer exactly what we blocked, why, and from where โ€” perfect for reporting and tuning.โ€

6

Zoom out to Security Analytics

๐Ÿ‘† Left nav โ†’ Security โ†’ Analytics
๐Ÿ”’dash.cloudflare.com/example.com/security/analytics
example.com โ–พ
Test Account NickN

Security

Analytics

Last 24 hours โ–พ
Requests & mitigations
Total requests48.2M
Mitigated1.24M+3%
Blocked918K
Challenged322K
Top events by service
ServiceRule / signatureActionEvents
WAFSQLi โ€“ ManagedBlock612K
Bot ManagementScore < 30Managed challenge288K
Rate limitingLogin throttleBlock141K
DDoSHTTP flood โ€“ L7Block96K
6

๐Ÿ‘‰ Do this

Open Security โ†’ Analytics to show the aggregate view across all security products.

๐Ÿ’ฌ Say this

โ€œAnd here's the executive view: total requests versus mitigated, broken down by service and rule. It ties the whole security story together โ€” WAF, bots, rate limiting, and DDoS โ€” in one board-ready chart.โ€

Questions clients ask

Tap a question to reveal the answer to say
Will it block legitimate traffic (false positives)?โ€บ
You control aggressiveness and can deploy any rule in Log mode first to watch what it *would* do, then switch to Block. Managed rulesmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. are tuned for low false positives, and Security Events show exactly what matched, so tuning is quick.
We already run F5 / Imperva / AWS WAF. Why Cloudflare?โ€บ
Ours is edgethe edgeโ€œThe edgeโ€ means Cloudflare's servers spread across the world, close to your users โ€” as opposed to one central data center.-native โ€” it runs in 330+ cities with no appliance to size or patch, is updated automatically by intelligence drawn from a huge share of the web, and is unified with DDoSDDoSDistributed Denial of Service โ€” an attack that floods a site with junk traffic from many sources to knock it offline., botsbotAutomated software making requests instead of a human. Some bots are good (search engines); many are malicious., and rate limiting in one place. No hardware, no tuning treadmill.
Can it enforce our own business logic?โ€บ
Yes โ€” Custom Rules encode logic like 'block /admin except office IPs,' geo-fencing, or requiring a header, combining many signals in a single expression.
How do you handle zero-days like Log4j?โ€บ
Cloudflare ships managed rulesmanaged rulesetA set of security rules that Cloudflare writes and keeps up to date for you, so you don't have to maintain them. for high-profile CVEsCVECommon Vulnerabilities and Exposures โ€” a publicly catalogued security flaw, each with a unique ID. rapidly as virtual patches, protecting you at the edgethe edgeโ€œThe edgeโ€ means Cloudflare's servers spread across the world, close to your users โ€” as opposed to one central data center. before you can deploy a code fix โ€” Log4Shell is the classic example.
Does it help with PCI compliance?โ€บ
Yes โ€” a WAFWAFWeb Application Firewall โ€” inspects web requests and blocks malicious ones (like SQL injection and XSS) before they reach your site. helps satisfy PCI DSSPCI DSSPayment Card Industry Data Security Standard โ€” the security rules everyone handling credit-card data must follow. requirement 6.4.2, and Cloudflare provides the WAF plus the logging auditors expect.
Can we validate it before enforcing?โ€บ
Log mode, staged rollouts, and per-rule actions let you validate against real production traffic before you flip anything to Block.