Skip to content

Commit

Permalink
🐛 fix trivyoperator tags (#11276)
Browse files Browse the repository at this point in the history
* 🐛 fix trivyoperator tags

* ruff

* fix unittest

* review

* ruff
  • Loading branch information
manuel-sommer authored Nov 22, 2024
1 parent 7dfc46c commit 43833fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dojo/tools/trivy_operator/checks_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ def handle_checks(self, labels, checks, test):
static_finding=True,
dynamic_finding=False,
service=service,
tags=[resource_namespace],
)
if resource_namespace != "":
finding.tags = resource_namespace
if check_id:
finding.unsaved_vulnerability_ids = [UniformTrivyVulnID().return_uniformed_vulnid(check_id)]
findings.append(finding)
Expand Down
3 changes: 2 additions & 1 deletion dojo/tools/trivy_operator/secrets_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def handle_secrets(self, labels, secrets, test):
static_finding=True,
dynamic_finding=False,
service=service,
tags=[resource_namespace],
)
if resource_namespace != "":
finding.tags = resource_namespace
findings.append(finding)
return findings
2 changes: 1 addition & 1 deletion dojo/tools/trivy_operator/vulnerability_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def handle_vulns(self, labels, vulnerabilities, test):
dynamic_finding=False,
service=service,
file_path=file_path,
tags=finding_tags,
tags=[tag for tag in finding_tags if tag != ""],
)
if vuln_id:
finding.unsaved_vulnerability_ids = [UniformTrivyVulnID().return_uniformed_vulnid(vuln_id)]
Expand Down

0 comments on commit 43833fa

Please sign in to comment.