I’m new to Rapid 7 and custom reports so this may be my lack of experience.
I need to pull assets with vulnerabilities that have been on the assets > xx days which have specific custom tags. This is so we can priorities vulnerabilities that regular patch management is not picking up.
I have the following query which pulls data into a csv.
I also have a custom tag which identified certain groups of assets.
I am not filtering for the custom tag in the SQL but relying on the Scope interface to do the filtering. This is so we can use the same query but run it against different tags.
I use this query to pull the data, and then in the Scope interface I select the TAGS that I want to filter for in my output. The issue is that the TAG selection in the scope seems to make no difference to the exported csv results. It seems the Scope filter on the interface has no effect on the export.
SELECT ds.name AS site, da.ip_address, da.host_name, da.mac_address, dv.title AS vulnerability_title, dv.severity,
round(dv.cvss_score::numeric, 2) AS cvss_score, round(dv.riskscore::numeric, 0) AS risk, fava.age_in_days, dos.description, dos.family
FROM fact_asset_vulnerability_finding favf
JOIN dim_asset da USING (asset_id)
JOIN dim_operating_system dos USING (operating_system_id)
JOIN dim_vulnerability dv USING (vulnerability_id)
JOIN dim_site_asset dsa USING (asset_id)
JOIN dim_site ds USING (site_id)
JOIN fact_asset_vulnerability_age fava using (asset_id, vulnerability_id)
ORDER BY da.ip_address ASC, dv.title ASC
The query is pulling ALL the assets as expected, but the CSV output also contains ALL the assets and isn’t being filtered by the custom TAG specified in the Scope interface.
I’ve also tried filtering the scope by Site, and that seems to have no effect either. It’s if the Scope in the interface where you can select, site, tages, group etc has no effect on the exported results from the query.