diff --git a/internal/report/human.tmpl b/internal/report/human.tmpl index 7990413..575c6d5 100644 --- a/internal/report/human.tmpl +++ b/internal/report/human.tmpl @@ -6,7 +6,7 @@ {{template "vulns" . -}} {{end -}} {{- if not .AllExclMatched}} -{{template "exclsNotMatched" . -}} +{{template "staleExcls" . -}} {{end -}} {{- end -}} @@ -161,39 +161,41 @@ Number of excluded vulnerabilities not included in the summary table: {{.Exclude {{- $rsc := . -}} - {{$rsc.Name | bold}}: {{- range $row := $rsc.Rows}}{{range $i, $header := $rsc.Header}} - {{if eq $i 0}}- {{else}} {{end}}{{ $header | trim | bold}}: {{index $row $header | trim -}} + {{if eq $i 0}}- {{else}} {{end}}{{$header | trim | bold}}: {{index $row $header | trim -}} {{end}}{{end}} {{- end -}} -{{- /* exclsNotMatched is the template used to render the details of a the not matched exclusions. */ -}} -{{define "exclsNotMatched" -}} -{{"The following exclusions don't match any finding:" | red }} +{{- /* staleExcls is the template used to render the details of the stale exclusions. */ -}} +{{- define "staleExcls" -}} +{{"STALE EXCLUSIONS" | bold | underline}} + {{range $excl := .Exclusions}} - {{- if not $excl.Matched -}} - {{template "excl" .}} - {{end -}} +{{- if not $excl.Matched}} +{{- template "excl" . -}} +{{end -}} {{end}} {{- end -}} {{- /* excl is the template used to render an exclusion. */ -}} {{- define "excl" -}} +{{- $pref := "- " -}} {{- if .Target}} -{{"Target: " | bold}}{{.Target | trim -}} +{{- $pref}}{{"Target" | bold}}: {{.Target | trim}}{{$pref = " "}} {{end -}} {{- if .Description}} -{{"Description: " | bold}}{{.Description | trim -}} +{{- $pref}}{{"Description" | bold}}: {{.Description | trim}}{{$pref = " "}} {{end -}} {{- if .Resource}} -{{"Resource: " | bold}}{{.Resource | trim -}} +{{- $pref}}{{"Resource" | bold}}: {{.Resource | trim}}{{$pref = " "}} {{end -}} {{- if .Fingerprint}} -{{"Fingerprint: " | bold}}{{.Fingerprint | trim -}} +{{- $pref}}{{"Fingerprint" | bold}}: {{.Fingerprint | trim}}{{$pref = " "}} {{end -}} {{- if .Summary}} -{{"Summary: " | bold}}{{.Summary | trim -}} +{{- $pref}}{{"Summary" | bold}}: {{.Summary | trim}}{{$pref = " "}} {{end -}} {{- if not .ExpirationDate.IsZero}} -{{"Expiration Date: " | bold}}{{.ExpirationDate.String | trim -}} +{{- $pref}}{{"Expiration Date" | bold}}: {{.ExpirationDate.String | trim}}{{$pref = " "}} {{end -}} {{- end -}}