nav-img
Advanced

Querying a Vulnerability Scan Policy

Function

This API is used to query a vulnerability scan policy.

URI

GET /v5/{project_id}/vulnerability/scan-policy

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

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

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

scan_period

String

Scan period

  • one_day

  • three_day

  • one_week

scan_vul_types

Array of strings

List of scanned vulnerability types

scan_range_type

String

Range of hosts to be scanned. The options are as follows:

-all_host

-specific_host

host_ids

Array of strings

Specifies the host ID list. When scan_range_type is set to specific_host, this parameter indicates the list of hosts to be scanned.

total_host_num

Long

Total number of hosts that can be scanned for vulnerabilities

status

String

Scan policy status. The options are as follows:

-open: enabled

-close: disabled

Example Requests

Query the vulnerability scan policy whose project_id is 2b31ed520xxxxxxebedb6e57xxxxxxxx.

GET https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/vulnerability/scan-policy

Example Responses

Status code: 200

Request succeeded.

{
"scan_period" : "one_day",
"scan_vul_types" : [ "linux_vul" ],
"scan_range_type" : "specific_host",
"host_ids" : [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ],
"total_host_num" : 5,
"status" : "open"
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes