Skip to main content

Update CC Protection Rule

Update an existing CC Protection Rule by ID.

Request

Request-Line

PUT /waap/v1.0/waf/ccProtections/{ruleId} HTTP/1.1

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
ruleIdIntegerMandatoryUnique identifier assigned to the CC Protection Rule.

Body Parameters

ParameterTypeRequiredDescription
nameStringOptionalName 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). If omitted, the existing name remains unchanged.
descriptionStringOptionalThe description can have 1-200 characters. If omitted, the existing description remains unchanged.
rateLimitTimesIntegerOptionalThe maximum number of requests allowed within the specified time. If omitted, the existing setting remains unchanged.
rateLimitSecondsIntegerOptionalList of website IDs to bind the CC Protection to. At least one ID is required. If omitted, the existing setting remains unchanged.
metricStringOptionalThe strategy used for calculating the metrics. Supported values: IP, User-Agent and Cookie. If omitted, the existing setting remains unchanged.
cumulativeEnabledBooleanOptionalIndicates whether cumulative calculation is enabled. If true, request counts are aggregated across all paths; if false, counts are calculated per path. If omitted, the existing setting remains unchanged.
pathsString[]OptionalA list of URL paths to which the rule applies. Supports multiple entries and regular expressions. If omitted, the existing setting remains unchanged.
actionStringOptionalDefines the operation executed when the rule is triggered. Supported values include Block, Redirect and Pass. If omitted, the existing setting remains unchanged.
delayIntegerOptionalThe delay, in seconds, before the configured action is applied after the threshold is reached. If omitted, the existing setting remains unchanged.
blockValueIntegerOptionalThe HTTP status code to return when the action is set to Block. If omitted, the existing setting remains unchanged.
redirectValueStringOptionalThe URL or path to redirect requests to when the action is configured as Redirect. If omitted, the existing setting remains unchanged.
autoWebAclDurationSecondsIntegerOptionalThe duration, in seconds, for which an offending IP address remains in the Web ACL after being added. If omitted, the existing setting remains unchanged.
websitesInteger[]OptionalList of website identifiers to which this rule is bound. If omitted, the existing setting remains unchanged.

Response

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.
400RuleId.InvalidRuleId is empty or invalid.
404Website.NotFoundWebsite is not found.
404CCProtectionRule.NotFoundCC Protection Rule is not found.

Examples

Update CC Protection Rule

Request

PUT /waap/v1.0/waf/ccProtections/55 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]
}