Querying the Servers Affected by a Vulnerability¶
Function¶
This API is used to query the servers affected by a vulnerability.
URI¶
GET /v5/{project_id}/vulnerability/hosts
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID Minimum: 1 Maximum: 256 |
Parameter | Mandatory | Type | Description |
---|---|---|---|
enterprise_project_id | No | String | Enterprise project ID. The value 0 indicates the default enterprise project. To query all enterprise projects, set this parameter to all_granted_eps. Default: 0 Minimum: 0 Maximum: 128 |
vul_id | Yes | String | Vulnerability ID Minimum: 0 Maximum: 64 |
type | Yes | String | Vulnerability type. Its value can be:
|
host_name | No | String | Affected server name Minimum: 0 Maximum: 256 |
host_ip | No | String | IP address of the affected server Minimum: 0 Maximum: 128 |
status | No | String | Vulnerability status.
|
limit | No | Integer | Number of records displayed on each page. Minimum: 10 Maximum: 200 Default: 10 |
offset | No | Integer | Offset, which specifies the start position of the record to be returned. Minimum: 0 Maximum: 2000000 Default: 0 |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | User token. Minimum: 1 Maximum: 32768 |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
total_num | Integer | Number of affected servers Minimum: 0 Maximum: 10000 |
data_list | Array of VulHostInfo objects | List of affected ECSs Array Length: 1 - 10000 |
Parameter | Type | Description |
---|---|---|
host_id | String | ID of the server affected by the vulnerability Minimum: 1 Maximum: 128 |
severity_level | String | Risk level.
|
host_name | String | Affected server name Minimum: 1 Maximum: 256 |
host_ip | String | IP address of the affected server Minimum: 1 Maximum: 256 |
cve_num | Integer | Vulnerability CVEs Minimum: 0 Maximum: 10000 |
cve_id_list | Array of strings | The CVE ID list corresponding to the vulnerability Minimum: 1 Maximum: 64 Array Length: 1 - 10000 |
status | String | Vulnerability status.
|
repair_cmd | String | Command line to be executed to fix the vulnerability (This field is available only for Linux vulnerabilities.) Minimum: 1 Maximum: 256 |
Example Requests¶
Query the first 10 records in the list of servers with EulerOS-SA-2021-1894 vulnerability.
GET https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/vulnerability/hosts?vul_id=EulerOS-SA-2021-1894&offset=0&limit=10
Example Responses¶
Status code: 200
Vul host info list
{
"total_num" : 1,
"data_list" : [ {
"host_id" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"severity_level" : "Low",
"host_name" : "ecs",
"host_ip" : "xxx.xxx.xxx.xxx",
"cve_num" : 1,
"cve_id_list" : [ "CVE-2022-1664" ],
"status" : "vul_status_ignored",
"repair_cmd" : "zypper update update-alternatives"
} ]
}
Status Codes¶
Status Code | Description |
---|---|
200 | Vul host info list |
Error Codes¶
See Error Codes.