SQL Query export failed


I have trouble making the SQL Query export work. There is some information that I want to extract from InsightVM that is not available through the API. More particularly, “new vs. remediated vulnerability.”

I use the provided example on GitHub: “insightvm-sql-queries/New-and-Remediated-Vulns-with-Vuln-details.sql at master · rapid7/insightvm-sql-queries · GitHub”.

It works well if I run the export on a specific site or tag that doesn’t contain many assets (fewer than 2000 assets), but it seems to fail each time I specify nothing (no scope) or try to run it on a larger site (special type) or tag, or even a larger group of assets (dynamic group). I don’t get any specific errors. When I run the report, I only get a “failed” notice. The preview doesn’t work either.

It is the same problem with any kind of report, including document reports as “Top Remediations” in PDF.

Do you know a way to make this work? For example, I don’t mind if I have to run a first SQL query export in order to retrieve information about the new and remediated vulnerability concerning the first two thousand assets of a specific site, then a second one to retrieve the rest. However, I don’t know how to do that using a SQL query. Or maybe there is another solution?

Thanks for your time and help.

My first question would be how many assets do you have?

But to split that query in half you would break it at the union. So the top select portion would stay and the select statement below the union would go first essentially and then flip flop for the other half.