WEB应用防火墙 WAF-创建JS脚本反爬虫规则:请求参数

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

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

Content-Type

String

内容类型

缺省值:application/json;charset=utf8

表4 请求Body参数

参数

是否必选

参数类型

描述

conditions

Array of AnticrawlerCondition objects

匹配条件列表

name

String

规则名称

type

String

JS脚本反爬虫规则类型,指定防护路径:anticrawler_specific_url 排除防护路径:anticrawler_except_url

priority

Integer

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

表5 AnticrawlerCondition

参数

是否必选

参数类型

描述

category

String

字段类型

枚举值:

  • url

  • user-agent

logic_operation

String

条件列表匹配逻辑, 包括:contain、not_contain、equal、not_equal、prefix、not_prefix、suffix、not_suffix、contain_any、not_contain_all、equal_any、not_equal_all、prefix_any、not_prefix_all、suffix_any、not_suffix_all

contents

Array of strings

条件列表逻辑匹配内容。当logic_operation参数不以any或者all结尾时,需要传该参数。

value_list_id

String

引用表id。当logic_operation参数以any或者all结尾时,需要传该参数。此外,引用表类型要与category类型保持一致。

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