Update CC Protection
Updates an existing CC Protection Rule by ID.
Request
Request-Line
PUT /waap/v1.0/waf/ccProtections/{ruleId} HTTP/1.1
Request Parameters
Path Parameters
Parameter | Type | Required | Description |
---|---|---|---|
ruleId | Integer | Mandatory | Unique identifier assigned to the CC Protection Rule. |
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | String | Optional | Name 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. |
description | String | Optional | The description can have 1-200 characters. If omitted, the existing description remains unchanged. |
rateLimitTimes | Integer | Optional | The maximum number of requests allowed within the specified time. If omitted, the existing setting remains unchanged. |
rateLimitSeconds | Integer | Optional | List of website IDs to bind the CC Protection to. At least one ID is required. If omitted, the existing setting remains unchanged. |
metric | String | Optional | The strategy used for calculating the metrics. Supported values: IP, User-Agent and Cookie. If omitted, the existing setting remains unchanged. |
cumulativeEnabled | Boolean | Optional | Indicates whether cumulative calculation is enabled. If true, the request counts for all paths are aggregated; otherwise, they are calculated individually per path. If omitted, the existing setting remains unchanged. |
paths | String[] | Optional | A list of URL paths to which the rule applies. Supports multiple entries and regular expressions. If omitted, the existing setting remains unchanged. |
action | String | Optional | The action to take when the rule is triggered. Supported values include Block, Redirect and Pass. If omitted, the existing setting remains unchanged. |
delay | Integer | Optional | The delay, in seconds, before applying the configured action after the threshold is reached. If omitted, the existing setting remains unchanged. |
blockValue | Integer | Optional | The HTTP status code to return when the action is set to Block. If omitted, the existing setting remains unchanged. |
redirectValue | String | Optional | The URL or path to which requests are redirected when the action is set to Redirect. If omitted, the existing setting remains unchanged. |
autoWebAclDurationSeconds | Integer | Optional | The duration, in seconds, for which the offending IP address remains on the Web ACL once added. If omitted, the existing setting remains unchanged. |
websites | Integer[] | Optional | A list of website identifiers to which this rule will be bound. If omitted, the existing setting remains unchanged. |
Response
Status Codes, Error Codes and Error Messages
Status Code | Error Code | Error Message |
---|---|---|
400 | Request.BadRequest | Bad request. |
400 | Name.Invalid | Name is empty or invalid. |
400 | Websites.Invalid | Websites is empty or invalid. |
400 | RateLimitTimes.Invalid | RateLimitTimes is empty or invalid. |
400 | RateLimitSeconds.Invalid | RateLimitSeconds is empty or invalid. |
400 | Metric.Invalid | Metric is empty or invalid. |
400 | Action.Invalid | Action is empty or invalid. |
400 | Delay.Invalid | Delay is empty or invalid. |
400 | BlockValue.Invalid | BlockValue is empty or invalid. |
400 | Description.Invalid | Description is empty or invalid. |
400 | AutoWebAclDurationSeconds.Invalid | AutoWebAclDurationSeconds is empty or invalid. |
400 | RedirectValue.Invalid | RedirectValue is empty or invalid. |
400 | Paths.Invalid | Paths is empty or invalid. |
400 | RuleId.Invalid | RuleId is empty or invalid. |
404 | Website.NotFound | Website is not found. |
404 | CCProtectionRule.NotFound | CC Protection Rule is not found. |
Examples
Update CC Protection
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]
}