列出Web Application Firewall(WAF)下的所有規則或根據特定條件式篩選規則,使用者可以使用此介面以分頁形式查詢WAF規則的詳細資料。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
esa:ListWafRules |
list |
*Site
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| SiteId |
integer |
是 |
網站 ID,可通過調用 ListSites 介面擷取。 |
1 |
| SiteVersion |
integer |
否 |
網站配置的版本號碼。開啟了配置版本管理的網站,可以通過該參數指定配置生效的網站版本,預設為版本 0。 |
0 |
| Phase |
string |
是 |
WAF 規則運行階段。
|
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_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 |
| 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. | 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。