Skip to main content

Create CC Protection Rule

Create a new CC Protection.

Request

Request-Line

POST /waap/v1.0/waf/ccProtections HTTP/1.1

Request Parameters

Body Parameters

ParameterTypeRequiredDescription
nameStringMandatoryName of the CC Protection.The name must have 1-26 characters. Valid characters: 0-9, A-Z, a-z, space, . (dot), _ (underline), - (hyphen), () (parentheses), * (asterisk) and + (plus sign).
descriptionStringOptionalThe description can have 1-200 characters.
rateLimitTimesIntegerMandatoryThe maximum number of requests allowed within the specified time.
rateLimitSecondsIntegerMandatoryList of website IDs to bind the CC Protection to. At least one ID is required.
metricStringMandatoryThe strategy used for calculating the metrics. Supported values: IP, User-Agent and Cookie.
cumulativeEnabledBooleanMandatoryIndicates whether cumulative calculation is enabled. If true, request counts are aggregated across all paths; if false, counts are calculated per path. Default is true if omitted.
pathsString[]MandatoryA list of URL paths to which the rule applies. Supports multiple entries and regular expressions.
actionStringMandatoryDefines the operation executed when the rule is triggered. Supported values include Block, Redirect and Pass.
delayIntegerMandatoryThe delay, in seconds, before the configured action is applied after the threshold is reached.
blockValueIntegerOptionalThe HTTP status code to return when the action is set to Block.
redirectValueStringOptionalThe URL or path to redirect requests to when the action is configured as Redirect.
autoWebAclDurationSecondsIntegerMandatoryThe duration, in seconds, for which an offending IP address remains in the Web ACL after being added.
websitesInteger[]MandatoryList of website identifiers to which this rule is bound.

Response

Response Body

Property nameTypeRequiredDescription
ruleIdIntegerMandatoryUnique identifier assigned to the created CC Protection.

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400Request.BadRequestBad request.
400Name.InvalidName is empty or invalid.
400Websites.InvalidWebsites is empty or invalid.
400RateLimitTimes.InvalidRateLimitTimes is empty or invalid.
400RateLimitSeconds.InvalidRateLimitSeconds is empty or invalid.
400Metric.InvalidMetric is empty or invalid.
400Action.InvalidAction is empty or invalid.
400Delay.InvalidDelay is empty or invalid.
400BlockValue.InvalidBlockValue is empty or invalid.
400Description.InvalidDescription is empty or invalid.
400AutoWebAclDurationSeconds.InvalidAutoWebAclDurationSeconds is empty or invalid.
400RedirectValue.InvalidRedirectValue is empty or invalid.
400Paths.InvalidPaths is empty or invalid.
404Website.NotFoundWebsite is not found.

Examples

Create CC Protection Rule

Request

POST /waap/v1.0/waf/ccProtections HTTP/1.1

{
"name": "test",
"description": "",
"rateLimitTimes": 100,
"rateLimitSeconds": 1,
"metric": "IP",
"cumulativeEnabled": true,
"paths": [
"/test"
],
"action": "Block",
"delay": 0,
"blockValue": 429,
"redirectValue": "/test",
"autoWebAclDurationSeconds": 600,
"websites": [101, 102]
}

Successful Response Body

{
"ruleId": 55
}