From a51a63f771829eef32b49c05ef03e54bc31c1814 Mon Sep 17 00:00:00 2001 From: Manuel Sommer Date: Sun, 10 Nov 2024 23:35:25 +0100 Subject: [PATCH] update --- dojo/tools/kubescape/parser.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dojo/tools/kubescape/parser.py b/dojo/tools/kubescape/parser.py index 9a379253bbf..aed1af0a64a 100644 --- a/dojo/tools/kubescape/parser.py +++ b/dojo/tools/kubescape/parser.py @@ -100,20 +100,20 @@ def get_findings(self, filename, test): steps_to_reproduce += "\t**Rules:** " + str(json.dumps(control["rules"], indent=4)) + "\n" steps_to_reproduce += "Resource object may contain evidence:" + "\n" steps_to_reproduce += "\t**Resource object:** " + str(json.dumps(resource["object"], indent=4)) - - find = Finding( - title=textwrap.shorten(title, 150), - test=test, - description=description, - mitigation=mitigation, - steps_to_reproduce=steps_to_reproduce, - severity=severity, - component_name=resourceid, - static_finding=True, - dynamic_finding=False, - ) - findings.append(find) - if controlID is not None: - find.unsaved_vulnerability_ids = [] - find.unsaved_vulnerability_ids.append(controlID) + if control["rules"][0]["status"] is not "passed": + find = Finding( + title=textwrap.shorten(title, 150), + test=test, + description=description, + mitigation=mitigation, + steps_to_reproduce=steps_to_reproduce, + severity=severity, + component_name=resourceid, + static_finding=True, + dynamic_finding=False, + ) + findings.append(find) + if controlID is not None: + find.unsaved_vulnerability_ids = [] + find.unsaved_vulnerability_ids.append(controlID) return findings