Square CloudSquare Cloud

How much does a WAF cost?

A WAF is billed in four ways: included with hosting or a CDN, a flat plan fee, per rule and inspected request, or self-hosted open source software. The hidden cost is the time spent tuning rules and handling false positives.

Updated 7 min read

Learning objectives

After reading this article you will be able to:

  • Compare the ways a WAF is billed: included, per plan, usage-based and self-hosted
  • Estimate the bill of a WAF charged per rule and per request, in a normal month and an attack month
  • Spot the hidden costs and know when the WAF included with your hosting is enough
On this page

A WAF may not show up on your bill at all, cost a flat monthly fee, be charged for every request it looks at or carry no license at all, when you run an open source one yourself. The difference between these models isn't only price: it is who writes the rules, who reads the logs and who pays when an attack multiplies the traffic.

The numbers in this article are hypothetical, picked to keep the math simple. They are not any provider's prices; real figures live on the official pages listed in the sources. If you're not sure yet what a WAF filters, start with what a WAF is.

How is a WAF billed?#

Model How it bills Who writes and tunes the rules Example
Included with hosting or a CDN inside the plan the vendor a basic rule set on every plan
Per plan flat monthly fee per domain the vendor, with your tweaks broader rule sets on a CDN's paid plans
Per rule and per request rule set, rules and millions of requests you, with optional ready-made packs AWS WAF, Cloud Armor Standard
Self-hosted open source no license; servers and hours you ModSecurity or Coraza with the OWASP CRS

Included and per plan#

The simplest model is the WAF that comes with your hosting or CDN. On Cloudflare, for example, the entry plan gets a basic set of ready-made rules, and plans from Pro up add Cloudflare's main rule set and its version of the OWASP Core Rule Set. It is a common design: ready-made rules on every plan and broader sets on the higher ones, for a flat monthly fee.

Per rule and per inspected request#

The big clouds bill by usage, in two parts. The fixed part pays for what is configured: the rule set attached to a resource (a web ACL on AWS, a security policy on Google Cloud), the rules inside it or each protected resource, depending on the provider. The variable part pays for every million inspected requests. Add-ons come on top: bot detection and fraud prevention packs, such as AWS WAF Bot Control and Fraud Control, and third-party rule groups sold on AWS Marketplace, priced by the seller.

Google's Cloud Armor Standard is the most direct example: it charges per policy, per rule and per request, includes preconfigured rules for the OWASP Top 10 and offers automatically updated ready-made rules as an optional add-on. Providers revise these dimensions from time to time, so every estimate starts from the official pricing page.

Self-hosted with open source#

ModSecurity is the best-known open source WAF engine, now under the OWASP organization on GitHub, licensed Apache 2.0, with an nginx connector. OWASP Coraza is an alternative written in Go, also Apache 2.0, compatible with the OWASP Core Rule Set (CRS), that runs as a Caddy plugin, as a proxy-wasm filter in Envoy or as a Go library. CRS is the generic rule set both engines use, an OWASP Flagship project, also Apache 2.0. A self-hosted WAF usually runs in a reverse proxy in front of the application.

How much does a WAF billed per rule and per request cost?#

Hypothetical example: an API receives 30 million requests a month, protected by a rule set with 10 rules. The script below does the math with made-up prices. Save it as waf-cost.mjs and run node waf-cost.mjs:

javascript
// Hypothetical example in USD: a WAF billed per rule set, per rule and per request.
// Not any provider's prices; swap in the ones from your provider's official page.
const price = {
  ruleSetMonth: 10, // per rule set (web ACL) per month
  ruleMonth: 2, // per rule per month
  perMillion: 1, // per million inspected requests
  botsMonth: 20, // optional bot detection pack, per month
  botsPerMillion: 2, // per million requests seen by the bot pack
};

function bill(millions, { rules = 10, bots = false } = {}) {
  let total = price.ruleSetMonth + rules * price.ruleMonth + millions * price.perMillion;
  if (bots) total += price.botsMonth + millions * price.botsPerMillion;
  return total;
}

console.log("normal month".padEnd(16), bill(30));
console.log("with bots".padEnd(16), bill(30, { bots: true }));
console.log("attack month".padEnd(16), bill(330, { bots: true }));

The output:

normal month     60
with bots        140
attack month     1040

Three lessons come out of that math. Rules are the smallest part; volume drives the bill. The bot pack, charged per request, more than doubles it. And a layer 7 attack with 300 million extra requests multiplies the bill by seven, because a blocked request was still inspected. That is why DDoS mitigation in front of the WAF matters for your wallet too, as how much DDoS protection costs shows.

How much does running an open source WAF cost?#

The license costs nothing. The rest does:

  • Servers. The WAF matches every request against hundreds of regular expressions. That burns CPU on the proxy and adds latency, so heavy traffic calls for a bigger machine or one more.
  • Setup and updates. Building or installing the connector, enabling CRS and keeping up with new releases of the engine and the rules.
  • Tuning. CRS produces false positives by nature: it is generic and knows nothing about your application. Its documentation suggests starting in blocking mode right away with very high anomaly score thresholds (as high as 10000) and lowering them gradually to 5, the inbound threshold it recommends.

Exclusions go after the CRS include, without editing the rule files, because editing them forks the rule set. An example, in the format used by the CRS documentation:

# After the CRS Include: the "bio" field receives HTML from the text editor,
# so rule 941320 (XSS, HTML Tag Handler) stops looking at that field only.
SecRuleUpdateTargetById 941320 "!ARGS:bio"

Each of those lines comes out of an investigation: finding the request in the log, understanding which rule fired and deciding whether the exception opens a hole. Hypothetical example: 8 hours to set up, 8 hours of tuning in the first month and 2 hours a month afterwards add up to 38 hours in the first year. At $50 an hour (a hypothetical rate), that is $1,900, servers not included: more than three years of a $50-a-month paid CDN plan (also hypothetical).

What costs don't show up on the pricing page?#

  • False positives. A sign-up form that blocks anyone with an apostrophe in their last name loses customers silently. Nobody files a ticket; they just leave.
  • Reading logs. A WAF that only logs and is never reviewed protects nothing. Someone has to look at what was blocked and what got through.
  • Premium packs. Bot detection, fraud prevention and third-party rules are billed separately and usually cost more per request than the basic WAF.
  • Attack traffic. In the per-request model, the attack lands on your bill even when it is blocked.

When is the WAF included with your hosting enough?#

For most websites, APIs and internal tools of small and mid-sized projects, the included WAF does the job, as long as the code does its part: parameterized queries, input validation, correct authentication and rate limiting on sensitive routes. It stops automated scans and known payloads, which make up most of the malicious traffic a small project receives.

Paying for a configurable WAF or running a self-hosted one starts to pay off when you need:

  • Per-route rules, such as a virtual patch for a specific flaw while the code isn't fixed yet;
  • Bot management, against scraping or mass login attempts, as in a brute force attack;
  • Detailed logs of every block, because a customer or a standard requires them;
  • A single policy across many applications in a company.

Before spending on a WAF, go through the deploy security checklist: it fixes causes that no rule can. And if the question is finding flaws in your own code, that's a different path: see pentest vs vulnerability scanner.

How to do this on Square Cloud#

On Square Cloud, a WAF comes with every plan, along with DDoS mitigation at layers 3, 4 and 7, on a network with an Anycast CDN of 200+ points of presence (Cloudflare-backed). Traffic is unlimited, with no bandwidth metering and no per-request charges (fair use policy), so the line that grew in the example's attack month doesn't show up on the bill. The entry plan, Hobby, costs R$12.49 a month.

The included WAF is the network layer. What depends on your application lives in your code: parameterized queries, input validation, authentication and per-route rate limits. To follow what arrives, the 4xx and 5xx error monitoring and the web analytics in every plan show routes, status codes and verified bots. See the CDN, WAF and mitigation details on the network page.

Infrastructure

L3/L4/L7 DDoS mitigation and a WAF on every plan

DDoS-protected network

FAQs

Is there a WAF with no license cost?

Yes. ModSecurity and Coraza are open source under the Apache 2.0 license and run the OWASP Core Rule Set, also open source. You pay in servers and, above all, in hours of setup and tuning. Some CDNs also include a basic rule set on every plan.

How is AWS WAF billed?

On pay-as-you-go, the bill combines a fixed part for what is configured or protected, a part per million inspected requests and add-ons for premium rule groups such as Bot Control. AWS revises these dimensions from time to time, so the current model and rates are on the official pricing page.

What does a false positive cost?

It is a legitimate request blocked because it looks like an attack. You pay twice: the user who doesn't finish the purchase or sign-up, and the hours spent finding the rule in the log and writing an exclusion.

Do I need a WAF if my code already uses parameterized queries?

Secure code comes first, because it fixes the cause. A WAF is a second layer: it stops automated scans and buys time when a new flaw shows up in a dependency you haven't updated yet.

Next articlePentest vs vulnerability scanner: what each one costsDependency scanners and DAST have open source tools with no license; a manual pentest is billed per project or per tester-day. See what each one finds and costs.

More in Security

See all 24 articles