获取WAF规则的例外配置。
| 参数名称 | 描述 |
|---|---|
serviceTypeString | 安全服务类型。有使用多个不同的安全服务时,需要填写具体的服务类型。 |
| 参数名称 | 描述 |
|---|---|
*domainListList | 域名列表。 |
*ruleIdListList | WAF规则ID列表。 |
| 参数名称 | 描述 |
|---|---|
codeString | 可选值:查看参数值 请参照错误码。 |
msgString | 描述信息。 |
dataList | 出参数据。 |
idString | 规则例外ID。 |
domainString | 域名。 |
ruleIdInteger | WAF规则ID。 |
typeString | 可选值:ippathuriurlParamNameurlParamValueuserAgenthttpHeaderNamehttpHeaderValuecookiebodybodyParamNamebodyParamValue 匹配条件。
ip:IP
path:路径
uri:URI
urlParamName:URI参数名
urlParamValue:URI参数值
userAgent:User Agent
httpHeaderName:请求头部名称
httpHeaderValue:请求头部值
cookie:Cookie
body:Body
bodyParamName:Body参数名
bodyParamValue:Body参数值 |
matchTypeString | 可选值:EQUALCONTAINREGEX 匹配类型,IP只能是等于。
EQUAL:等于
CONTAIN:包含
REGEX:正则匹配 |
contentListList | 规则例外内容。
matchType=EQUAL时,大小写敏感。 |
| 错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
|---|---|---|---|
| 40010 | Request\nparameter\nerror. | 200 | 请求参数错误。 |
| 500 | Server\nerror. | 200 | 服务器错误。 |
#!/bin/bash
username="example_username"
# Note that this must be a single quote to avoid the special $ character
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/api/v1/waf/rule-exception/list-normal" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"domainList": [
"waap.example.com"
],
"ruleIdList": [
5005
]
}'{
"code": 200,
"msg": "Success",
"data": [
{
"id": "1234567890123456789",
"domain": "waap.example.com",
"ruleId": 5005,
"type": "ip",
"matchType": "EQUAL",
"contentList": [
"1.1.1.1"
]
}
]
}