文档中心 API文档 查询WAF攻击趋势

查询WAF攻击趋势

更新时间:2023-01-12 14:04:04

适用产品

WEB应用防火墙

接口描述

查询WAF的攻击请求数趋势。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称描述
*domainsList
域名,数组。
*startTimeString
开始时间,yyyy-MM-dd HH:mm:ss。
*endTimeString
结束时间,yyyy-MM-dd HH:mm:ss。
timeZoneString
时区,默认GMT+8,即“GMT+8”。
intervalExpressionString
攻击趋势粒度,默认值:5m。 5m:5分钟 1h:小时 1d:天

返回参数

Body 参数

参数名称描述
codeString
0状态码表示请求成功,其他状态码说明请参见《错误码》。
messageString
错误信息或Success。
dataAttackRequestTrend
返回值。
hitList
检测请求数。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
检测请求数。
attackList
攻击请求数。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
攻击请求数。
ruleList
Web规则防护。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
Web规则防护。
protocolList
协议合规检测。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
协议合规检测。
webShellList
后门识别。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
后门识别。
accessList
访问控制/限速。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
访问控制/限速。
otherList
其他防护规则。
timeString
时间,yyyy-MM-dd HH:mm:ss。
textString
其他防护规则。

错误码

错误代码(code)描述(message)HTTP状态码语义
22992000ERROR_SYSTEM200系统错误
22992001ERROR_PARAM200参数错误
22992002ERROR_HEADER200请求头参数错误
22992003ERROR_ZONE200时区参数异常,请以GMT开头
22992004ERROR_TIME_ZONE200时区转换异常

示例

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://open.chinanetcenter.com/api/waf/report/query-attack-hit-trend" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{ 
"domains":["example.xxx.xxx"], 
"startTime":"2021-09-22 15:05:00", 
"endTime":"2021-09-22 15:10:00" 
}'
返回示例
复制代码 复制成功
{
  "code": "0",
  "message": "Success",
  "data": {
    "protocol": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "0"
      }
    ],
    "webShell": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "0"
      }
    ],
    "other": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "0"
      }
    ],
    "hit": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      }
    ],
    "access": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "2576"
      }
    ],
    "attack": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "2576"
      }
    ],
    "rule": [
      {
        "time": "2021-09-22 15:05:00",
        "text": "0"
      },
      {
        "time": "2021-09-22 15:10:00",
        "text": "0"
      }
    ]
  }
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!