DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

Listing All Computers


The API https://api.amp.cisco.com/v1/computers
fetches the list of all computers. It requires basic
authentication headers and uses the GET method.
Example 11-12 shows a Python requests command that
uses this API.


Example 11-12 Python Code to Get a List of All
Computers via API


Click here to view code image


""" GET list of all computers via API """
import requests
url = "https://api.amp.cisco.com/v1/computers"
headers = {
'authorization': "Basic
ZGVhZGJlZWYxMjM0NDhjY2MwMGQ6WFhYWFhYWFgtWVlZWS1aWlpaL
TAwMDAtZTM4NGVmMmR4eHh4",
'cache-control': "no-cache",
}
response = requests.request("GET", url,
headers=headers)
print(response.text)

Listing All Vulnerabilities


The API https://api.amp.cisco.com/v1/vulnerabilities
fetches a list of all vulnerabilities. The list can be filtered
to show only the vulnerable programs detected for a
specific time range. The start_time and end_time
parameters accept the date and time expressed according
to ISO 8601.


The list contains a summary of information such as the
following on a vulnerability:


Application name and version
SHA-256 value for the executable file
Connectors on which the vulnerable application was observed
The most recent CVSS score
Free download pdf