All Products
Search
Document Center

Edge Security Acceleration:ListWafManagedRules

Last Updated:Jul 10, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

esa:ListWafManagedRules

list

*Site

acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

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: enabled.

  • off: disabled.

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:

  • SQL injection

  • cross-site scripting (XSS)

  • code execute

  • CRLF

  • local file inclusion (LFI)

  • remote file inclusion (RFI)

  • webshell

  • cross-site request forgery

  • Others

  • SEMA

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:

  • en: English.

  • zh: Chinese.

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:

  • Loose

  • Medium

  • Strict

  • Super strict

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.