Skip to content

Commit 038cf16

Browse files
🎉 Add Kubeaudit fix_available field (#13684)
1 parent 573e263 commit 038cf16

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

dojo/tools/kubeaudit/parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,9 @@ def get_findings(self, filename, test):
8181
static_finding=True,
8282
dynamic_finding=False,
8383
)
84+
if msg:
85+
finding.fix_available = True
86+
else:
87+
finding.fix_available = False
8488
findings.append(finding)
8589
return findings

unittests/tools/test_kubeaudit_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ def test_parse_file_has_no_findings(self):
1515
self.assertEqual(findings[5].mitigation, "hostNetwork is set to 'true' in PodSpec. It should be set to 'false'.")
1616
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")
1717
self.assertEqual(findings[11].severity, "High")
18+
self.assertEqual(findings[11].fix_available, True)

0 commit comments

Comments
 (0)