Prisma Cloud: Generating Spreadsheet For Alerts Through Prisma Cloud APIs
1525
Created On 06/22/22 23:58 PM - Last Modified 02/15/24 21:08 PM
Objective
How to successfully generate and download a spreadsheet of alerts by making calls to Prisma Cloud CSPM APIs.
Environment
- Prisma Cloud CSPM
- API (Application Programming Interface)
- Postman
Procedure
- Make sure you’re logged in and have access to your tenant. You’ll use the Login Generate Token call in the Prisma Cloud Collection.
GUI path: Collections > Prisma Cloud > Login > Login Generate Token
Note: 200 OK status code confirms a successful login attempt and tenant connection
- Submit a CSV job by using the Submit Alert CSV Generation Job call.
- To implement filters for your alerts, add them to the body of your payload as shown in the screenshot above
- Get the Job ID from the response of the Submit Alert CSV Generation Job call.
- Use the Job ID from the response of the previous API call in the GET https://{{api-endpoint}}/alert/csv/jobId/status.
- Run the previous call again until you see the status in the response change to "READY_TO_DOWNLOAD."
- Run the GET https://{{api-endpoint}}/alert/csv/jobId/download
Note: The response of the above API call contains all the detailed alerts according to the filters applied
- Click on Save Response > Save to a file to download all the alerts in spreadsheet.
- Open the downloaded spreadsheet.
Additional Information
Accessing Prisma Cloud Through API Calls
For you to be able to call Prisma Cloud APIs, you’ll need to have your access keys generated. To generate an access key for yourself please follow these steps. Two popular ways to call APIs are Postman and cURL. This documentation will mostly talk about Postman. Please go through these steps to generate JSON Web Tokens (JWT) in Prisma Cloud.
Setting Up Postman
Prisma Cloud CSPM has a Github repository with a collection of not all but most API calls that you can use. This repository also contains instructions for setting up Postman.
Note: some calls in this collection might be incomplete. For these incomplete calls, please refer to our API documentation for Prisma Cloud CSPM.