cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1620
Views
20
Helpful
2
Replies

Using PowerShell to obtain all PSIRTs for Cisco ASA

Tim Glen
Cisco Employee
Cisco Employee

Summary

I had a need to obtain all the PSIRTs for Cisco ASA in CSV format similar to how the Cisco IOS Software Checker performs.

Steps

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

Output

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!

2 Replies 2

Gamaquifor
Level 1
Level 1

Is there any way to filter by specific versions of the ASA?

Not that I have found.