nav-img
Advanced

Querying the List of Affected Servers of a Security Configuration Item

Function

This API is used to query the list of affected servers of a specified security configuration item.

URI

GET /v5/{project_id}/baseline/risk-config/{check_name}/hosts

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

check_name

Yes

String

Baseline name, for example, SSH, CentOS 7, and Windows.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project ID. To query all enterprise projects, set this parameter to all_granted_eps.

standard

Yes

String

Standard type. Its value can be:

  • cn_standard: DJCP MLPS compliance standard

  • hw_standard: Cloud security practice standard

host_name

No

String

Server name

host_ip

No

String

Server IP address

limit

No

Integer

Number of items per page

offset

No

Integer

Offset, which specifies the start position of the record to be returned.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Long

Total amount of data affected by configuration check

data_list

Data list

Table 5 SecurityCheckHostInfoResponseInfo

Parameter

Type

Description

host_id

String

Host ID

host_name

String

Server name

host_public_ip

String

Server public IP address

host_private_ip

String

Server private IP address

scan_time

Long

Scan time (ms)

failed_num

Integer

Number of risk items

passed_num

Integer

Number of passed items

Example Requests

This API is used to query the list of affected servers whose baseline name is SSH, check standard is cloud security practice standard, and enterprise project ID is xxx.

GET https://{endpoint}/v5/{project_id}/baseline/risk-config/SSH/hosts?standard=hw_standard&enterprise_project_id=xxx

Example Responses

Status code: 200

Request succeeded.

{
"total_num" : 1,
"data_list" : [ {
"failed_num" : 6,
"host_id" : "71a15ecc-049f-4cca-bd28-5e90aca1817f",
"host_name" : "zhangxiaodong2",
"host_private_ip" : "192.168.0.129",
"host_public_ip" : "*.*.*.10",
"passed_num" : 10,
"scan_time" : 1661716860935
} ]
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes