Question - how to run Asset Details Report

When in the InsightVM interface and looking at an asset I can run an ‘Asset Details Report’ to PDF. I have been looking for a way to run this in the Reports section, and if possible by API call. I have been poking around but so far have not found how to run a report formatted the same way. Does anyone know if this is possible? Thank you.

I think you’re referring to the “Create Asset Report” button on the asset details page.
Screen Shot 2022-11-23 at 10.48.44 AM

This just reroutes you to the reports page with the “Audit Report” template and scopes the report to that single asset for you.
Screen Shot 2022-11-23 at 10.50.12 AM

You could essentially use the API to create this as well. Use the example below and change out the Console Address, the base64 of the credentials, and the asset id you want to create the report for. Keep in mind this will only “create” the report and does not kick off generation or provide you with the results of that report. IF you add some logic in there for distribution to your email you could string another line on there to generate the report after creation so then you could get an email of the output as an attachment.

Also you would need to know the asset id for the scope you want ahead of time. You could also use the API for this to essentially do a query of the assets given a hostname and get the id returned and then use that to pass into the JSON body of the report generation.

import requests
import json

url = "https://Console Address:3780/api/3/reports"

payload = "{\n    \"format\": \"pdf\",\n    \"frequency\": {\n        \"type\": \"none\"\n    },\n    \"language\": \"en-US\",\n    \"name\": \"Asset report for <example asset>\",\n    \"riskTrend\": {\n        \"allAssets\": {\n            \"total\": true,\n            \"trend\": \"average-risk\"\n        },\n        \"assets\": false,\n        \"from\": \"P1Y\"\n    },\n    \"scope\": {\n        \"assets\": [\n            <asset id goes here>\n        ],\n        \"assetsInOnlyMostRecentScanOfSite\": false\n    },\n    \"template\": \"audit-report\",\n    \"timezone\": \"GMT\"\n}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json;charset=UTF-8',
  'Authorization': 'Basic base64'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
1 Like

Thank you. I think that reports information is contained in the one I am referring to but it’s not quite the same. This report groups the solutions that will fix the risk which I think will be a better communication to our users. I haven’t found any equivalent yet in the console reports. It would seem odd that this isn’t somehow available as an API report.

image