跳到主要内容

Create CC Protection

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, the request counts for all paths are aggregated; otherwise, they are calculated individually per path. Default is true if omitted.
pathsString[]MandatoryA list of URL paths to which the rule applies. Supports multiple entries and regular expressions.
actionStringMandatoryThe action to take when the rule is triggered. Supported values include Block, Redirect and Pass.
delayIntegerMandatoryThe delay, in seconds, before applying the configured action after the threshold is reached.
blockValueIntegerOptionalThe HTTP status code to return when the action is set to Block.
redirectValueStringOptionalThe URL or path to which requests are redirected when the action is set to Redirect.
autoWebAclDurationSecondsIntegerMandatoryThe duration, in seconds, for which the offending IP address remains on the Web ACL once added.
websitesInteger[]MandatoryA list of website identifiers to which this rule will be 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

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
}