Skip to content

Instantly share code, notes, and snippets.

@antlas0
Created January 25, 2024 08:00
Show Gist options
  • Save antlas0/1e30b228d3e5f21a60eb5e8b098a723c to your computer and use it in GitHub Desktop.
Save antlas0/1e30b228d3e5f21a60eb5e8b098a723c to your computer and use it in GitHub Desktop.
Trivy template files
{{- $critical := 0 }}
{{- $high := 0 }}
{{- $medium := 0 }}
{{- $low := 0 }}
{{- range . }}
{{- range .Vulnerabilities }}
{{- if eq .Severity "CRITICAL" }}{{- $critical = add $critical 1 }}{{- end }}
{{- if eq .Severity "HIGH" }}{{- $high = add $high 1 }}{{- end }}
{{- if eq .Severity "MEDIUM" }}{{- $medium = add $medium 1 }}{{- end }}
{{- if eq .Severity "LOW" }}{{- $low = add $low 1 }}{{- end }}
{{- end }}
{{- end }}
critical, high, medium, low
{{ $critical }}, {{ $high }}, {{ $medium }}, {{ $low }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment