华为云用户手册

  • 响应示例 状态码: 200 请求成功响应信息 { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "MyXXX", "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "playbook" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "version_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "version" : "v1.1.1" }, "dataclass" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "909494e3-558e-46b6-a9eb-07a8e18ca62f" }, "dataobject" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "909494e3-558e-46b6-a9eb-07a8e18ca62f" }, "status" : "TERMINATED", "trigger_type" : "string", "start_time" : "2021-01-30T23:00:00Z+0800", "end_time" : "2021-01-30T23:00:00Z+0800" }
  • Python 重试所有操作剧本实例。 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 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 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.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("cn-north-4")) \ .build() try: request = ChangePlaybookInstanceRequest() request.body = OperationPlaybookInfo( operation="RETRY" ) response = client.change_playbook_instance(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用 IAM 服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:2097152 content-type 是 String application/json;charset=UTF-8 缺省值:application/json;charset=UTF-8 最小长度:1 最大长度:64 表3 请求Body参数 参数 是否必选 参数类型 描述 operation 否 String 操作类型。重试: RETRY 终止: TERMINATE 最小长度:0 最大长度:64
  • 响应参数 状态码: 200 表4 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表5 响应Body参数 参数 参数类型 描述 id String 剧本实例ID 最小长度:32 最大长度:64 name String 剧本实例名称 最小长度:0 最大长度:1024 project_id String 项目ID 最小长度:32 最大长度:64 playbook PlaybookInfoRef object 剧本信息 dataclass DataclassInfoRef object 数据类信息 dataobject DataobjectInfo object 数据对象详情 status String 剧本实例状态. (RUNNING--运行中、FINISHED--成功、FAILED--失败、RETRYING--重试中、TERMINATING--终止中、TERMINATED--已终止) 最小长度:32 最大长度:64 trigger_type String 触发类型. TIMER--定时触发, EVENT--事件触发 最小长度:0 最大长度:64 start_time String 创建时间 最小长度:0 最大长度:64 end_time String 更新时间 最小长度:0 最大长度:64 表6 PlaybookInfoRef 参数 参数类型 描述 id String 剧本ID 最小长度:32 最大长度:64 version_id String 剧本版本ID 最小长度:32 最大长度:64 name String 名称 最小长度:32 最大长度:64 version String 版本 最小长度:32 最大长度:64 表7 DataclassInfoRef 参数 参数类型 描述 id String 数据类ID 最小长度:32 最大长度:64 name String 数据类名称 最小长度:32 最大长度:64 表8 DataobjectInfo 参数 参数类型 描述 id String ID值 最小长度:32 最大长度:64 create_time String 创建时间 最小长度:0 最大长度:64 update_time String 更新时间 最小长度:0 最大长度:64 project_id String 项目ID 最小长度:32 最大长度:64 dataclass_id String 数据类ID 最小长度:32 最大长度:64 name String 名称 最小长度:0 最大长度:1024 content String 数据内容 最小长度:0 最大长度:4096 状态码: 400 表9 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表10 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • URI POST /v1/{project_id}/workspaces/{workspace_id}/soc/playbooks/instances/{instance_id}/operation 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:32 最大长度:36 workspace_id 是 String 工作空间ID 最小长度:32 最大长度:36 instance_id 是 String 剧本实例ID 最小长度:36 最大长度:36
  • 响应参数 状态码: 200 表4 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表5 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:1 最大长度:32 message String 错误信息 最小长度:1 最大长度:32 total Integer 总数 最小值:0 最大值:99999 size Integer 分页大小 最小值:0 最大值:9999 page Integer 当前页数 最小值:0 最大值:100 data Array of ActionInfo objects 剧本动作列表信息 数组长度:0 - 100 表6 ActionInfo 参数 参数类型 描述 id String 剧本流程动作ID 最小长度:32 最大长度:64 name String 流程动作名称 最小长度:0 最大长度:1024 description String 描述 最小长度:0 最大长度:1024 action_type String 流程动作类型 最小长度:0 最大长度:64 action_id String 流程ID 最小长度:32 最大长度:64 playbook_id String 剧本ID 最小长度:0 最大长度:64 playbook_version_id String 剧本版本ID 最小长度:0 最大长度:64 project_id String 项目ID 最小长度:0 最大长度:64 状态码: 400 表7 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表8 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • 响应示例 状态码: 200 请求成功响应参数 { "code" : 0, "message" : "Error message", "total" : 41, "size" : 3, "page" : 10, "data" : [ { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "MyXXX", "description" : "This my XXXX", "action_type" : "Workflow", "action_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "playbook_id" : "string", "playbook_version_id" : "string", "project_id" : "string" } ] }
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:2097152 content-type 是 String application/json;charset=UTF-8 缺省值:application/json;charset=UTF-8 最小长度:1 最大长度:64
  • URI GET /v1/{project_id}/workspaces/{workspace_id}/soc/playbooks/versions/{version_id}/actions 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:32 最大长度:36 workspace_id 是 String 工作空间ID 最小长度:32 最大长度:36 version_id 是 String 剧本版本ID 最小长度:32 最大长度:64 表2 Query参数 参数 是否必选 参数类型 描述 limit 是 Integer 分页查询参数,用于指定一次查询最多的结果数,从1开始 最小值:0 最大值:999999 offset 是 Integer 分页查询参数。用于指定查询结果的起始位置,从0开始 最小值:1 最大值:999999
  • 请求参数 表3 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:2097152 content-type 是 String application/json;charset=UTF-8 缺省值:application/json;charset=UTF-8 最小长度:1 最大长度:64
  • 响应参数 状态码: 200 表4 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表5 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:1 最大长度:32 message String 响应消息 最小长度:1 最大长度:32 data Array of ApproveOpinionDetail objects 剧本审核详情 数组长度:0 - 99 表6 ApproveOpinionDetail 参数 参数类型 描述 result String 审核结果 最小长度:0 最大长度:64 content String 审核内容 最小长度:0 最大长度:1028 状态码: 400 表7 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表8 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • URI GET /v1/{project_id}/workspaces/{workspace_id}/soc/playbooks/versions/approval 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID 最小长度:32 最大长度:36 workspace_id 是 String 工作空间ID 最小长度:32 最大长度:36 表2 Query参数 参数 是否必选 参数类型 描述 resource_id 否 String 资源ID 最小长度:0 最大长度:64 approve_type 否 String 审核类型。(PLAYBOOK-剧本, AOP_WORKFLOW--流程) 最小长度:0 最大长度:64
  • Python 查询告警列表,偏移量为10,查询3条 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 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 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.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("cn-north-4")) \ .build() try: request = ListAlertsRequest() request.body = DataobjectSearch( offset=10, limit=3 ) response = client.list_alerts(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Go 查询告警列表,偏移量为10,查询3条 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 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/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") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.ListAlertsRequest{} offsetDataobjectSearch:= int32(10) limitDataobjectSearch:= int32(3) request.Body = &model.DataobjectSearch{ Offset: &offsetDataobjectSearch, Limit: &limitDataobjectSearch, } response, err := client.ListAlerts(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 响应示例 状态码: 200 搜索告警列表返回body体 { "code" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "message" : "Error message", "total" : 41, "limit" : 2, "offset" : 1, "success" : true, "data" : [ { "data_object" : { "version" : "1.0", "environment" : { "vendor_type" : "MyXXX", "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f" }, "datasource" : { "source_type" : 3, "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f" }, "first_observed_time" : "2021-01-30T23:00:00Z+0800", "last_observed_time" : "2021-01-30T23:00:00Z+0800", "create_time" : "2021-01-30T23:00:00Z+0800", "arrive_time" : "2021-01-30T23:00:00Z+0800", "title" : "MyXXX", "description" : "This my XXXX", "source_url" : "http://xxx", "count" : 4, "confidence" : 4, "criticality" : 4, "alert_type" : { }, "network_list" : [ { "direction" : { "IN" : null }, "protocol" : "TCP", "src_ip" : "192.168.0.1", "src_port" : "1", "src_domain" : "xxx", "dest_ip" : "192.168.0.1", "dest_port" : "1", "dest_domain" : "xxx", "src_geo" : { "latitude" : 90, "longitude" : 180 }, "dest_geo" : { "latitude" : 90, "longitude" : 180 } } ], "resource_list" : [ { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "MyXXX", "type" : "MyXXX", "domain_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "region_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "ep_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "ep_name" : "MyXXX", "tags" : "909494e3-558e-46b6-a9eb-07a8e18ca62f" } ], "remediation" : { "recommendation" : "MyXXX", "url" : "MyXXX" }, "verification_state" : "Unknown – 未知,True_Positive – 确认,False_Positive – 误报。默认填写Unknown", "handle_status" : "Open – 打开,Block – 阻塞,Closed – 关闭。默认填写Open", "sla" : 60000, "update_time" : "2021-01-30T23:00:00Z+0800", "close_time" : "2021-01-30T23:00:00Z+0800", "ipdrr_phase" : "Prepartion|Detection and Analysis|Containm,Eradication& Recovery| Post-Incident-Activity", "simulation" : "false", "actor" : "刘一博", "owner" : "MyXXX", "close_comment" : "误检;已解决;重复;其他", "malware" : { "malware_family" : "family", "malware_class" : "恶意占用内存" }, "system_info" : { }, "process" : [ { "process_name" : "MyXXX", "process_path" : "MyXXX", "process_pid" : 123, "process_uid" : 123, "process_cmdline" : "MyXXX" } ], "user_info" : [ { "user_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "user_name" : "MyXXX" } ], "file_info" : [ { "file_path" : "MyXXX", "file_content" : "MyXXX", "file_new_path" : "MyXXX", "file_hash" : "MyXXX", "file_md5" : "MyXXX", "file_sha256" : "MyXXX", "file_attr" : "MyXXX" } ], "system_alert_table" : { }, "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca620" }, "create_time" : "2021-01-30T23:00:00Z+0800", "update_time" : "2021-01-30T23:00:00Z+0800", "project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "workspace_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "id" : "MyXXX", "version" : 123, "format_version" : 123, "dataclass_ref" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "MyXXX" } } ] }
  • Java 查询告警列表,偏移量为10,查询3条 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 48 49 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.secmaster.v2.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v2.*; import com.huaweicloud.sdk.secmaster.v2.model.*; public class ListAlertsSolution { 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"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); SecMasterClient client = SecMasterClient.newBuilder() .withCredential(auth) .withRegion(SecMasterRegion.valueOf("cn-north-4")) .build(); ListAlertsRequest request = new ListAlertsRequest(); DataobjectSearch body = new DataobjectSearch(); body.withOffset(10); body.withLimit(3); request.withBody(body); try { ListAlertsResponse response = client.listAlerts(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()); } } }
  • 响应参数 状态码: 200 表8 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表9 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误信息 最小长度:0 最大长度:1024 total Integer 告警总数 最小值:0 最大值:10000 limit Integer 分页大小 最小值:0 最大值:10000 offset Integer 偏移量 最小值:0 最大值:10000 success Boolean 是否成功 data Array of ListAlertDetail objects 告警列表 数组长度:0 - 10000 表10 ListAlertDetail 参数 参数类型 描述 data_object ListAlertRsp object 告警详情 create_time String Create time 最小长度:0 最大长度:64 update_time String Update time 最小长度:0 最大长度:64 project_id String Id value 最小长度:32 最大长度:64 workspace_id String Id value 最小长度:32 最大长度:64 id String The name, display only 最小长度:0 最大长度:1024 type String The name, display only 最小长度:0 最大长度:1024 version Integer The name, display only 最小值:0 最大值:1024 format_version Integer The name, display only 最小值:0 最大值:1024 dataclass_ref dataclass_ref object dataclass对象 表11 ListAlertRsp 参数 参数类型 描述 version String 版本 最小长度:1 最大长度:64 environment environment object 环境信息 datasource datasource object 数据源信息 first_observed_time String Update time 最小长度:0 最大长度:64 last_observed_time String Update time 最小长度:0 最大长度:64 create_time String Create time 最小长度:0 最大长度:64 arrive_time String Update time 最小长度:0 最大长度:64 title String The name, display only 最小长度:0 最大长度:1024 description String The description, display only 最小长度:0 最大长度:1024 source_url String 事件URL链接 最小长度:1 最大长度:64 count Integer 事件发生次数 最小值:0 最大值:5 confidence Integer 置信度 最小值:0 最大值:5 serverity String 严重性等级 最小长度:1 最大长度:64 criticality Integer 关键性,是指事件涉及的资源的重要性级别。 最小值:0 最大值:5 alert_type Object 事件分类 network_list Array of network_list objects network_list 数组长度:0 - 100 resource_list Array of resource_list objects network_list 数组长度:0 - 100 remediation remediation object 补救措施 verification_state String 验证状态 最小长度:1 最大长度:64 handle_status String 事件处理状态 最小长度:1 最大长度:64 sla String sla 最小长度:0 最大长度:65535 update_time String Create time 最小长度:0 最大长度:64 close_time String Create time 最小长度:0 最大长度:64 chop_phase String 周期/处置阶段编号 最小长度:4 最大长度:64 ipdrr_phase String 周期/处置阶段编号 最小长度:4 最大长度:64 ppdr_phase String 周期/处置阶段编号 最小长度:4 最大长度:64 simulation String 是否为调试事件. 最小长度:0 最大长度:64 actor String 委托人 最小长度:0 最大长度:64 owner String The name, display only 最小长度:0 最大长度:1024 cteator String The name, display only 最小长度:0 最大长度:1024 close_reason String 关闭原因 最小长度:32 最大长度:64 close_comment String 关闭原因 最小长度:0 最大长度:64 malware malware object 恶意软件 system_info Object 系统信息 process Array of process objects 进程信息 数组长度:0 - 100 user_info Array of user_info objects 用户信息 数组长度:0 - 100 file_info Array of file_info objects 文件信息 数组长度:0 - 100 system_alert_table Object 系统信息 id String Id value 最小长度:32 最大长度:64 workspace_id String workspace id 最小长度:32 最大长度:64 表12 environment 参数 参数类型 描述 vendor_type String The name, display only 最小长度:0 最大长度:1024 domain_id String Id value 最小长度:32 最大长度:64 region_id String Id value 最小长度:1 最大长度:64 project_id String Id value 最小长度:32 最大长度:64 表13 datasource 参数 参数类型 描述 source_type Integer current page count 最小值:0 最大值:9999 domain_id String Id value 最小长度:32 最大长度:64 project_id String Id value 最小长度:32 最大长度:64 region_id String Id value 最小长度:1 最大长度:64 表14 network_list 参数 参数类型 描述 direction Object 方向,取值范围:IN | OUT protocol String 协议,参考:IANA registered name 最小长度:1 最大长度:64 src_ip String 源IP地址 最小长度:0 最大长度:64 src_port Integer 源端口,0–65535 最小值:0 最大值:65535 src_domain String 源 域名 ,最大128个字符 最小长度:0 最大长度:128 dest_ip String 目的IP地址 最小长度:0 最大长度:64 dest_port String 目的端口,0–65535 最小长度:0 最大长度:64 dest_domain String 目的域名,最大128个字符 最小长度:0 最大长度:128 src_geo Object 源IP的地理位置信息 dest_geo Object 目的IP的地理位置信息 表15 resource_list 参数 参数类型 描述 id String Id value 最小长度:32 最大长度:64 name String The name, display only 最小长度:0 最大长度:1024 type String The name, display only 最小长度:0 最大长度:1024 domain_id String Id value 最小长度:32 最大长度:64 project_id String Id value 最小长度:32 最大长度:64 region_id String Id value 最小长度:0 最大长度:64 ep_id String Id value 最小长度:0 最大长度:64 ep_name String The name, display only 最小长度:0 最大长度:1024 tags String Id value 最小长度:0 最大长度:64 表16 remediation 参数 参数类型 描述 recommendation String The name, display only 最小长度:0 最大长度:1024 url String The name, display only 最小长度:0 最大长度:1024 表17 malware 参数 参数类型 描述 malware_family String 恶意家族 最小长度:0 最大长度:64 malware_class String 恶意软件分类 最小长度:0 最大长度:64 表18 process 参数 参数类型 描述 process_name String The name, display only 最小长度:0 最大长度:1024 process_path String The name, display only 最小长度:0 最大长度:1024 process_pid Integer Id value 最小值:1 最大值:2147483647 process_uid Integer Id value 最小值:1 最大值:2147483647 process_cmdline String The name, display only 最小长度:0 最大长度:1024 表19 user_info 参数 参数类型 描述 user_id String Id value 最小长度:0 最大长度:64 user_name String The name, display only 最小长度:0 最大长度:1024 表20 file_info 参数 参数类型 描述 file_path String The name, display only 最小长度:0 最大长度:1024 file_content String The name, display only 最小长度:0 最大长度:1024 file_new_path String The name, display only 最小长度:0 最大长度:1024 file_hash String The name, display only 最小长度:0 最大长度:1024 file_md5 String The name, display only 最小长度:0 最大长度:1024 file_sha256 String The name, display only 最小长度:0 最大长度:1024 file_attr String The name, display only 最小长度:0 最大长度:1024 表21 dataclass_ref 参数 参数类型 描述 id String Id value 最小长度:32 最大长度:64 name String The name, display only 最小长度:0 最大长度:1024 状态码: 400 表22 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表23 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) 最小长度:0 最大长度:2097152 content-type 是 String 内容类型 缺省值:application/json;charset=UTF-8 最小长度:0 最大长度:64 表3 请求Body参数 参数 是否必选 参数类型 描述 limit 否 Integer 分页大小 最小值:0 最大值:1000 offset 否 Integer 偏移量 最小值:0 最大值:1000 sort_by 否 String 排序字段:create_time | update_time 最小长度:0 最大长度:1000 order 否 String 排序方式:DESC | ASC 最小长度:0 最大长度:1000 枚举值: DESC ASC from_date 否 String 搜索开始时间 最小长度:0 最大长度:64 to_date 否 String 搜索结束时间 最小长度:0 最大长度:64 condition 否 condition object 搜索条件表达式 表4 condition 参数 是否必选 参数类型 描述 conditions 否 Array of conditions objects 表达式列表 数组长度:0 - 999 logics 否 Array of logics objects 表达式逻辑 数组长度:0 - 999 表5 conditions 参数 是否必选 参数类型 描述 name 否 String 表达式名称 最小长度:0 最大长度:64 data 否 Array of data objects 表达式内容 数组长度:0 - 999 表6 data 参数 是否必选 参数类型 描述 filed 否 String 字段 最小长度:0 最大长度:64 expression 否 String 逻辑表达式 最小长度:0 最大长度:64 value 否 String 字段值 最小长度:0 最大长度:64 表7 logics 参数 是否必选 参数类型 描述 name 否 String 表达式名称 最小长度:0 最大长度:64
  • 响应示例 状态码: 200 告警转事件返回body体 { "code" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "message" : "Error message", "data" : { "error_ids" : [ "909494e3-558e-46b6-a9eb-07a8e18ca62f" ], "success_ids" : [ "909494e3-558e-46b6-a9eb-07a8e18ca62f" ] } }
  • Python 将一条告警转为事件,告警ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,事件ID为909494e3-558e-46b6-a9eb-07a8e18ca621,告警状态为已关闭,是否标记为证据为否。 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 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 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.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("cn-north-4")) \ .build() try: request = CreateBatchOrderAlertsRequest() incidentTypeIncidentContent = OrderAlertIncidentContentIncidentType( id="909494e3-558e-46b6-a9eb-07a8e18ca62f", category="DDoS攻击", incident_type="DNS协议攻击" ) incidentContentbody = OrderAlertIncidentContent( title="XXX", incident_type=incidentTypeIncidentContent ) listIdsbody = [ "909494e3-558e-46b6-a9eb-07a8e18ca62f" ] request.body = OrderAlert( incident_content=incidentContentbody, ids=listIdsbody ) response = client.create_batch_order_alerts(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Go 将一条告警转为事件,告警ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,事件ID为909494e3-558e-46b6-a9eb-07a8e18ca621,告警状态为已关闭,是否标记为证据为否。 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 48 49 50 51 52 53 54 55 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/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") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.CreateBatchOrderAlertsRequest{} idIncidentType:= "909494e3-558e-46b6-a9eb-07a8e18ca62f" categoryIncidentType:= "DDoS攻击" incidentTypeIncidentType:= "DNS协议攻击" incidentTypeIncidentContent := &model.OrderAlertIncidentContentIncidentType{ Id: &idIncidentType, Category: &categoryIncidentType, IncidentType: &incidentTypeIncidentType, } titleIncidentContent:= "XXX" incidentContentbody := &model.OrderAlertIncidentContent{ Title: &titleIncidentContent, IncidentType: incidentTypeIncidentContent, } var listIdsbody = []string{ "909494e3-558e-46b6-a9eb-07a8e18ca62f", } request.Body = &model.OrderAlert{ IncidentContent: incidentContentbody, Ids: &listIdsbody, } response, err := client.CreateBatchOrderAlerts(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 请求示例 将一条告警转为事件,告警ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,事件ID为909494e3-558e-46b6-a9eb-07a8e18ca621,告警状态为已关闭,是否标记为证据为否。 { "ids" : [ "909494e3-558e-46b6-a9eb-07a8e18ca62f" ], "incident_content" : { "title" : "XXX", "incident_type" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "category" : "DDoS攻击", "incident_type" : "DNS协议攻击" } } }
  • 响应参数 状态码: 200 表6 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表7 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误信息 最小长度:0 最大长度:1024 data BatchOperateAlertResult object 批量操作告警返回对象 表8 BatchOperateAlertResult 参数 参数类型 描述 error_ids Array of strings 失败id 最小长度:0 最大长度:100 数组长度:0 - 100 success_ids Array of strings 成功id 最小长度:0 最大长度:100 数组长度:0 - 100 状态码: 400 表9 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表10 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值) 最小长度:0 最大长度:2097152 content-type 是 String 内容类型 缺省值:application/json;charset=UTF-8 最小长度:0 最大长度:64 表3 请求Body参数 参数 是否必选 参数类型 描述 ids 否 Array of strings 转事件的告警id列表 最小长度:0 最大长度:100 数组长度:0 - 999 incident_content 否 incident_content object 事件内容 表4 incident_content 参数 是否必选 参数类型 描述 title 否 String 事件名称 最小长度:0 最大长度:255 incident_type 否 incident_type object 事件类型 表5 incident_type 参数 是否必选 参数类型 描述 id 否 String 事件类型id 最小长度:0 最大长度:255 category 否 String 事件类型父类 最小长度:0 最大长度:255 incident_type 否 String 事件类型子类 最小长度:0 最大长度:255
  • Go 更新一个剧本动作,剧本名称为MyXXX,描述为This my XXXX,剧本动作类型为aopworkflow,剧本动作ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,排序顺序为string。 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 main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/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") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := secmaster.NewSecMasterClient( secmaster.SecMasterClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.UpdatePlaybookActionRequest{} sortOrderModifyActionInfo:= "string" actionIdModifyActionInfo:= "909494e3-558e-46b6-a9eb-07a8e18ca62f" actionTypeModifyActionInfo:= "aopworkflow" descriptionModifyActionInfo:= "This my XXXX" nameModifyActionInfo:= "MyXXX" request.Body = &model.ModifyActionInfo{ SortOrder: &sortOrderModifyActionInfo, ActionId: &actionIdModifyActionInfo, ActionType: &actionTypeModifyActionInfo, Description: &descriptionModifyActionInfo, Name: &nameModifyActionInfo, } response, err := client.UpdatePlaybookAction(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • Python 更新一个剧本动作,剧本名称为MyXXX,描述为This my XXXX,剧本动作类型为aopworkflow,剧本动作ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,排序顺序为string。 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 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 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.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = SecMasterClient.new_builder() \ .with_credentials(credentials) \ .with_region(SecMasterRegion.value_of("cn-north-4")) \ .build() try: request = UpdatePlaybookActionRequest() request.body = ModifyActionInfo( sort_order="string", action_id="909494e3-558e-46b6-a9eb-07a8e18ca62f", action_type="aopworkflow", description="This my XXXX", name="MyXXX" ) response = client.update_playbook_action(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 最小长度:1 最大长度:2097152 content-type 是 String application/json;charset=UTF-8 缺省值:application/json;charset=UTF-8 最小长度:1 最大长度:64 表3 请求Body参数 参数 是否必选 参数类型 描述 name 否 String 名称 最小长度:0 最大长度:1024 description 否 String 描述 最小长度:0 最大长度:1024 action_type 否 String 类型,默认AOP_WORKFLOW. 最小长度:0 最大长度:64 action_id 否 String 剧本动作ID 最小长度:32 最大长度:64 sort_order 否 String 排序方式 最小长度:0 最大长度:64
  • 响应参数 状态码: 200 表4 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表5 响应Body参数 参数 参数类型 描述 code String Error code 最小长度:1 最大长度:32 message String Error message 最小长度:1 最大长度:32 data ActionInfo object 剧本流程动作信息 表6 ActionInfo 参数 参数类型 描述 id String 剧本流程动作ID 最小长度:32 最大长度:64 name String 流程动作名称 最小长度:0 最大长度:1024 description String 描述 最小长度:0 最大长度:1024 action_type String 流程动作类型 最小长度:0 最大长度:64 action_id String 流程ID 最小长度:32 最大长度:64 playbook_id String 剧本ID 最小长度:0 最大长度:64 playbook_version_id String 剧本版本ID 最小长度:0 最大长度:64 project_id String 项目ID 最小长度:0 最大长度:64 状态码: 400 表7 响应Header参数 参数 参数类型 描述 X-request-id String 请求ID,格式为:request_uuid-timestamp-hostname 表8 响应Body参数 参数 参数类型 描述 code String 错误码 最小长度:0 最大长度:64 message String 错误描述 最小长度:0 最大长度:1024
  • 请求示例 更新一个剧本动作,剧本名称为MyXXX,描述为This my XXXX,剧本动作类型为aopworkflow,剧本动作ID为909494e3-558e-46b6-a9eb-07a8e18ca62f,排序顺序为string。 { "name" : "MyXXX", "description" : "This my XXXX", "action_type" : "aopworkflow", "action_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "sort_order" : "string" }
  • 响应示例 状态码: 200 请求成功响应参数 { "code" : 0, "message" : "Error message", "data" : { "id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "name" : "MyXXX", "description" : "This my XXXX", "action_type" : "Workflow", "action_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f", "playbook_id" : "string", "playbook_version_id" : "string", "project_id" : "string" } }
共100000条