Hello,
I just started exploring the R7 api, I’d like to create a bulk exception. What I am need assistance with is where to find instance id.
here is my sample code (generated from postman)
import requests
import json
url = "https://redacted:3780/api/3/vulnerability_exceptions"
payload = json.dumps({
"expires": "",
"scope": {
"type": "asset",
"vulnerability": "Java CPU April 2015 Java SE 2D vulnerability (CVE-2015-046)"
},
"state": "Under Review",
"submit": {
"reason": "Acceptable Risk"
}
})
headers = {
'Authorization': 'Basic readcted=',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
running this returns this error
"messages": [
"Java CPU April 2015 Java SE 2D vulnerability (CVE-2015-046 is an invalid vulnerability. Please provide a valid vulnerability id.",
"The scope provided is invalid. All scopes besides 'All Instances' require an 'id' field be provided. Only Global exceptions can be applied with an 'id'."
],
I want to apply this to 5 different hosts at once (there are many other vulnerability exception to add as well). is it possible to pass in the asset name instead of the asset id because I have no clue where to find the asset id.