WEB应用防火墙 WAF-查询精准防护规则列表:响应参数

时间:2024-01-26 15:43:52

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

total

Integer

数量

items

Array of CustomRule objects

防护规则列表

表5 CustomRule

参数

参数类型

描述

id

String

规则ID

policyid

String

策略ID

description

String

规则描述

status

Integer

规则状态,0:关闭,1:开启

conditions

Array of conditions objects

匹配条件列表,匹配条件必须同时满足。

action

CustomAction object

精准防护规则命中后操作对象

action_mode

Boolean

预留参数,可忽略。

priority

Integer

执行该规则的优先级,值越小,优先级越高,值相同时,规则创建时间早,优先级越高。取值范围:0到1000。

timestamp

Long

创建精准防护规则的时间戳

time

Boolean

精准防护规则生效时间:

  • “false”:表示该规则立即生效。

  • “true”:表示自定义生效时间。

start

Long

精准防护规则生效的起始时间戳(秒)。当time=true,才会返回该参数。

terminal

Long

精准防护规则生效的终止时间戳(秒)。当time=true,才会返回该参数。

producer

Integer

规则创建对象,该参数为预留参数,用于后续功能扩展,当前请用户忽略该参数

name

String

规则名称

表6 conditions

参数

参数类型

描述

category

String

字段类型。可选值为:url、user-agent、ip、params、cookie、referer、header、request_line、method、reqeust

index

String

子字段:

  • 字段类型为url、user-agent、ip、refer、request_line、method、reqeust时,不需要传index参数

  • 字段类型为params、header、cookie并且子字段为自定义时,index的值为自定义子字段

logic_operation

String

条件匹配逻辑。

contents

Array of strings

条件匹配的内容

value_list_id

String

引用表id。

表7 CustomAction

参数

参数类型

描述

category

String

操作类型。

  • “block”:拦截。

  • “pass”:放行。

  • “log”:仅记录

枚举值:

  • block

  • pass

  • log

followed_action_id

String

攻击惩罚规则id,只有当category参数值为block时才可配置该参数

状态码: 400

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 401

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 500

表10 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

support.huaweicloud.com/api-waf/ListCustomRules.html