API中心

获取WAF内置规则的例外配置(非共享配置)

更新时间:2025-10-14 14:14:16

获取WAF规则的例外配置。

  • 单用户调用频率:300/5min
  • 适用产品:Cloud Security 2.0、Flood Shield 2.0
API鉴权说明详见:API鉴权概览

请求参数

请求头

参数名称描述
serviceTypeString
安全服务类型。有使用多个不同的安全服务时,需要填写具体的服务类型。

Body 参数

参数名称描述
*domainListList
域名列表。
*ruleIdListList
WAF规则ID列表。

返回参数

Body 参数

参数名称描述
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状态码语义
40010Request\nparameter\nerror.200请求参数错误。
500Server\nerror.200服务器错误。

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/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"
            ]
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!