擷取Web Application Firewall(WAF)中單個規則的詳細資料。通過此介面,使用者可以查詢特定規則的配置和狀態。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
esa:GetWafRule |
get |
*Site
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| 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_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. | 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。