--- title: "WAF" description: "Protect your CDN zone at the edge: block or allow by IP, country or User Agent, rate limit, JS challenges, and caps on download speed, simultaneous requests and bandwidth." category: "Deployment" language: en source: https://cubepath.com/docs/products/deployment/cdn-waf updated: 2026-11-17 --- # WAF Open the CDN zone → **WAF** tab in [my.cubepath.com](https://my.cubepath.com). ![WAF rules of a zone: rate limit, IP and user agent firewall](https://cdn.cubepath.com/img/uploads/048fa451-254c-4f6e-bed5-6d44e3cd32cc.png) WAF (web application firewall) rules control **who** can reach your content and **how much** traffic they can send. They run at the edge, so abusive requests are stopped before they touch your origin. That saves your bandwidth and protects your application even while an attack is in progress. Like [Edge Rules](/docs/products/deployment/cdn-rules), each WAF rule has a **priority** (lower numbers run first), optional matching conditions, an on/off switch and an optional expiry date. ## Matching conditions A rule can target a subset of traffic or all of it. Match by path, HTTP method, host, headers, query parameters, cookies, country, IP or network range (CIDR), and User Agent. Leave the conditions empty and the rule applies to the whole zone. ## Rule types ### Block or Allow by IP Block specific addresses or whole network ranges (CIDR), or build an **allow list** so only addresses you trust reach the zone. Use it to ban an abusive source, or to lock a staging zone down to your office network. ### Block or Allow by Country Allow or block visitors by the country their IP belongs to, using two-letter codes. Use it for regional requirements, or to cut traffic from places you don't serve. ### Block by User Agent Block requests whose User Agent matches patterns you define: common scraping tools, unwanted crawlers. Worth knowing: it discourages badly behaved bots rather than stopping determined ones, since a User Agent is trivially forged. ### Rate Limit Caps how many requests a visitor can make in a time window. You set the number of requests, the period (1, 10 or 60 seconds), and whether requests are counted **Per IP** or **Per IP and path** (each IP counted separately on each path). Over the limit, further requests are rejected until the window resets. ![Rate limit rule: 300 requests per 60 s per IP on /api/*](https://cdn.cubepath.com/img/uploads/d8abfabf-1994-49e0-9d32-8041572fa4b4.png) This is the rule that protects login pages, forms and APIs from brute force and floods. ### JavaScript Challenge Asks the browser to silently solve a small challenge before content is served. Real browsers pass without the visitor noticing; simple bots and scripts fail. Use it on pages that attract automated abuse but must stay open to the public. ### Download Speed Limit Caps the speed of each matching response in kB/s, from the first byte. Keeps a handful of large downloads from saturating your bandwidth. ### Concurrent Requests Limit Caps how many requests one IP can have in progress at the same time. Extra requests are rejected. Stops a single client from tying up resources with many parallel requests. ### Bandwidth Limit Sets a maximum transfer rate for each IP, in kB/s averaged over 10 seconds. Above it, new requests from that IP are rejected until its rate drops. Unlike Download Speed Limit, it doesn't slow responses down: it cuts off a client that downloads too fast. > Note: Rate Limit, Concurrent Requests Limit and Bandwidth Limit are counted on each edge server separately. In locations with two servers, a visitor can get up to twice the value you set. ## Good practice - **Allow lists for private zones, block lists for fighting specific abuse.** If a zone should only be reachable by your team, listing what's allowed is far more robust than chasing what isn't. - **Combine a rate limit with a JavaScript challenge** on login and signup pages. Together they stop the overwhelming majority of credential-stuffing traffic. - **Start rate limits generous and tighten them** while watching analytics. A limit set too tight on the first try blocks real customers, and you'll hear about it before you notice it. - **Use the expiry date for incident-time blocks**, so temporary rules clean themselves up instead of quietly outliving the problem. > Tip: The **Blocked Requests** panel in [Analytics](/docs/products/deployment/cdn-analytics) shows what the edge is actually stopping. Check it after adding a rule: it's the fastest way to confirm the rule matches attack traffic and not your own customers.