列出Web应用防火墙(WAF)下的所有规则或根据特定条件筛选规则,用户可以使用此接口以分页形式查询WAF规则的详细信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
esa:ListWafRules |
list |
*Site
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| SiteId |
integer |
是 |
站点 ID,可通过调用 ListSites 接口获取。 |
1 |
| SiteVersion |
integer |
否 |
站点版本。 |
0 |
| Phase |
string |
是 |
WAF 规则类型。取值:
|
http_custom |
| RulesetId |
integer |
否 |
规则集 ID。 |
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. | 调用服务失败,请稍后重试或联系客服咨询详情。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。