Modifying a Vulnerability Scan Policy
Function
This API is used to modify a vulnerability scan policy.
URI
PUT /v5/{project_id}/vulnerability/scan-policy
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
enterprise_project_id | No | String | Enterprise user ID. Note: The vulnerability scan policy affects the scan behavior of all servers under the tenant. Therefore, this parameter must be set to all_granted_eps if the multi-enterprise project is enabled. |
Request 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. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
scan_period | Yes | String | Scan period
|
scan_range_type | Yes | String | Range of hosts to be scanned. The options are as follows: -all_host -specific_host |
host_ids | No | Array of strings | Specifies the host ID list. This parameter is mandatory when scan_range_type is set to specific_host. |
scan_vul_types | No | Array of strings | List of scanned vulnerability types |
status | Yes | String | Scan policy status. The options are as follows: -open: enabled -close: disabled |
Response Parameters
None
Example Requests
Modify a vulnerability scan policy. The scan period is daily, scan scope is specified host, host ID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, and policy status is enabled.
PUT https://{endpoint}/v5/2b31ed520xxxxxxebedb6e57xxxxxxxx/vulnerability/scan-policy?enterprise_project_id=all_granted_eps{"scan_period" : "one_day","scan_range_type" : "specific_host","host_ids" : [ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ],"status" : "open"}
Example Responses
None
Status Codes
Status Code | Description |
---|---|
200 | Request succeeded. |
Error Codes
See Error Codes.
- URI