Skip to content

Commit ca41a28

Browse files
authored
chore(secret): add reported issues related to secrets in junit template (#8193)
1 parent 243e5a3 commit ca41a28

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

contrib/junit.tpl

+10
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,15 @@
4444
</testsuite>
4545
{{- end }}
4646

47+
{{- if .Secrets }}
48+
{{- $secrets := len .Secrets }}
49+
<testsuite tests="{{ $secrets }}" failures="{{ $secrets }}" name="{{ .Target }}" time="0">{{ range .Secrets }}
50+
<testcase classname="{{ .RuleID }}" name="[{{ .Severity }}] {{ .Title }}">
51+
<failure message="{{ .Title }}" type="description">{{ escapeXML .Match }}</failure>
52+
</testcase>
53+
{{- end }}
54+
</testsuite>
55+
{{- end }}
56+
4757
{{- end }}
4858
</testsuites>

docs/docs/configuration/reporting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ If Trivy is installed using rpm then default templates can be found at `/usr/loc
415415
|:----------------:|:---------:|
416416
| Vulnerability ||
417417
| Misconfiguration ||
418-
| Secret | |
419-
| License | |
418+
| Secret | |
419+
| License | |
420420

421421
In the following example using the template `junit.tpl` XML can be generated.
422422
```

0 commit comments

Comments
 (0)