查询已隔离文件列表
功能介绍
查询已隔离文件列表
调用方法
请参见如何调用API。
URI
GET /v5/{project_id}/event/isolated-file
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
enterprise_project_id |
否 |
String |
企业项目ID,查询所有企业项目时填写:all_granted_eps |
file_path |
否 |
String |
文件路径 |
host_name |
否 |
String |
服务器名称 |
private_ip |
否 |
String |
服务器私有IP |
public_ip |
否 |
String |
服务器公网IP |
file_hash |
否 |
String |
文件hash,当前为sha256 |
asset_value |
否 |
String |
资产重要性,包含如下3种
|
offset |
否 |
Integer |
偏移量:指定返回记录的开始位置 |
limit |
否 |
Integer |
每页显示个数 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) |
region |
是 |
String |
Region ID |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
total_num |
Integer |
总数 |
data_list |
Array of IsolatedFileResponseInfo objects |
已隔离文件详情 |
参数 |
参数类型 |
描述 |
---|---|---|
os_type |
String |
操作系统类型,包含如下2种。
|
host_id |
String |
主机ID |
host_name |
String |
服务器名称 |
file_hash |
String |
文件哈希 |
file_path |
String |
文件路径 |
file_attr |
String |
文件属性 |
isolation_status |
String |
隔离状态,包含如下:
|
private_ip |
String |
服务器私有IP |
public_ip |
String |
弹性公网IP地址 |
asset_value |
String |
资产重要性 |
update_time |
Integer |
更新时间,毫秒 |
agent_version |
String |
agent版本 |
isolate_source |
String |
隔离来源,包含如下:
|
event_name |
String |
事件名称 |
agent_event_info |
IsolateEventResponseInfo object |
隔离事件详情 |
antivirus_result_info |
AntivirusResultDetailInfo object |
病毒查杀结果详情 |
参数 |
参数类型 |
描述 |
---|---|---|
event_id |
String |
事件编号 |
event_class_id |
String |
事件分类,包含如下:
|
event_type |
Integer |
事件类型,包含如下:
|
event_name |
String |
事件名称 |
severity |
String |
威胁等级,包含如下:
|
container_name |
String |
容器实例名称,只有容器类型的告警有 |
image_name |
String |
镜像名称,只有容器类型的告警有 |
host_name |
String |
服务器名称 |
host_id |
String |
主机ID |
private_ip |
String |
服务器私有IP |
public_ip |
String |
弹性公网IP地址 |
os_type |
String |
操作系统类型,包含如下2种。
|
host_status |
String |
服务器状态,包含如下4种。
|
agent_status |
String |
Agent状态,包含如下5种。
|
protect_status |
String |
防护状态,包含如下2种。
|
asset_value |
String |
资产重要性,包含如下4种
|
attack_phase |
String |
攻击阶段,包含如下:
|
attack_tag |
String |
攻击标识,包含如下:
|
occur_time |
Integer |
发生时间,毫秒 |
handle_time |
Integer |
处理时间,毫秒,已处理的告警才有 |
handle_status |
String |
处理状态,包含如下:
|
handle_method |
String |
处理方式,已处理的告警才有,包含如下:
|
handler |
String |
备注信息,已处理的告警才有 |
recommendation |
String |
处置建议 |
description |
String |
告警说明 |
event_abstract |
String |
告警摘要 |
event_count |
Integer |
事件发生次数 |
参数 |
参数类型 |
描述 |
---|---|---|
result_id |
String |
病毒查杀结果ID |
malware_name |
String |
病毒名称 |
file_path |
String |
文件路径 |
file_hash |
String |
文件哈希 |
file_size |
Integer |
文件大小 |
file_owner |
String |
文件属主 |
file_attr |
String |
文件属性 |
file_ctime |
Integer |
文件创建时间 |
file_mtime |
Integer |
文件更新时间 |
update_time |
Integer |
更新时间,毫秒 |
agent_id |
String |
Agent ID |
请求示例
查询前10条已隔离的文件列表
GET https://{endpoint}/v5/{project_id}/event/isolated-file?limit=10&offset=0&enterprise_project_id=xxx
响应示例
状态码: 200
已隔离文件列表
{ "data_list" : [ { "file_attr" : "0", "file_hash" : "58693382bc0c9f60ef86e5b37cf3c2f3a9c9ec46936901eaa9131f7ee4a09bde", "file_path" : "C:\\Users\\Public\\Public Docker\\system32.exe", "os_type" : "Linux", "host_id" : "5a41ca47-8ea7-4a65-a8fb-950d03d8638e", "host_name" : "ecs-wi-800211", "isolation_status" : "isolated", "private_ip" : "127.0.0.2", "public_ip" : "127.0.0.1", "asset_value" : "common", "update_time" : 1698304933717, "agent_version" : "3.2.10", "isolate_source" : "event", "event_name" : "间谍软件", "antivirus_result_info" : { "result_id" : "5a41ca47-8ea7-4a65-a8fb-950d03d8638e", "malware_name" : "Win32.Virus.Hidrag", "file_attr" : "0", "file_hash" : "58693382bc0c9f60ef86e5b37cf3c2f3a9c9ec46936901eaa9131f7ee4a09bde", "file_path" : "C:\\Users\\Public\\Public Docker\\system32.exe", "file_size" : 58460, "file_owner" : "Administrators", "file_ctime" : 1700039800, "file_mtime" : 1700039800, "update_time" : 1698304933717, "agent_id" : "5a41ca47-8ea7-4a65-a8fb-950d03d8638e" }, "agent_event_info" : { "attack_phase" : "exploit", "attack_tag" : "abnormal_behavior", "event_class_id" : "lgin_1002", "event_id" : "d8a12cf7-6a43-4cd6-92b4-aabf1e917", "event_name" : "different locations", "event_type" : 4004, "handle_status" : "unhandled", "host_name" : "xxx", "occur_time" : 1661593036627, "private_ip" : "127.0.0.1", "severity" : "Medium", "os_type" : "Linux", "agent_status" : "online", "asset_value" : "common", "protect_status" : "opened", "host_status" : "ACTIVE", "description" : "", "event_abstract" : "", "image_name" : "image", "container_name" : "test", "host_id" : "5a41ca47-8ea7-4a65-a8fb-950d03d8638e", "public_ip" : "127.0.0.2", "handle_time" : 1698304933717, "handle_method" : "ignore", "recommendation" : "建议处置", "event_count" : 1 } } ], "total_num" : 1 }
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 ListIsolatedFileSolution { 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(); ListIsolatedFileRequest request = new ListIsolatedFileRequest(); try { ListIsolatedFileResponse response = client.listIsolatedFile(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 = ListIsolatedFileRequest() response = client.list_isolated_file(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.ListIsolatedFileRequest{} response, err := client.ListIsolatedFile(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
已隔离文件列表 |
错误码
请参见错误码。