Skip to content

Commit

Permalink
chore(secret): add reported issues related to secrets in junit templa…
Browse files Browse the repository at this point in the history
…te (#8193)
  • Loading branch information
fabiogermann authored Jan 13, 2025
1 parent 243e5a3 commit ca41a28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions contrib/junit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,15 @@
</testsuite>
{{- end }}

{{- if .Secrets }}
{{- $secrets := len .Secrets }}
<testsuite tests="{{ $secrets }}" failures="{{ $secrets }}" name="{{ .Target }}" time="0">{{ range .Secrets }}
<testcase classname="{{ .RuleID }}" name="[{{ .Severity }}] {{ .Title }}">
<failure message="{{ .Title }}" type="description">{{ escapeXML .Match }}</failure>
</testcase>
{{- end }}
</testsuite>
{{- end }}

{{- end }}
</testsuites>
4 changes: 2 additions & 2 deletions docs/docs/configuration/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ If Trivy is installed using rpm then default templates can be found at `/usr/loc
|:----------------:|:---------:|
| Vulnerability ||
| Misconfiguration ||
| Secret | |
| License | |
| Secret | |
| License | |

In the following example using the template `junit.tpl` XML can be generated.
```
Expand Down

0 comments on commit ca41a28

Please sign in to comment.