Created
November 15, 2023 08:05
-
-
Save carhartl/08d33a0769a41da8c5ebc43aa03f3f4b to your computer and use it in GitHub Desktop.
JUnit report template for trivy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" ?> | |
<testsuites name="trivy"> | |
{{- range . -}} | |
{{- $failures := len .Vulnerabilities }} | |
<testsuite tests="{{ $failures }}" failures="{{ $failures }}" name="{{ .Target }}" errors="0" skipped="0" time=""> | |
{{- if not (eq .Type "") }} | |
<properties> | |
<property name="type" value="{{ .Type }}"></property> | |
</properties> | |
{{- end -}} | |
{{ range .Vulnerabilities }} | |
<testcase classname="{{ .PkgName }}-{{ .InstalledVersion }}" name="[{{ .Vulnerability.Severity }}] {{ .VulnerabilityID }}" time=""> | |
<failure message="{{ escapeXML .Title }}" type="description">{{ escapeXML .Description }}</failure> | |
</testcase> | |
{{- end }} | |
</testsuite> | |
{{- $failures := len .Misconfigurations }} | |
<testsuite tests="{{ $failures }}" failures="{{ $failures }}" name="{{ .Target }}" errors="0" skipped="0" time=""> | |
{{- if not (eq .Type "") }} | |
<properties> | |
<property name="type" value="{{ .Type }}"></property> | |
</properties> | |
{{- end -}} | |
{{ range .Misconfigurations }} | |
<testcase classname="{{ .Type }}" name="[{{ .Severity }}] {{ .ID }}" time=""> | |
<failure message="{{ escapeXML .Title }}" type="description">{{ escapeXML .Description }}</failure> | |
</testcase> | |
{{- end }} | |
</testsuite> | |
{{- end }} | |
</testsuites> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks and good job