Skip to content

Commit febb64f

Browse files
committed
Save point #5
1 parent 2fdf2a9 commit febb64f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

plugins/rapid7_insightvm/komand_rapid7_insightvm/triggers/scan_completion/trigger.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def run(self, params={}):
3939
last_id = resp["id"]
4040

4141
while True:
42+
43+
if site_id and site_id in response[0]['siteId']:
44+
continue
45+
4246
while True:
4347
endpoint = Asset.assets(self.connection.console_url, last_id + 1)
4448

@@ -65,18 +69,20 @@ def run(self, params={}):
6569
# Next, run GET Asset Vulnerabilities to retrieve vulnerability IDs
6670
endpoint = VulnerabilityResult.vulnerabilities_for_asset(self.connection.console_url, last_id + 1)
6771
try:
68-
asset_vuln_response = resource_helper.resource_request(endpoint=endpoint, method="get")
72+
asset_vuln_response = resource_helper.paged_resource_request(endpoint=endpoint, method="get")
6973
except Exception:
7074
break
7175

72-
# Add all the IDs into a list
76+
# Add all the vulnerability IDs related to the asset into a list
7377
vulnerability_ids = []
74-
for i in asset_vuln_response:
75-
vulnerability_ids.append(i.get('id'))
78+
for vulns in asset_vuln_response:
79+
for i in vulns:
80+
for j in i:
81+
vulnerability_ids.append(j.get('id'))
7682

7783
# Next, Get Asset Vulnerability Solution by vulnerability ID
7884
for vulnerability_id in vulnerability_ids:
79-
endpoint = Asset.asset_vulnerability_solution(self.connection.console_url, last_id + 1, vuln_id)
85+
endpoint = Asset.asset_vulnerability_solution(self.connection.console_url, last_id + 1, vulnerability_id)
8086
try:
8187
solution_response = resource_helper.resource_request(endpoint=endpoint, method="get")
8288
except Exception:

plugins/rapid7_insightvm/plugin.spec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4510,7 +4510,7 @@ triggers:
45104510
risk_score:
45114511
title: Risk Score
45124512
description: Risk score
4513-
type: integer
4513+
type: float
45144514
required: false
45154515
cve:
45164516
title: CVE

0 commit comments

Comments
 (0)