Common OpenAPI parameters for configuring defense rules (DefenseRule) in WAF.
conditions parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
key |
String |
Required |
IP |
The match field. Valid values: Bot advanced custom rules also support: Important
Available match fields vary by WAF edition. Check the supported fields for each rule type in the WAF console. |
|
subKey |
String |
Optional |
abc |
The custom sub-field. Note
Not all match fields ( |
|
opValue |
String |
Required |
contain |
The logical operator. Valid values:
Note
Not all logical operators ( |
|
values |
String |
Required |
abc |
The match content. Separate multiple values with commas (,). Note
Valid values for |
ratelimit parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
target |
String |
Required |
remote_addr |
The statistical object. Valid values:
The following values are supported only by Bot advanced custom rules:
|
|
subKey |
String |
Optional |
abc |
The key name for the statistical object. Required when |
|
interval |
Integer |
Required |
60 |
The statistical period, in seconds. WAF counts requests within this period against the |
|
threshold |
Integer |
Required |
200 |
Maximum requests from a single statistical object to the protected resource within the statistical period. |
|
ttl |
Integer |
Required |
1800 |
The duration of the action, in seconds. |
|
status |
JSON |
Optional |
{"code":404,"count":200} |
Rate limiting based on response codes. JSON string with these fields:
|
|
distinctStat |
Array |
Optional |
[{"key":"URL","opValue":"gt","values":"1"}] |
The conditions for distinct statistics. Note
Supported only for Bot advanced custom rules. Uses the |
distinctStat parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
key |
String |
Required |
IP |
The match field. Valid values: Important
Available match fields depend on your Bot Management subscription. Check the supported fields in the WAF console. |
|
subKey |
String |
Optional |
abc |
The custom sub-field for the distinct statistics condition. Note
Not all match fields ( |
|
opValue |
String |
Required |
Equal |
The logical operator. Valid values:
|
|
value |
String |
Required |
abc |
The value to compare with the count of unique values. |
grayConfig parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
grayTarget |
String |
Required |
remote_addr |
The grayscale target. Determines which traffic the rule affects based on the grayscale percentage. Valid values:
The following values are supported only by Bot advanced custom rules:
|
|
graySubKey |
String |
Optional |
abc |
The key name for the grayscale object. Required when |
|
grayRate |
Integer |
Required |
20 |
The percentage of traffic to which the rule applies. Valid range: 1 to 100. |
timeConfig parameters
|
Parameter |
Type |
Required |
Example |
Description |
|
timeScope |
String |
Required |
period |
The rule effective time. Valid values:
|
|
timeZone |
Integer |
Required |
8 |
The time zone offset, from -12 to 12. Default: |
|
timePeriods |
Array |
Optional |
[{"start":1758771729787,"end":1758816000000}] |
Active time periods for the rule. Required when
|
|
weekTimePeriods |
Array |
Optional |
[{"day":"1","dayPeriods":[{"start":0,"end":51644084}]},{"day":"1,2,5","dayPeriods":[{"start":0,"end":42928908}]}] |
Recurring schedule for the rule. Required when
|