Inventory vulnerability
This endpoint returns CVEs corresponding to IP addresses associate with vulnerable workloads.
This API is only available to users with a minimum read access to root scope.
POST /openapi/v1/inventory/cves/{rootScopeID}
Parameters:
Name |
Type |
Description |
---|---|---|
ips |
list of strings |
List of IPs to fetch CVE information. |
The body of the request must be a JSON formatted query. An example of a query body is shown below.
{
"ips": [
"10.18.187.72",
"10.18.187.73"
]
}
Response
The response is an array of JSON objects in the body with the following properties.
Name |
Type |
Description |
---|---|---|
ip |
string |
IP address |
cve_ids |
list of strings |
List of CVE IDs on the inventory with the ip address. |
Sample Python code
root_scope_id = "5fa0d242497d4f7d968c669b"
req_payload = {
"ips":["10.18.187.72", "10.18.187.73"]
}
resp = restclient.post('/inventory/cves/' + root_scope_id, json_body=json.dumps(req_payload))
print resp.status_code
if resp.status_code == 200:
parsed_resp = json.loads(resp.content)
print json.dumps(parsed_resp, indent=4, sort_keys=True)