Skip to content

Commit

Permalink
Merge pull request #85 from CiscoCXSecurity/master
Browse files Browse the repository at this point in the history
Working example to extract CVSS from PSIRT advisories
  • Loading branch information
santosomar committed May 3, 2021
2 parents 3fba367 + 7a4a1cd commit 819b972
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example_code/curl_examples/fetch-cvss-psirt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

CLIENTID="${1}"
CLIENTSECRET="${2}"

bearertoken="$(curl -s -k -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "client_id=${CLIENTID}" -d "client_secret=${CLIENTSECRET}" -d "grant_type=client_credentials" https://cloudsso.cisco.com/as/token.oauth2 | cut -f 4 -d "\"")"
printf "bearer token: ${bearertoken}\n"
curl -X GET -s -k -H "Accept: application/json" -H "Authorization: Bearer ${bearertoken}" https://api.cisco.com/security/advisories/all | tr "," "\n" | grep -i "cvrf" | cut -f 4 -d "\"" | while read advisoryurl
do
curl "${advisoryurl}" | grep -i "cvss"
done

0 comments on commit 819b972

Please sign in to comment.