全部產品
Search
文件中心

Edge Security Acceleration:GetWafRule - 擷取單個WAF規則詳情

更新時間:Mar 26, 2026

擷取Web Application Firewall(WAF)中單個規則的詳細資料。通過此介面,使用者可以查詢特定規則的配置和狀態。

調試

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

調試

授權資訊

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

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

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

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

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

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

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

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

操作

存取層級

資源類型

條件關鍵字

關聯操作

esa:GetWafRule

get

*Site

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

請求參數

名稱

類型

必填

描述

樣本值

Id

integer

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

20000001

SiteId

integer

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

1

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

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

UpdateTime

string

規則的最後修改時間。

2024-01-01T00:00:00Z

Id

integer

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

2000001

Position

integer

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

1

Name

string

規則名稱。

example

Status

string

規則狀態。

on

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

Config WafRuleConfig

規則配置。

RulesetId

integer

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

樣本

正常返回樣本

JSON格式

{
  "RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225",
  "UpdateTime": "2024-01-01T00:00:00Z",
  "Id": 2000001,
  "Position": 1,
  "Name": "example",
  "Status": "on",
  "Phase": "http_custom",
  "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"
  },
  "RulesetId": 0
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

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

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

變更歷史

更多資訊,參考變更詳情