Skip to content

Commit

Permalink
importer: trivy_operator: support parsing array of Trivy resources, n…
Browse files Browse the repository at this point in the history
…ot only a single resource
  • Loading branch information
pna-nca committed Jul 31, 2024
1 parent 95aad59 commit 3b2fa67
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dojo/tools/trivy_operator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ def get_findings(self, scan_file, test):

if data is None:
return []

if isinstance(data, dict):
self.handle_resource(data, test)
else:
for resource in data:
self.handle_resource(resource, test)

def handle_resource(self, data, test):
metadata = data.get("metadata", None)
if metadata is None:
return []
Expand Down

0 comments on commit 3b2fa67

Please sign in to comment.