Lists all managed rules under Web Application Firewall (WAF) or filters rules based on specific conditions. You can use this operation to query detailed information about WAF managed rules in a paginated manner.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
esa:ListWafManagedRules |
list |
*Site
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| SiteId |
integer |
No |
The site ID. You can obtain the site ID by calling the ListSites operation. |
1 |
| InstanceId |
string |
No |
The WAF instance ID. |
esa-site-awmmx25y2igw |
| Id |
integer |
No |
The ID of the WAF rule. |
10000001 |
| ManagedRuleset |
object |
No |
The managed ruleset configuration in JSON string format. Contains the AttackType, ProtectionLevel, Action, and ManagedRules subfields. When ProtectionLevel is set to -1 (custom mode), specify the status and action for each rule through the ManagedRules array. |
|
| AttackType |
integer |
No |
The attack type encoding. The value cannot be 0. Example values: 11 (SQL injection), 12 (XSS), 13 (code execute), 14 (CRLF), 15 (local file inclusion (LFI)), 16 (remote file inclusion (RFI)), 17 (WebShell), 22 (command injection), 26 (SSRF), 27 (path traversal), 28 (protocol violation), 31 (scanner behavior). |
11 |
| ProtectionLevel |
integer |
No |
The protection level within the ruleset. Valid values: -1 (custom mode, specify each rule through ManagedRules), 1 (loose), 2 (medium), 3 (strict), 4 (super strict). When the value is -1, ManagedRules cannot be empty. When the value is greater than 0, Action cannot be empty. |
-1 |
| Action |
string |
No |
The unified action when ProtectionLevel is greater than 0. This parameter cannot be empty in this case. Common valid values: monitor, deny, js, captcha. The actual available values depend on the instance quota. |
monitor |
| ManagedRules |
array<object> |
No |
The rule configuration list in custom mode. This parameter is used only when ProtectionLevel is set to -1. Each element contains Id, Status, and Action, which are used to specify the enabled status and action for each managed rule. |
|
|
object |
No |
|||
| Id |
integer |
No |
The unique ID of a single managed rule. |
20611349 |
| Status |
string |
No |
The rule enabled status. Valid values:
|
on |
| Action |
string |
No |
The action for a single rule. This parameter takes effect only in custom mode (ProtectionLevel = -1). Common valid values: monitor, deny, js, captcha. The actual available values depend on the instance quota. |
js |
| AttackType |
integer |
Yes |
The attack type of the vulnerability prevention event. Valid values:
|
11 |
| ProtectionLevel |
integer |
No |
The currently saved protection level, which represents the existing configuration state in the database. Valid values: -1 (custom mode), 1 (loose), 2 (medium), 3 (strict), 4 (super strict). Difference from ManagedRuleset.ProtectionLevel: this parameter indicates the currently effective configuration, while ManagedRuleset.ProtectionLevel indicates the target value being passed in. |
1 |
| Language |
string |
No |
The language type. The response is returned in the specified language. Valid values:
|
zh |
| QueryArgs |
object |
No |
The query conditions. |
{\"Status\":\"\",\"ProtectionLevels\":[2,1],\"Action\":\"\",\"IdNameLike\":\"\"} |
| IdNameLike |
string |
No |
Fuzzy match by rule ID or rule name. |
example |
| ProtectionLevels |
array |
No |
The list of rule protection levels. |
|
|
integer |
No |
The rule protection level. Valid values:
|
1 |
|
| Action |
string |
No |
The action. |
deny |
| Status |
string |
No |
The status. |
on |
| PageNumber |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The page size. |
20 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
36af3fcc-43d0-441c-86b1-428951dc8225 |
| TotalCount |
integer |
The total number of rules after filtering. |
20 |
| Rules |
array<object> |
The list of managed rules. |
|
|
object |
The managed rule details. |
||
| Id |
integer |
The managed rule ID. |
100001 |
| Name |
string |
The managed rule name. |
SQL injection |
| ProtectionLevel |
integer |
The protection level of the managed rule. |
1 |
| Action |
string |
The protection action of the managed rule. |
deny |
| Status |
string |
The protection status of the managed rule. |
on |
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The page size. |
20 |
Examples
Success response
JSON format
{
"RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
"TotalCount": 20,
"Rules": [
{
"Id": 100001,
"Name": "SQL injection ",
"ProtectionLevel": 1,
"Action": "deny",
"Status": "on"
}
],
"PageNumber": 1,
"PageSize": 20
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.