diff --git a/dojo/tools/kubeaudit/parser.py b/dojo/tools/kubeaudit/parser.py index 26638bd6a2f..af7babaab73 100644 --- a/dojo/tools/kubeaudit/parser.py +++ b/dojo/tools/kubeaudit/parser.py @@ -81,5 +81,9 @@ def get_findings(self, filename, test): static_finding=True, dynamic_finding=False, ) + if msg: + finding.fix_available = True + else: + finding.fix_available = False findings.append(finding) return findings diff --git a/unittests/tools/test_kubeaudit_parser.py b/unittests/tools/test_kubeaudit_parser.py index 38b8e7ee8fd..9e5bdd0928a 100644 --- a/unittests/tools/test_kubeaudit_parser.py +++ b/unittests/tools/test_kubeaudit_parser.py @@ -15,3 +15,4 @@ def test_parse_file_has_no_findings(self): self.assertEqual(findings[5].mitigation, "hostNetwork is set to 'true' in PodSpec. It should be set to 'false'.") self.assertEqual(findings[8].description, "AuditResultName: AllowPrivilegeEscalationNil\nResourceApiVersion: v1\nResourceKind: Pod\nResourceName: storage-provisioner\nlevel: error\nmsg: allowPrivilegeEscalation not set which allows privilege escalation. It should be set to 'false'.\nContainer: storage-provisioner\nResourceNamespace: kube-system\n") self.assertEqual(findings[11].severity, "High") + self.assertEqual(findings[11].fix_available, True)