查询精准防护规则列表
功能介绍
查询精准防护规则列表
URI
GET /v1/edgesec/configuration/http/policies/{policy_id}/access-control-rule
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| policy_id | 是 | String | 策略id |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| name | 否 | String | 规则名称 |
| page | 否 | Integer | 分页查询参数,第page页 |
| pagesize | 否 | Integer | 分页查询参数,每页显示pagesize条记录 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| X-Auth-Token | 是 | String | auth token |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| total | Integer | 策略下防护规则数量 |
| items | Array of ShowHttpAccessControlRuleResponseBody objects | 防护规则列表 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 规则id |
| name | String | 规则名称 |
| policy_id | String | 规则所在策略id |
| policy_name | String | 规则所在策略名称 |
| timestamp | Long | 创建规则时间戳 |
| description | String | 规则描述 |
| status | Integer | 规则开关状态 |
| time | Boolean | 是否设定生效时间 |
| start | Long | 生效时间 |
| terminal | Long | 失效时间 |
| priority | Integer | 优先级 |
| conditions | Array of HttpAccessControlRuleCondition objects | 命中条件 |
| action | HttpRuleAction object | 防护规则动作 |
| producer | Integer | 创建来源 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| category | String | 字段类型。可选值为:url、custom_asn、custom_geoip、robot、user-agent、ip、params、cookie、referer、header、method、request_line、request、response_code、response_length、response_time、response_header、response_body |
| index | String | 子字段:
|
| contents | Array of strings | 内容列表 |
| logic_operation | String | 处理逻辑 |
| value_list_id | String | 引用表id |
| size | Long | 若防护规则涉及阈值,即使用该字段 |
| check_all_indexes_logic | Integer | 1.所有子字段/2.任意子字段 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| category | String | 操作类型。
|
| followed_action_id | String | 攻击惩罚规则id,只有当category参数值为block时才可配置该参数 |
| detail | HttpRuleActionDetail object | 防护规则动作 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| redirect_url | String | 返回页面重定向的url |
| response | HttpRuleActionResponse object | 防护规则返回页面 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
状态码:401
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
状态码:500
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 标准化错误码:服务名.八位数字编码 |
| error_msg | String | 清晰的错误信息 |
| encoded_authorization_message | String | 对接IAM5.0的服务,拒绝访问时需要返回IAM的相关响应 |
请求示例
查询精准防护规则列表
GET https://esa.cn-north-4.myhuaweicloud.com/v1/edgesec/configuration/http/policies/a7bd0ca4b2ac48cfb8c59deebf6b64e0/access-control-rule?name=access_control&page=1&pagesize=10
响应示例
状态码:200
OK
{
"total" : 3,
"items" : [ {
"id" : "a5bd0ca4b2ac48cfb8c59deebf6b64e8",
"name" : "access_control1",
"policy_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e0",
"policy_name" : "policy_test1",
"timestamp" : 1731427500000,
"description" : "test",
"status" : 1,
"time" : true,
"start" : 1731423500000,
"terminal" : 1731427900000,
"priority" : 10,
"conditions" : [ {
"category" : "cookie",
"index" : "test",
"contents" : [ "aaa", "bbb" ],
"logic_operation" : "contain"
} ],
"action" : {
"category" : "block",
"followed_action_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e1"
},
"producer" : 1
}, {
"id" : "a5bd0ca4b2ac48cfb8c59deebf6b64e7",
"name" : "access_control2",
"policy_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e0",
"policy_name" : "policy_test2",
"timestamp" : 1731427500000,
"description" : "test",
"status" : 1,
"time" : true,
"start" : 1731423500000,
"terminal" : 1731427900000,
"priority" : 10,
"conditions" : [ {
"category" : "cookie",
"index" : "test",
"contents" : [ "aaa", "bbb" ],
"logic_operation" : "contain"
} ],
"action" : {
"category" : "block",
"followed_action_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e1"
},
"producer" : 1
}, {
"id" : "a5bd0ca4b2ac48cfb8c59deebf6b64e6",
"name" : "access_control3",
"policy_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e0",
"policy_name" : "policy_test3",
"timestamp" : 1731427500000,
"description" : "test",
"status" : 1,
"time" : true,
"start" : 1731423500000,
"terminal" : 1731427900000,
"priority" : 10,
"conditions" : [ {
"category" : "cookie",
"index" : "test",
"contents" : [ "aaa", "bbb" ],
"logic_operation" : "contain"
} ],
"action" : {
"category" : "block",
"followed_action_id" : "a7bd0ca4b2ac48cfb8c59deebf6b64e1"
},
"producer" : 1
} ]
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
| 400 | 请求失败 |
| 401 | token权限不足 |
| 500 | 服务器内部错误 |
错误码
请参见错误码。