处理告警事件
功能介绍
处理告警事件
URI
POST /v5/{project_id}/event/operate
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
租户项目ID |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enterprise_project_id |
否 |
String |
租户企业项目ID,查询所有企业项目时填写:all_granted_eps |
container_name |
否 |
String |
容器实例名称 |
container_id |
否 |
String |
容器Id |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
x-auth-token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
operate_type |
是 |
String |
处理方式,包含如下:
|
handler |
否 |
String |
备注信息 |
operate_event_list |
是 |
Array of OperateEventRequestInfo objects |
操作的事件列表 |
event_white_rule_list |
否 |
Array of EventWhiteRuleListRequestInfo objects |
用户自定义告警白名单规则列表 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
event_class_id |
是 |
String |
事件分类,包含如下:
|
event_id |
是 |
String |
事件编号 |
event_type |
是 |
Integer |
事件类型,包含如下:
|
occur_time |
是 |
Integer |
发生时间,毫秒 |
operate_detail_list |
是 |
Array of EventDetailRequestInfo objects |
操作详情信息列表,当 operate_type 为 add_to_alarm_whitelist 或 remove_from_alarm_whitelist 时,必传 keyword 和 hash;当 operate_type 为 add_to_login_whitelist 或 remove_from_login_whitelist 时,必传 login_ip, private_ip 和 login_user_name;当 operate_type 为 isolate_and_kill 或 do_not_isolate_or_kill 时,必传 agent_id,file_hash,file_path,process_pid;其余情况可不填写内容。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
agent_id |
否 |
String |
Agent ID |
process_pid |
否 |
Integer |
进程id |
file_hash |
否 |
String |
文件哈希 |
file_path |
否 |
String |
文件路径 |
file_attr |
否 |
String |
文件属性 |
keyword |
否 |
String |
告警事件关键字,仅用于告警白名单 |
hash |
否 |
String |
告警事件hash,仅用于告警白名单 |
private_ip |
否 |
String |
服务器私有IP |
login_ip |
否 |
String |
登录源IP |
login_user_name |
否 |
String |
登录用户名 |
container_id |
否 |
String |
容器ID |
container_name |
否 |
String |
容器名称 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
event_type |
是 |
Integer |
事件类型,包含如下:
|
field_key |
是 |
String |
加白字段,包含如下:
|
field_value |
是 |
String |
加白字段值 |
judge_type |
是 |
String |
通配符,包含如下:
|
响应参数
状态码:200
success
无
请求示例
手动处理告警事件类型为Rootkit、告警事件编号为2a71e1e2-60f4-4d56-b314-2038fdc39de6的入侵告警事件。
POST https://{endpoint}/v5/{project_id}/event/operate?enterprise_project_id=xxx { "operate_type" : "mark_as_handled", "handler" : "test", "operate_event_list" : [ { "event_class_id" : "rootkit_0001", "event_id" : "2a71e1e2-60f4-4d56-b314-2038fdc39de6", "occur_time" : 1672046760353, "event_type" : 1010, "operate_detail_list" : [ { "agent_id" : "c9bed5397db449ebdfba15e85fcfc36accee125c68954daf5cab0528bab59bd8", "file_hash" : "e8b50f0b91e3dce0885ccc5902846b139d28108a0a7976c9b8d43154c5dbc44d", "file_path" : "/usr/test", "process_pid" : 3123, "file_attr" : 33261, "keyword" : "file_path=/usr/test", "hash" : "e8b50f0b91e3dce0885ccc5902846b139d28108a0a7976c9b8d43154c5dbc44d", "login_ip" : "127.0.0.1", "private_ip" : "127.0.0.2", "login_user_name" : "root", "container_id" : "containerid", "container_name" : "/test" } ] } ] }
响应示例
无
状态码
状态码 |
描述 |
---|---|
200 |
success |
400 |
参数非法 |
401 |
鉴权失败 |
403 |
权限不足 |
404 |
资源未找到 |
500 |
系统异常 |
错误码
请参见错误码。