全部產品
Search
文件中心

Edge Security Acceleration:ListWafRules - 列舉WAF規則

更新時間:Mar 26, 2026

列出Web Application Firewall(WAF)下的所有規則或根據特定條件式篩選規則,使用者可以使用此介面以分頁形式查詢WAF規則的詳細資料。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

esa:ListWafRules

list

*Site

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

請求參數

名稱

類型

必填

描述

樣本值

SiteId

integer

網站 ID,可通過調用 ListSites 介面擷取。

1

SiteVersion

integer

網站配置的版本號碼。開啟了配置版本管理的網站,可以通過該參數指定配置生效的網站版本,預設為版本 0。

0

Phase

string

WAF 規則運行階段。

  • http_whitelist:白名單規則

  • http_custom:自訂規則

  • http_managed:託管規則

  • http_anti_scan:掃描防護規則

  • http_ratelimit:頻次控制規則

  • ip_access_rule:IP 訪問規則

  • http_bot:進階模式 Bots

  • http_security_level_rule:安全規則

http_custom

RulesetId

integer

WAF 規則集的 ID,可通過調用 ListWafRulesets 介面擷取。

10000001

QueryArgs

object

查詢過濾條件。

http_custom

Id

integer

精確查詢 WAF 規則 ID。

20000001

NameLike

string

模糊查詢 WAF 規則名稱。

example

IdNameLike

string

模糊查詢 WAF 規則 ID 或名稱。

example

Status

string

精確查詢 WAF 規則狀態。

on

ConfigValueLike

string

模糊搜尋 IP 存取控制中的值。

10.0.0.1

OrderBy

string

根據指定的列對返回列表排序。

position

Desc

boolean

是否對排序結果取反。

true

PageNumber

integer

查詢頁號,用於分頁。

1

PageSize

integer

查詢頁大小,用於分頁。

20

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

36af3fcc-43d0-441c-86b1-428951dc8225

SiteUsage

integer

網站使用量。

5

InstanceUsage

integer

網站對應執行個體中該 WAF 階段已使用規則數量。

10

TotalCount

integer

過濾後總規則數。

20

Rules

array<object>

返回規則列表。

object

規則詳情。

UpdateTime

string

修改時間。

2024-01-01T00:00:00Z

RulesetId

integer

規則集 ID。

10000001

Id

integer

規則 ID。

20000001

Position

integer

規則在對應規則集中所處的位置順序。

1

Phase

string

WAF 規則運行階段。

  • http_whitelist:白名單規則

  • http_custom:自訂規則

  • http_managed:託管規則

  • http_anti_scan:掃描防護規則

  • http_ratelimit:頻次控制規則

  • ip_access_rule:IP 訪問規則

  • http_bot:進階模式 Bots

  • http_security_level_rule:安全規則

http_custom

Type

string

規則類型。

http_custom

Name

string

規則名稱。

example

Status

string

規則狀態。

on

Fields

array

規則的匹配欄位列表。

string

規則的匹配欄位值。

ip.geoip.asnum

CharacteristicsFields

array

頻次控制類規則的統計對象列表。

string

頻次控制類規則的統計對象。

ip.src

Action

string

規則對應的動作。

  • deny:攔截

  • monitor:觀察

  • js:JS 挑戰

  • captcha:滑塊挑戰

deny

Skip

string

白名單類規則的跳過屬性。

part

Tags

array

白名單類規則的跳過 WAF 階段列表。

string

白名單類規則的跳過 WAF 階段值。

http_custom

Timer WafTimer

規則生效時間配置。

Config WafRuleConfig

規則配置。

PageNumber

integer

頁面號碼。

1

PageSize

integer

頁面大小。

20

樣本

正常返回樣本

JSON格式

