Querying Suspicious Processes in the Process Whitelist
Function
This API is used to query suspicious processes in the process whitelist.
Calling Method
For details, see Calling APIs.
URI
GET /v5/{project_id}/app/event
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID. Constraints N/A Range The value can contain 1 to 256 characters. Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enterprise_project_id |
No |
String |
Definition Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID. To query assets in all enterprise projects, set this parameter to all_granted_eps. Constraints You need to set this parameter only after the enterprise project function is enabled. Range The value can contain 1 to 256 characters. Default Value 0: default enterprise project. |
last_days |
No |
Integer |
Definition Number of days to be queried. This parameter is manually exclusive with begin_time and end_time. Constraints N/A Range The value range is 1 to 30. Default Value N/A |
begin_time |
Yes |
Long |
Customized start time of a segment. The timestamp is accurate to seconds. The begin_time should be no more than two days earlier than the end_time. This parameter is mutually exclusive with the queried duration. |
end_time |
Yes |
Long |
Customized end time of a segment. The timestamp is accurate to seconds. The begin_time should be no more than two days earlier than the end_time. This parameter is mutually exclusive with the queried duration. |
host_name |
No |
String |
Definition Server name. Constraints N/A Range The value contains 1 to 256 characters. Default Value N/A |
host_ip |
No |
String |
Definition Server IP address. Constraints N/A Range The value contains 1 to 256 characters. Default Value N/A |
private_ip |
No |
String |
Definition Server private IP address. Constraints N/A Range The value can contain 1 to 128 characters. Default Value N/A |
handle_status |
No |
String |
Definition Handled or not. Constraints N/A Range Default Value N/A |
offset |
Yes |
Integer |
Definition Offset, which specifies the start position of the record to be returned. Constraints N/A Range The value range is 0 to 2,000,000. Default Value N/A |
limit |
Yes |
Integer |
Definition Number of records displayed on each page. Constraints N/A Range Value range: 10 to 200 Default Value 10 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token. Constraints N/A Range The value can contain 1 to 32,768 characters. Default Value N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
data_list |
Array of AppWhitelistEventResponseInfo objects |
data list |
total_num |
Integer |
Definition Total number. Range The value range is 0 to 2,147,483,647. |
Parameter |
Type |
Description |
---|---|---|
event_id |
String |
Definition Event ID. Range The value can contain 1 to 64 characters. |
event_class_id |
String |
Definition Event type. Range
|
event_type |
Integer |
Event type. Its value can be: |
event_name |
String |
Event name. |
severity |
String |
Definition Risk level. Range |
host_name |
String |
Definition Server name. Range The value can contain 1 to 256 characters. |
host_id |
String |
Definition Server ID. Range The value can contain 1 to 64 characters. |
private_ip |
String |
Definition Server private IP address. Range The value can contain 1 to 128 characters. |
public_ip |
String |
Definition EIP. Range The value can contain 1 to 256 characters. |
attack_phase |
String |
Definition Attack phase. Range |
attack_tag |
String |
Definition Attack tag. Range |
occur_time |
Integer |
Definition Occurrence time, accurate to milliseconds Range The value range is 0 to 9,223,372,036,854,775,807. |
handle_time |
Integer |
Definition Handling time, in milliseconds. This parameter is available only for handled alarms. Range The value range is 0 to 9,223,372,036,854,775,807. |
handle_status |
String |
Definition Handling status. Range |
handle_method |
String |
Definition Handling status. Constraints N/A Range Default Value N/A |
operate_accept_list |
Array of strings |
Definition Supported processing operation. Constraints N/A |
operate_detail_list |
Array of AppWhitelistEventDetailResInfo objects |
Operation details list (Not displayed on the page) |
resource_info |
Resource information (not displayed currently) |
|
recommendation |
String |
Definition Suggestion. Constraints N/A Range N/A Default Value N/A |
process_info |
Array of EventProcessResInfo objects |
Definition Offset: Process information list. Constraints N/A |
policy_id |
String |
Policy ID |
policy_name |
String |
Policy name |
os_type |
String |
Definition OS type. Range |
asset_value |
String |
Asset importance. Its value can be: |
host_status |
String |
Server status |
agent_status |
String |
Agent status. It can be: |
protect_status |
String |
Protection status. It can be: |
Parameter |
Type |
Description |
---|---|---|
agent_id |
String |
Definition Agent ID Constraints N/A Range The value can contain 1 to 64 characters. Default Value N/A |
process_pid |
Integer |
Definition Process ID. Range The value range is 0 to 2,147,483,647. |
file_hash |
String |
Definition File hash. Range The value can contain 1 to 256 characters. |
file_path |
String |
Definition File path. Range The value can contain 1 to 256 characters. |
file_attr |
String |
Definition File attribute. Range The value can contain 1 to 256 characters. |
private_ip |
String |
Definition Server private IP address. Range The value can contain 1 to 128 characters. |
login_ip |
String |
Definition Login source IP address. Range The value can contain 1 to 256 characters. |
login_user_name |
String |
Definition Login username. Range The value can contain 1 to 256 characters. |
Parameter |
Type |
Description |
---|---|---|
domain_id |
String |
Definition Tenant account ID. Range The value can contain 1 to 64 characters. |
project_id |
String |
Project ID |
enterprise_project_id |
String |
Specifies the ID of the enterprise project that the server belongs to. An enterprise project can be configured only after the enterprise project function is enabled. Enterprise project ID. The value 0 indicates the default enterprise project. To query servers in all enterprise projects, set this parameter to all_granted_eps. If you have only the permission on an enterprise project, you need to transfer the enterprise project ID to query the server in the enterprise project. Otherwise, an error is reported due to insufficient permission. |
region_name |
String |
Region ID |
vpc_id |
String |
Definition VPC ID Range The value can contain 1 to 64 characters. |
cloud_id |
String |
Definition Server ID. Range The value can contain 1 to 64 characters. |
vm_name |
String |
Definition VM name. Range The value can contain 1 to 64 characters. |
vm_uuid |
String |
Definition VM UUID. Range The value can contain 1 to 64 characters. |
container_id |
String |
Definition Container ID. Range The value can contain 1 to 128 characters. |
image_id |
String |
Definition Image ID. Range The value can contain 1 to 64 characters. |
image_name |
String |
Definition Image name. This parameter is available only for container alarms. Range The value can contain 1 to 256 characters. |
host_attr |
String |
Definition Server attribute. Range The value can contain 1 to 64 characters. |
service |
String |
Definition Business service. Range The value can contain 1 to 64 characters. |
micro_service |
String |
Definition Microservice. Range The value can contain 1 to 64 characters. |
sys_arch |
String |
Definition System CPU architecture. Range The value can contain 1 to 64 characters. |
os_bit |
String |
Definition OS bit version. Range The value can contain 1 to 64 characters. |
os_type |
String |
Definition OS type. Range |
os_name |
String |
OS name |
host_name |
String |
Definition Server name. Range The value can contain 1 to 256 characters. |
host_ip |
String |
Definition Server IP address. Range The value can contain 1 to 128 characters. |
public_ip |
String |
Definition EIP. Range The value can contain 1 to 256 characters. |
host_id |
String |
Definition Server ID. Range The value can contain 1 to 64 characters. |
pod_uid |
String |
Definition pod uid Range The value can contain 1 to 64 characters. |
pod_name |
String |
Definition pod name Range The value can contain 1 to 64 characters. |
namespace |
String |
Definition Namespace. Range The value can contain 1 to 64 characters. |
cluster_id |
String |
Cluster ID. |
cluster_name |
String |
Cluster name. |
asset_value |
String |
Asset importance. Its value can be: |
container_status |
String |
Container status. |
os_version |
String |
OS version. |
agent_version |
String |
Agent version |
Parameter |
Type |
Description |
---|---|---|
process_name |
String |
Definition Process name. Range The value can contain 1 to 128 characters. |
process_path |
String |
Definition Process path. Range The value can contain 1 to 256 characters. |
process_pid |
Integer |
Definition Process ID. Range The value range is 0 to 2,147,483,647. |
process_uid |
Integer |
Definition Process name. Range The value range is 0 to 2,147,483,647. |
process_username |
String |
Definition Process username. Range The value can contain 1 to 128 characters. |
process_cmdline |
String |
Definition Process command line. Constraints N/A |
process_filename |
String |
Definition Process file name. Range The value can contain 1 to 64 characters. |
process_start_time |
Integer |
Definition Process start time. Range The value range is 0 to 9,223,372,036,854,775,807. |
process_gid |
Integer |
Definition Process group ID. Range The value range is 0 to 2,147,483,647. |
process_egid |
Integer |
Definition Effective process group ID. Range The value range is 0 to 2,147,483,647. |
process_euid |
Integer |
Definition Effective process user ID Range The value range is 0 to 9,223,372,036,854,775,807. |
parent_process_name |
String |
Definition Parent process name. Range The value can contain 1 to 64 characters. |
parent_process_path |
String |
Definition Parent process file path. Range The value can contain 1 to 64 characters. |
parent_process_pid |
Integer |
Definition Parent process ID. Range The value range is 0 to 2,147,483,647. |
parent_process_uid |
Integer |
Definition User ID associated with the parent process. Range The value range is 0 to 2,147,483,647. |
parent_process_cmdline |
String |
Definition Parent process file command line. Range The value can contain 1 to 64 characters. |
parent_process_filename |
String |
Definition Parent process file name. Range The value can contain 1 to 64 characters. |
parent_process_start_time |
Integer |
Definition Parent process start time. Range The value range is 0 to 9,223,372,036,854,775,807. |
parent_process_gid |
Integer |
Definition Parent process group ID. Range The value range is 0 to 2,147,483,647. |
parent_process_egid |
Integer |
Definition Effective parent process group ID. Range The value range is 0 to 2,147,483,647. |
parent_process_euid |
Integer |
Definition Effective parent process user ID. Range The value range is 0 to 2,147,483,647. |
child_process_name |
String |
Definition Subprocess name. Range The value can contain 1 to 64 characters. |
child_process_path |
String |
Definition Subprocess file path. Range The value can contain 1 to 64 characters. |
child_process_pid |
Integer |
Definition Subprocess ID. Range The value range is 0 to 2,147,483,647. |
child_process_uid |
Integer |
Definition User ID associated with the subprocess. Range The value range is 0 to 2,147,483,647. |
child_process_cmdline |
String |
Definition Subprocess file command line. Range The value can contain 1 to 64 characters. |
child_process_filename |
String |
Definition Subprocess file name. Range The value can contain 1 to 64 characters. |
child_process_start_time |
Long |
Definition Subprocess start time. Range The value range is 0 to 9,223,372,036,854,775,807. |
child_process_gid |
Integer |
Definition Subprocess group ID. Range The value range is 0 to 2,147,483,647. |
child_process_egid |
Integer |
Definition Effective subprocess group ID. Range The value range is 0 to 2,147,483,647. |
child_process_euid |
Integer |
Definition Effective subprocess user ID. Range The value range is 0 to 2,147,483,647. |
virt_cmd |
String |
Definition Virtualization command. Range The value can contain 1 to 64 characters. |
virt_process_name |
String |
Definition Virtualization process name. Range The value can contain 1 to 64 characters. |
escape_mode |
String |
Definition Escape method. Range The value can contain 1 to 64 characters. |
escape_cmd |
String |
Definition Command executed after the escape. Range The value can contain 1 to 128 characters. |
process_hash |
String |
Definition Process startup file hash. Range The value can contain 1 to 64 characters. |
mode |
String |
Definition File attribute. Range The value can contain 1 to 64 characters. |
rule |
Integer |
Definition Rule. Range The value can contain 1 to 64 characters. |
score |
Integer |
Definition Score. Range The value can contain 1 to 64 characters. |
process_file_hash |
String |
Definition Process file hash. Range The value can contain 1 to 64 characters. |
parent_process_file_hash |
String |
Definition Hash of the parent process file. Range The value can contain 1 to 64 characters. |
ancestor_process_pid |
Integer |
Definition Grandparent process ID. Range Value range: 1 to 2,147,483,647 |
ancestor_process_cmdline |
String |
Definition Grandparent process command line. Range The value can contain 1 to 64 characters. |
ancestor_process_path |
String |
Definition Grandparent process path. Range The value can contain 1 to 64 characters. |
operate_type |
Integer |
Definition Operation type. Range Value range: 1 to 2,147,483,647 |
session_id |
Integer |
Definition Session ID. Range Value range: 1 to 2,147,483,647 |
Example Requests
None
Example Responses
Status code: 200
Request succeeded.
{ "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 Sample Code
The SDK sample code is as follows.
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) } } |
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
Status Code |
Description |
---|---|
200 |
Request succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot