列出Web应用防火墙(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 | long | 是 | 站点 ID,可通过调用 ListSites 接口获取。 | 1 |
SiteVersion | integer | 否 | 站点版本。 | 0 |
Phase | string | 否 | WAF 规则类型。取值:
| http_custom |
RulesetId | long | 否 | 规则集 ID。 | 10000001 |
QueryArgs | object | 否 | 查询过滤条件。 | |
Id | long | 否 | 精确查询 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 |
返回参数
示例
正常返回示例
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": {
"Id": 20000001,
"Name": "example",
"Status": "on",
"Type": "http_custom",
"Match": {
"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
},
"Action": "deny",
"Actions": {
"Response": {
"Id": 50000001,
"Code": 403
},
"Bypass": {
"Skip": "part",
"Tags": [
"http_custom"
],
"RegularTypes": [
"sqli"
],
"RegularRules": [
100001
],
"CustomRules": [
20000001
]
}
},
"ManagedGroupId": 30000001,
"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
},
"Threshold": {
"Request": 10,
"Traffic": "10Gb",
"ManagedRulesBlocked": 10,
"DistinctManagedRules": 10,
"ResponseStatus": {
"Code": 404,
"Count": 10,
"Ratio": 10
}
},
"Interval": 10,
"TTL": 10,
"OnHit": true
},
"ManagedList": "intelligence_crawler",
"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"
}
]
}
]
},
"Sigchl": [
"sig"
],
"AppSdk": {
"FeatureAbnormal": [
"wxbb_invalid_sign"
],
"CustomSignStatus": "on",
"CustomSign": {
"Key": "sign",
"Value": "examplesignvalue"
}
},
"AppPackage": {
"PackageSigns": [
{
"Name": "name",
"Sign": "sign"
}
]
},
"Expression": "ip.src eq 10.0.0.1",
"ManagedRulesets": [
{
"AttackType": 11,
"NumberTotal": 100,
"NumberEnabled": 50,
"ProtectionLevel": 4,
"Action": "deny",
"ManagedRules": [
{
"Id": 100001,
"Status": "on",
"Action": "deny"
}
]
}
],
"Value": "10.0.0.1",
"Notes": "example notes",
"SecurityLevel": {
"Value": "low"
}
}
}
],
"PageNumber": 1,
"PageSize": 20
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidParameter | The specified parameter is invalid. | 输入参数规范校验失败。 |
400 | InternalException | Failed to call the service. Try again later or contact technical support. | 调用服务失败,请稍后重试或联系客服咨询详情。 |
访问错误中心查看更多错误码。