Skip to content

Instantly share code, notes, and snippets.

@dirsigler
Created October 7, 2024 09:05
Show Gist options
  • Save dirsigler/94203bde437583d7aa6fce89e677f826 to your computer and use it in GitHub Desktop.
Save dirsigler/94203bde437583d7aa6fce89e677f826 to your computer and use it in GitHub Desktop.
Trivy Template to support Markdown reports for License scans
{{- if . }}
{{- range . }}
{{- if gt (len .Licenses) 0 }}
### Target: `{{ .Target }}`
#### Licenses Detected ({{ len .Licenses }})
| File Path | License Name | Severity | Confidence | Link |
|-----------|--------------|----------|------------|------|
{{- range .Licenses }}
| `{{ escapeXML .FilePath }}` | `{{ escapeXML .Name }}` | {{ escapeXML .Severity }} | {{ printf "%.2f" .Confidence }} | [Link]({{ escapeXML .Link }}) |
{{- end }}
{{- end }}
{{- end }}
{{- else }}
### Trivy Returned an Empty Report
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment