Vulnerabilities API Reference
This topic contains properties and examples for vulnerability APIs.
Examples of Vulnerability APIs
Get a Collection of all Vulnerabilities
This example sets the maximum number of vulnerability reports to 2. Not using this query parameter in this GET method would return all the vulnerability reports up to a maximum of 500.
Parameter | Description | Data Type |
---|---|---|
| Integer | |
| The maximum number of vulnerabilities returned by a call to
(Optional. If not specified, all vulnerabilities are returned up to a maximum of 500.) | Integer |
Curl Command to Get Collection of Vulnerabilities
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/7/vulnerabilities -H 'Accept: application/json' -u $KEY:$TOKEN
Response Body
[ { "href": "/orgs/2/vulnerabilities/qualys-xxxxxebe7e17", "name": "Host Scan Time", "score": 37, "description": "{\"severity\":\"1\"}", "cve_ids": [], "created_at": "2017-12-21T19:15:48.000Z", "updated_at": "2017-12-21T19:17:26.000Z", "created_by": null, "updated_by": null }, ........................................................... ]
Get an Individual Vulnerability
Parameters
Parameter | Description | Parameter Type |
---|---|---|
| Organization | Integer |
| The ID of the vulnerability to return by | String |
Curl Command to Get an Individual Vulnerability
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/7/vulnerabilities/qualys-xxxxxebe7e18 -H 'Accept: application/json' -u $KEY:$TOKEN
Response Body
{ "href": "/orgs/2/vulnerabilities/qualys-xxxxxebe7e18", "name": "Host Scan Time", "score": 37, "description": "{\"severity\":\"1\"}", "cve_ids": [], "created_at": "2017-12-21T19:15:48.000Z", "updated_at": "2017-12-21T19:17:26.000Z", "created_by": null, "updated_by": null }
Create or Update a Vulnerability
Parameters
Parameter | Description | Parameter Type | Data Type |
---|---|---|---|
| The ID of the vulnerability. The of the | Path | String |
| The normalized score of the vulnerability in the range of 0 to 100 inclusive. CVSS Score can be used here with a 10x multiplier. | Body | Integer |
| The title/name of the vulnerability. | Body | String |
| The | Body | [String] |
| An arbitrary field to store details about the vulnerability class. | Body | String |
Curl Command to Create or Update Vulnerability
curl -i -X PUT https://pce.my-company.com:8443/api/v2/orgs/7/vulnerabilities/qualys-xxxxxebe7e18 -H 'Content-Type: application/json' -u $KEY:$TOKEN -d '{"score": 50, "cve_ids": ["CVE-2012-xxxx", "CVE-2017-xxxx"], "description": "My vulnerability test."}'
Example Request Body
{ "score": 50, "cve_ids": ["CVE-2012-xxxx", "CVE-2017-xxxx"], "description": "My vulnerability test." }
Response
On success, the system displays HTTP/1.1 204 No Content
.
Request Parameter to delete a vulnerability
Parameter | Description | Parameter Type | Data Type |
---|---|---|---|
| The reference ID of the vulnerability. The last element of the returned by a call to | Path | String |
Curl Command to Delete Vulnerability
curl -i -X DELETE https://pce.my-company.com:8443/api/v2/orgs/7/vulnerabilities/qualys-xxxxxebe7e18 -u $KEY:$TOKEN
Curl Command to Get Collection of Vulnerability Reports
In this example, the maximum number of vulnerability reports is set to 2. Not using this query parameter in this GET method would return all the vulnerability reports up to a maximum of 500.
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/7/vulnerability_reports -H 'Accept: application/json' -u $KEY:$TOKEN
Query Parameter to Get a Collection of Vulnerability Reports
Parameter | Description | Parameter Type | Data Type |
---|---|---|---|
| The maximum number of vulnerability reports returned by a call to Optional. If not specified, by default, all vulnerability reports are returned up to a maximum of 500. | Query | Integer |
Response Body
[ { "href": "/orgs/2/vulnerability_reports/qualys-report-12345", "report_type": "qualys", "name": "my-report-2017-12-21-19-15-47", "created_at": "2017-12-21T19:15:48.000Z", "updated_at": "2017-12-21T19:15:48.000Z", "num_vulnerabilities": 4887, "created_by": null, "updated_by": null }, { "href": "/orgs/2/vulnerability_reports/qualys-report-12346", "report_type": "qualys", "name": "my-report-2017-12-21-19-17-15", "created_at": "2017-12-21T19:17:15.000Z", "updated_at": "2017-12-21T19:17:15.000Z", "num_vulnerabilities": 1776, "created_by": null, "updated_by": null } ]
Get a Vulnerability Report
Curl Command to Get Vulnerability Report
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/7/vulnerability_reports/qualys-report-123456 -H 'Accept: application/json' -u $KEY:$TOKEN
Request Parameter to Get an Individual Vulnerability Report
The following required path parameter restricts the results of the GET command to the specified vulnerability report.
Parameter | Description | Parameter Type | Data Type |
---|---|---|---|
| The ID of the vulnerability report (this is the last element in the vulnerability report HREF returned by a call to | Path | String |
Response Body
{ "href": "/orgs/2/vulnerability_reports/qualys-report-123456", "report_type": "qualys", "name": "my-report-2017-12-21-19-17-15", "created_at": "2017-12-21T19:17:15.000Z", "updated_at": "2017-12-21T19:17:15.000Z", "num_vulnerabilities": 1776, "created_by": null, "updated_by": null }
Create or Update a Vulnerability Report
Curl Command to Update a Vulnerability Report
curl -i -X PUT https://pce.my-company.com:8443/api/v2/orgs/7/vulnerability_reports/qualys-report-123456 -H 'Content-Type: application/json' -u $KEY:$TOKEN -d '{"name": "My vulnerability report", "report_type": "qualys"}'
Response Properties
Property | Description | Data Type |
---|---|---|
| User generated the name of the vulnerability report. | Integer |
| A string representing the type of the report. | String |
| Boolean value specifies whether a report is authoritative or not. | [String] |
| The ips on which the scan was performed. Enforced 100K maxitem limit. | String |
| An array of parameters, of which and Enforced 100K maxitem limit.
with this vulnerability (string)
class associated with this vulnerability (string) | |
| ( | |
| ( vulnerabilities | |
| ( |
Example Request Body
{ "name":"My vulnerability report", "report_type": "qualys", "authoritative": true }
Response
On success, the system displays HTTP/1.1 204 No Content
.
Curl Command to Delete Vulnerability Report
curl -i -X DELETE https://pce.my-company.com:8443/api/v2/orgs/7/vulnerability_reports/qualys-report-2017-12-21-19-17-15 -u $KEY:$TOKEN
Request Parameter
Parameter | Description | Parameter Type | Data Type |
---|---|---|---|
| The ID of the vulnerability report (this is the last element in the vulnerability report HREF returned by a call to | Path | String |