Links

Setup Rate Limit / DDoS Control

This feature is in Early Availability for CloudGuard AppSec Gateways
CloudGuard AppSec Gateways have the ability to limit the number of requests to a matched URI within a configured time scope.

How to set up rate limit in an AppSec Gateway

Prerequisites

Web application or Web API assets must be configured and protected by a profile of "AppSec Gateway" type.

Step 1: Activate Rate Limit from the Practices tab when editing an asset

Browse to Cloud->Assets and edit the relevant Web Application, or Web API asset.
In the left pane, under the Practices tab, click on "Rate Limit" under the "Access Control" practices.

Step 2: Determine the mode of the Rate Limit configuration in the new "Access Control" tab

There are 3 optional modes:
  • Active - Rate limit is enforced.
  • Detect/Learn - Only logs will be issued if the rate limit is reached.
  • Inactive - Temporarily disable the rate limit altogether, instead of deleting the practice altogether.

Step 3: Configure Rate Limit Rules

A rate limit rule consists of 3 match conditions:
  • URI - The string written in this match is concatenated to all defined URLs of the Web Application or Web API asset.
Example - If the Asset's defined URLs are "http://www.myapp.com" and "https://www.mysecureapp.com" and the URI in the rule is "docs", it will be matched on all requests starting with either http://www.myapp.com/docs or https://www.mysecureapp.com/docs
  • Limit - the maximum number of requests in a specific time scope.
  • Unit - the time scope in which the limit is enforced.
If Limit is set to 7000 and Unit is set to "Minute" then an Active Rate Limit practice will prevent requests to the matched URI if they exceed 7000 requests in a single minute.
Match priority - The rate is enforced according to a single matched rule. When the URI of the request matches multiple URIs in multiple rules, the longest match takes precedence and determines the rate limit count.
Example - if there are 2 rules - one limiting the URI "/docs" for 10000 requests in one minute, and the second limiting "/docs/external" for 3000 requests in one minute, then requests to /docs/external/latest will be blocked if they exceed 3000 requests in one minute, as this rule creates a longer match.

Step 4: Configure a Trigger

Configure the trigger (usually the log trigger) that will activate when a Rate Limit rule is fully matched by URI as well as requests rate.
In Detect/Learn mode, the Trigger is the only action that will occur if the rate of matched URIs has exceeded configured limits.

Step 5: Enforce Policy

Click Enforce on the top banner of the Infinity Portal.