{
  "RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
  "SiteUsage": 5,
  "InstanceUsage": 10,
  "TotalCount": 20,
  "Rules": [
    {
      "UpdateTime": "2024-01-01T00:00:00Z",
      "RulesetId": 10000001,
      "Id": 20000001,
      "Position": 1,
      "Phase": "http_custom",
      "Type": "http_custom",
      "Name": "example",
      "Status": "on",
      "Fields": [
        "ip.geoip.asnum"
      ],
      "CharacteristicsFields": [
        "ip.src"
      ],
      "Action": "deny",
      "Skip": "part",
      "Tags": [
        "http_custom"
      ],
      "Timer": {
        "Scopes": "permanent",
        "Zone": 8,
        "Periods": [
          {
            "Start": "2025-01-01T00:00:00Z",
            "End": "2025-01-01T01:00:00Z"
          }
        ],
        "WeeklyPeriods": [
          {
            "Days": "1",
            "DailyPeriods": [
              {
                "Start": "00:00:00",
                "End": "01:00:00"
              }
            ]
          }
        ]
      },
      "Config": {
        "Status": "on",
        "Action": "deny",
        "Actions": {
          "Response": {
            "Id": 50000001,
            "Code": 403
          },
          "Bypass": {
            "Skip": "part",
            "RegularRules": [
              100001
            ],
            "CustomRules": [
              20000001
            ],
            "RegularTypes": [
              "sqli"
            ],
            "Tags": [
              "http_custom"
            ]
          }
        },
        "ManagedList": "intelligence_crawler",
        "ManagedRulesets": [
          {
            "ProtectionLevel": 4,
            "Action": "deny",
            "ManagedRules": [
              {
                "Status": "on",
                "Action": "deny",
                "Id": 100001
              }
            ],
            "AttackType": 11,
            "NumberTotal": 100,
            "NumberEnabled": 50
          }
        ],
        "Sigchl": [
          "sig"
        ],
        "Name": "example",
        "AppSdk": {
          "CustomSign": {
            "Value": "examplesignvalue",
            "Key": "sign"
          },
          "CustomSignStatus": "on",
          "FeatureAbnormal": [
            "wxbb_invalid_sign"
          ]
        },
        "RateLimit": {
          "Characteristics": {
            "Logic": "and",
            "Criteria": [
              {
                "Logic": "and",
                "Criteria": [
                  {
                    "Logic": "and",
                    "Criteria": [
                      {
                        "MatchType": "ip.src",
                        "MatchOperator": "eq",
                        "MatchValue": "1.1.1.1",
                        "Negate": true,
                        "ConvertToLower": true
                      }
                    ],
                    "MatchType": "ip.src",
                    "MatchOperator": "eq",
                    "MatchValue": "1.1.1.1",
                    "Negate": true,
                    "ConvertToLower": true
                  }
                ],
                "MatchType": "ip.src",
                "MatchOperator": "eq",
                "MatchValue": "1.1.1.1",
                "Negate": true,
                "ConvertToLower": true
              }
            ],
            "MatchType": "ip.src",
            "MatchOperator": "eq",
            "MatchValue": "1.1.1.1",
            "Negate": true,
            "ConvertToLower": true
          },
          "OnHit": true,
          "TTL": 10,
          "Threshold": {
            "ManagedRulesBlocked": 10,
            "DistinctManagedRules": 10,
            "ResponseStatus": {
              "Ratio": 10,
              "Count": 10,
              "Code": 404
            },
            "Traffic": "10Gb",
            "Request": 10
          },
          "Interval": 10
        },
        "Type": "http_custom",
        "AppPackage": {
          "PackageSigns": [
            {
              "Sign": "sign",
              "Name": "name"
            }
          ]
        },
        "ManagedGroupId": 30000001,
        "Timer": {
          "Scopes": "permanent",
          "Zone": 8,
          "Periods": [
            {
              "Start": "2025-01-01T00:00:00Z",
              "End": "2025-01-01T01:00:00Z"
            }
          ],
          "WeeklyPeriods": [
            {
              "Days": "1",
              "DailyPeriods": [
                {
                  "Start": "00:00:00",
                  "End": "01:00:00"
                }
              ]
            }
          ]
        },
        "Expression": "ip.src eq 10.0.0.1",
        "SecurityLevel": {
          "Value": "low"
        },
        "Value": "10.0.0.1",
        "Id": 20000001,
        "Notes": "example notes"
      }
    }
  ],
  "PageNumber": 1,
  "PageSize": 20
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidParameter The specified parameter is invalid. 輸入參數規範校正失敗。
400 InternalException Failed to call the service. Try again later or contact technical support. 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情