查询进程白名单可疑进程
功能介绍
查询进程白名单可疑进程
调用方法
请参见如何调用API。
URI
GET /v5/{project_id}/app/event
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 项目ID,用于明确项目归属,配置后可通过该ID查询项目下资产。获取方式请参见获取项目ID。 约束限制: 不涉及 取值范围: 字符长度1-256位 默认取值: 不涉及 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enterprise_project_id |
否 |
String |
参数解释: 企业项目ID,用于过滤不同企业项目下的资产。获取方式请参见获取企业项目ID。 如需查询所有企业项目下的资产请传参“all_granted_eps”。 约束限制: 开通企业项目功能后才需要配置企业项目ID参数。 取值范围: 字符长度1-256位 默认取值: 0,表示默认企业项目(default)。 |
last_days |
否 |
Integer |
参数解释: 查询时间范围天数,与自定义查询时间begin_time,end_time互斥 约束限制: 不涉及 取值范围: 最小值1,最大值30 默认取值: 不涉及 |
begin_time |
是 |
Long |
自定义查询时间,与查询时间范围天数互斥,查询时间段的起始时间,毫秒级时间戳,end_time减去begin_time小于等于2天,与查询时间范围天数互斥 |
end_time |
是 |
Long |
自定义查询时间,与查询时间范围天数互斥,查询时间段的起始时间,毫秒级时间戳,end_time减去begin_time小于等于2天,与查询时间范围天数互斥 |
host_name |
否 |
String |
参数解释: 服务器名称 约束限制: 不涉及 取值范围: 字符长度1-256位 默认取值: 不涉及 |
host_ip |
否 |
String |
参数解释: 主机IP 约束限制: 不涉及 取值范围: 字符长度1-256位 默认取值: 不涉及 |
private_ip |
否 |
String |
参数解释: 服务器私有IP 约束限制: 不涉及 取值范围: 字符长度1-128位 默认取值: 不涉及 |
handle_status |
否 |
String |
参数解释: 是否已处理 约束限制: 不涉及 取值范围:
默认取值: 不涉及 |
offset |
是 |
Integer |
参数解释: 偏移量:指定返回记录的开始位置 约束限制: 不涉及 取值范围: 最小值0,最大值2000000 默认取值: 不涉及 |
limit |
是 |
Integer |
参数解释: 每页显示个数 约束限制: 不涉及 取值范围: 取值10-200 默认取值: 10 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
参数解释: 用户Token,包含了用户的身份、权限等信息,在调用API接口时,可通过Token进行身份认证。获取方式请参见获取用户Token。 约束限制: 不涉及 取值范围: 字符长度1-32768位 默认取值: 不涉及 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
data_list |
Array of AppWhitelistEventResponseInfo objects |
data list |
total_num |
Integer |
参数解释: 总数 取值范围: 最小值0,最大值2147483647 |
参数 |
参数类型 |
描述 |
---|---|---|
event_id |
String |
参数解释: 事件ID 取值范围: 字符长度1-64位 |
event_class_id |
String |
参数解释: 事件分类 取值范围:
|
event_type |
Integer |
事件类型,包含如下:
|
event_name |
String |
事件名称
|
severity |
String |
参数解释: 威胁等级 取值范围:
|
host_name |
String |
参数解释: 服务器名称 取值范围: 字符长度1-256位 |
host_id |
String |
参数解释: 主机ID 取值范围: 字符长度1-64位 |
private_ip |
String |
参数解释: 服务器私有IP 取值范围: 字符长度1-128位 |
public_ip |
String |
参数解释: 弹性公网IP地址 取值范围: 字符长度1-256位 |
attack_phase |
String |
参数解释: 攻击阶段 取值范围:
|
attack_tag |
String |
参数解释: 攻击标识 取值范围:
|
occur_time |
Integer |
参数解释: 发生时间,毫秒 取值范围: 最小值0,最大值9223372036854775807 |
handle_time |
Integer |
参数解释: 处置时间,毫秒,已处理的告警才有 取值范围: 最小值0,最大值9223372036854775807 |
handle_status |
String |
参数解释: 处理状态 取值范围:
|
handle_method |
String |
参数解释: 处理状态 约束限制: 不涉及 取值范围:
默认取值: 不涉及 |
operate_accept_list |
Array of strings |
参数解释: 支持的处理操作 约束限制: 不涉及 |
operate_detail_list |
Array of AppWhitelistEventDetailResInfo objects |
操作详情信息列表(页面不展示) |
resource_info |
资源信息(当前不展示) |
|
recommendation |
String |
参数解释: 处置建议 约束限制: 不涉及 取值范围: 不涉及 默认取值: 不涉及 |
process_info |
Array of EventProcessResInfo objects |
参数解释: 偏移量:进程信息列表 约束限制: 不涉及 |
policy_id |
String |
策略ID |
policy_name |
String |
策略名称 |
os_type |
String |
参数解释: 操作系统类型 取值范围:
|
asset_value |
String |
资产重要性,包含如下3种
|
host_status |
String |
服务器状态 |
agent_status |
String |
Agent状态,包含如下6种。
|
protect_status |
String |
防护状态,包含如下2种。
|
参数 |
参数类型 |
描述 |
---|---|---|
agent_id |
String |
参数解释: Agent ID 约束限制: 不涉及 取值范围: 字符长度1-64位 默认取值: 不涉及 |
process_pid |
Integer |
参数解释: 进程ID 取值范围: 最小值0,最大值2147483647 |
file_hash |
String |
参数解释: 文件哈希 取值范围: 字符长度1-256位 |
file_path |
String |
参数解释: 文件路径 取值范围: 字符长度1-256位 |
file_attr |
String |
参数解释: 文件属性 取值范围: 字符长度1-256位 |
private_ip |
String |
参数解释: 服务器私有IP 取值范围: 字符长度1-128位 |
login_ip |
String |
参数解释: 登录源IP 取值范围: 字符长度1-256位 |
login_user_name |
String |
参数解释: 登录用户名 取值范围: 字符长度1-256位 |
参数 |
参数类型 |
描述 |
---|---|---|
domain_id |
String |
参数解释: 租户账号ID 取值范围: 字符长度1-64位 |
project_id |
String |
项目ID |
enterprise_project_id |
String |
主机所属的企业项目ID。 开通企业项目功能后才需要配置企业项目。 企业项目ID默认取值为“0”,表示默认企业项目。如果需要查询所有企业项目下的主机,请传参“all_granted_eps”。如果您只有某个企业项目的权限,则需要传递该企业项目ID,查询该企业项目下的主机,否则会因权限不足而报错。 |
region_name |
String |
Region ID |
vpc_id |
String |
参数解释: VPC ID 取值范围: 字符长度1-64位 |
cloud_id |
String |
参数解释: 云主机ID 取值范围: 字符长度1-64位 |
vm_name |
String |
参数解释: 虚拟机名称 取值范围: 字符长度1-64位 |
vm_uuid |
String |
参数解释: 虚拟机UUID 取值范围: 字符长度1-64位 |
container_id |
String |
参数解释: 容器ID 取值范围: 字符长度1-128位 |
image_id |
String |
参数解释: 镜像ID 取值范围: 字符长度1-64位 |
image_name |
String |
参数解释: 镜像名称,只有容器类型的告警有 取值范围: 字符长度1-256位 |
host_attr |
String |
参数解释: 主机属性 取值范围: 字符长度1-64位 |
service |
String |
参数解释: 业务服务 取值范围: 字符长度1-64位 |
micro_service |
String |
参数解释: 微服务 取值范围: 字符长度1-64位 |
sys_arch |
String |
参数解释: 系统CPU架构 取值范围: 字符长度1-64位 |
os_bit |
String |
参数解释: 操作系统位数 取值范围: 字符长度1-64位 |
os_type |
String |
参数解释: 操作系统类型 取值范围:
|
os_name |
String |
操作系统名称 |
host_name |
String |
参数解释: 服务器名称 取值范围: 字符长度1-256位 |
host_ip |
String |
参数解释: 主机IP 取值范围: 字符长度1-128位 |
public_ip |
String |
参数解释: 弹性公网IP地址 取值范围: 字符长度1-256位 |
host_id |
String |
参数解释: 主机ID 取值范围: 字符长度1-64位 |
pod_uid |
String |
参数解释: pod uid 取值范围: 字符长度1-64位 |
pod_name |
String |
参数解释: pod name 取值范围: 字符长度1-64位 |
namespace |
String |
参数解释: 名称空间 取值范围: 字符长度1-64位 |
cluster_id |
String |
集群ID |
cluster_name |
String |
集群名称 |
asset_value |
String |
资产重要性,包含如下3种
|
container_status |
String |
容器状态 |
os_version |
String |
系统版本 |
agent_version |
String |
agent版本 |
参数 |
参数类型 |
描述 |
---|---|---|
process_name |
String |
参数解释: 进程名称 取值范围: 字符长度1-128位 |
process_path |
String |
参数解释: 进程路径 取值范围: 字符长度1-256位 |
process_pid |
Integer |
参数解释: 进程ID 取值范围: 最小值0,最大值2147483647 |
process_uid |
Integer |
参数解释: 进程名称 取值范围: 最小值0,最大值2147483647 |
process_username |
String |
参数解释: 运行进程的用户名 取值范围: 字符长度1-128位 |
process_cmdline |
String |
参数解释: 进程命令行 约束限制: 不涉及 |
process_filename |
String |
参数解释: 进程文件名 取值范围: 字符长度1-64位 |
process_start_time |
Integer |
参数解释: 进程启动时间 取值范围: 最小值0,最大值9223372036854775807 |
process_gid |
Integer |
参数解释: 进程组ID 取值范围: 最小值0,最大值2147483647 |
process_egid |
Integer |
参数解释: 进程有效组ID 取值范围: 最小值0,最大值2147483647 |
process_euid |
Integer |
参数解释: 进程有效用户ID 取值范围: 最小值0,最大值9223372036854775807 |
parent_process_name |
String |
参数解释: 父进程名称 取值范围: 字符长度1-64位 |
parent_process_path |
String |
参数解释: 父进程文件路径 取值范围: 字符长度1-64位 |
parent_process_pid |
Integer |
参数解释: 父进程id 取值范围: 最小值0,最大值2147483647 |
parent_process_uid |
Integer |
参数解释: 父进程用户id 取值范围: 最小值0,最大值2147483647 |
parent_process_cmdline |
String |
参数解释: 父进程文件命令行 取值范围: 字符长度1-64位 |
parent_process_filename |
String |
参数解释: 父进程文件名 取值范围: 字符长度1-64位 |
parent_process_start_time |
Integer |
参数解释: 父进程启动时间 取值范围: 最小值0,最大值9223372036854775807 |
parent_process_gid |
Integer |
参数解释: 父进程组ID 取值范围: 最小值0,最大值2147483647 |
parent_process_egid |
Integer |
参数解释: 父进程有效组ID 取值范围: 最小值0,最大值2147483647 |
parent_process_euid |
Integer |
参数解释: 父进程有效用户ID 取值范围: 最小值0,最大值2147483647 |
child_process_name |
String |
参数解释: 子进程名称 取值范围: 字符长度1-64位 |
child_process_path |
String |
参数解释: 子进程文件路径 取值范围: 字符长度1-64位 |
child_process_pid |
Integer |
参数解释: 子进程id 取值范围: 最小值0,最大值2147483647 |
child_process_uid |
Integer |
参数解释: 子进程用户id 取值范围: 最小值0,最大值2147483647 |
child_process_cmdline |
String |
参数解释: 子进程文件命令行 取值范围: 字符长度1-64位 |
child_process_filename |
String |
参数解释: 子进程文件名 取值范围: 字符长度1-64位 |
child_process_start_time |
Long |
参数解释: 子进程启动时间 取值范围: 最小值0,最大值9223372036854775807 |
child_process_gid |
Integer |
参数解释: 子进程组ID 取值范围: 最小值0,最大值2147483647 |
child_process_egid |
Integer |
参数解释: 子进程有效组ID 取值范围: 最小值0,最大值2147483647 |
child_process_euid |
Integer |
参数解释: 子进程有效用户ID 取值范围: 最小值0,最大值2147483647 |
virt_cmd |
String |
参数解释: 虚拟化命令 取值范围: 字符长度1-64位 |
virt_process_name |
String |
参数解释: 虚拟化进程名称 取值范围: 字符长度1-64位 |
escape_mode |
String |
参数解释: 逃逸方式 取值范围: 字符长度1-64位 |
escape_cmd |
String |
参数解释: 逃逸后执行的命令 取值范围: 字符长度1-128位 |
process_hash |
String |
参数解释: 进程启动文件hash 取值范围: 字符长度1-64位 |
mode |
String |
参数解释: 文件属性 取值范围: 字符长度1-64位 |
rule |
Integer |
参数解释: 规则 取值范围: 字符长度1-64位 |
score |
Integer |
参数解释: 分数 取值范围: 字符长度1-64位 |
process_file_hash |
String |
参数解释: 进程文件hash 取值范围: 字符长度1-64位 |
parent_process_file_hash |
String |
参数解释: 父进程文件hash 取值范围: 字符长度1-64位 |
ancestor_process_pid |
Integer |
参数解释: 祖父进程id 取值范围: 最小值1,最大值2147483647 |
ancestor_process_cmdline |
String |
参数解释: 祖父进程命令行 取值范围: 字符长度1-64位 |
ancestor_process_path |
String |
参数解释: 祖父进程路径 取值范围: 字符长度1-64位 |
operate_type |
Integer |
参数解释: 操作类型 取值范围: 最小值1,最大值2147483647 |
session_id |
Integer |
参数解释: 会话id 取值范围: 最小值1,最大值2147483647 |
请求示例
无
响应示例
状态码:200
请求已成功
{ "total_num" : 4715, "data_list" : [ { "severity" : "High", "event_id" : "4517fc****-a0ad-11ef-9ac9-********", "event_class_id" : "appwl_1001", "event_type" : 3040, "event_name" : "Untrusted process running", "host_id" : "4517fc**-be4f-4cbe-9467-******", "attack_phase" : "installation", "attack_tag" : "abnormal_behavior", "occur_time" : 1731385152000, "handle_status" : "unhandled", "operate_accept_list" : [ "add_to_app_whitelist" ], "operate_detail_list" : [ { "agent_id" : "3ed2e2aa24b******1231324********8c28f59cae2780e7bf6adf4e", "process_pid" : 1549, "file_path" : "/usr/bin/login" } ], "resource_info" : { "project_id" : "84b52****e489fa6549888832dc62", "enterprise_project_id" : "0", "region_name" : "cn-north-7", "host_name" : "ecs-hce", "host_ip" : "192.168.0.178", "public_ip" : "100.93.9.43", "host_id" : "2c9****09-be4f-4cbe-9467-73b****8e48f", "asset_value" : "common", "cloud_id" : "", "vm_name" : "ecs-hce", "vm_uuid" : "2c****e09-be4f-4cbe-9467-73b80****e48f", "os_type" : "Linux", "os_name" : "HCE", "os_version" : "2.0" }, "process_info_list" : [ { "process_name" : "login", "process_path" : "/usr/bin/login", "process_pid" : 1549, "process_uid" : 0, "process_cmdline" : "login -- root", "process_filename" : "login", "process_start_time" : 1719820957, "parent_process_name" : "systemd", "parent_process_path" : "/usr/lib/systemd/systemd", "parent_process_pid" : 1, "parent_process_cmdline" : "/usr/lib/systemd/systemd --switched-root --system --deserialize 16", "process_file_hash" : "d0364db3f6****d969c4475705d57154df518d0560****21abd34ca" } ] } ] }
SDK代码示例
SDK代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.hss.v5.region.HssRegion; import com.huaweicloud.sdk.hss.v5.*; import com.huaweicloud.sdk.hss.v5.model.*; public class ListAppWhitelistEventSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); HssClient client = HssClient.newBuilder() .withCredential(auth) .withRegion(HssRegion.valueOf("<YOUR REGION>")) .build(); ListAppWhitelistEventRequest request = new ListAppWhitelistEventRequest(); try { ListAppWhitelistEventResponse response = client.listAppWhitelistEvent(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkhss.v5.region.hss_region import HssRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkhss.v5 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = HssClient.new_builder() \ .with_credentials(credentials) \ .with_region(HssRegion.value_of("<YOUR REGION>")) \ .build() try: request = ListAppWhitelistEventRequest() response = client.list_app_whitelist_event(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" hss "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/hss/v5/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := hss.NewHssClient( hss.HssClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ListAppWhitelistEventRequest{} response, err := client.ListAppWhitelistEvent(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
请求已成功 |
错误码
请参见错误码。