10-26-2017 12:23 PM
I had a need to obtain all the PSIRTs for Cisco ASA in CSV format similar to how the Cisco IOS Software Checker performs.
1. Follow this document to authenticate. You need to run that authentication script. The Script below relies on variables set in the auth script.
NOTE: Remember the access_token is ONLY valid for one hour after you obtained it.
2. Run the code below.
# Clear all Used Variables
$token_type=''
$access_token=''
$auth_header=''
$url=''
$headers=''
$response=''
# Create the Headers and the WebRequest
$token_type=$auth_response.token_type.ToString()
$access_token=$auth_response.access_token.ToString()
$auth_header=$token_type + ' ' + $access_token
$headers=@{Accept='application/xml';Authorization=$auth_header}
$url='https://api.cisco.com/security/advisories/cvrf/product?product=asa'
# Send the Query
$response=Invoke-RestMethod -URI $url -Method Get -Header $headers
#Write the Output
$response.advisories.advisory | Export-Csv -Path c:\temp\asa-psirts.csv
One thing I noticed is that in the CSV there are several fields that have no usable value eg. bugIDs, ipsSignatures, cves, etc, I just hide \ delete these. I'll wrap text on the Summary column & vertically center all the columns.
Hope this helps. Please rate and comment!
02-09-2018 06:21 AM
Is there any way to filter by specific versions of the ASA?
03-19-2018 08:20 AM
Not that I have found.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide