FortiAppSec Cloud
FortiAppSec Cloud delivers unified application security and performance with WAF, bot protection, GSLB, DDoS mitigation, threat analytics, and CDN.
shafiq23
Staff & Editor
Staff & Editor
Article Id 411175
Description This article describes how to configure a custom rule in FortiAppSec Cloud WAF to implement URL/API endpoint rate limiting. The goal of this rule is to limit the number of requests from a single client IP within a specified time.
Scope FortiAppSec Cloud WAF.
Solution

Requirement:
Period block source IP exceeds the rate limit within a specified time.

 

Configuration:

  1. Go to Advanced Applications -> Custom Rule and select Create Rule.
  2. Define the rule name and its operation (action).
  3. Select Add Filter to define the match conditions.

Source IP: '<IP-range>'.
URL: '/sample-URL'.
Occurrence: 10 times in 1 minute.

 

1.png

 

Expected result:
If there was a violation (11th request) within 1 minute, block the source IP for 60 seconds.

 

To verify the functionality of the custom rule, navigate to Threat Analytics -> Attack Logs and check for logs related to the custom rule name.

 

2.png

 

For more information, refer to the following document:

Custom Rule