更新时间:2022-10-09 GMT+08:00

查询攻击事件列表

功能介绍

查询攻击事件列表,该API暂时不支持查询全部防护事件,pagesize参数不可设为-1

URI

GET /v1/{project_id}/waf/event

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

用户的project_id

表2 Query参数

参数

是否必选

参数类型

描述

recent

String

查询日志的时间范围,(不能和from、to同时使用)

from

Long

起始时间(13位时间戳),需要和to同时使用,不能和recent参数同时使用

to

Long

结束时间(13位时间戳),需要和from同时使用,不能和recent参数同时使用

hosts

Array

域名id,从获取防护网站列表(ListHost)接口获取域名id

page

Integer

分页查询时,返回第几页数据。范围0-100000,默认值为1,表示返回第1页数据。

pagesize

Integer

分页查询时,每页包含多少条结果。范围1-100,默认值为10,表示每页包含10条结果。

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

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

Content-Type

String

内容类型

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

total

Integer

攻击事件数量

items

Array of ListEventItems objects

攻击事件详情

表5 ListEventItems

参数

参数类型

描述

id

String

事件id

time

Long

次数

policyid

String

策略id

sip

String

源ip

host

String

域名

url

String

攻击的url链接

attack

String

攻击类型(XSS攻击:xss,sqli,命令注入:cmdi,恶意爬虫:robot,本地文件包含:lfi,远程文件包含:rfi,网站木马:webshell,cc攻击:cc,精准防护:custom_custom,IP黑白名单:custom_whiteblackip,地理位置访问控制:custom_geoip,防篡改:antitamper,反爬虫:anticrawler,网站信息防泄漏:leakage,非法请求:illegal,其它类型攻击:vuln)

rule

String

命中的规则id

payload

String

命中的载荷

action

String

防护动作

request_line

String

请求方法和路径

headers

headers object

请求头

cookie

String

请求cookie

status

String

响应码状态

region

String

区域

host_id

String

域名id

response_time

Long

响应时长

response_size

Integer

响应体大小

response_body

String

响应体

表6 headers

参数

参数类型

描述

content-length

String

请求长度

host

String

域名

content-type

String

内容类型

user-agent

String

代理

accept

String

接收内容类型

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 401

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

状态码: 500

表9 响应Body参数

参数

参数类型

描述

error_code

String

错误码

error_msg

String

错误信息

请求示例

响应示例

状态码

状态码

描述

200

ok

400

请求失败

401

token权限不足

500

服务器内部错误

错误码

请参见错误码