Skip to content

Commit

Permalink
Merge pull request #91 from adevinta/human-output
Browse files Browse the repository at this point in the history
internal/report/human: add fingerprint, split resource rows
  • Loading branch information
jroimartin authored Aug 9, 2024
2 parents e259311 + 7761a9a commit 64b49d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cmd/lava/internal/help/helpdoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ The exclusion rules support the following filters:
target.
- resource: regular expression that matches the name of the affected
resource.
- fingerprint: context in where the vulnerability has been found. It
includes the checktype image, the affected target, the asset type
and the checktype options.
- fingerprint: context in where the vulnerability has been found.
- summary: regular expression that matches the summary of the
vulnerability.
- expiration: is the date on which the exclusion becomes inactive.
Expand Down
9 changes: 7 additions & 2 deletions internal/report/human.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ Number of excluded vulnerabilities not included in the summary table: {{.Exclude
{{$affectedResource | trim}}
{{end -}}

{{- if .Fingerprint}}
{{"FINGERPRINT" | bold}}
{{.Fingerprint | trim}}
{{end -}}

{{- if .Description}}
{{"DESCRIPTION" | bold}}
{{.Description | trim}}
Expand Down Expand Up @@ -152,8 +157,8 @@ Number of excluded vulnerabilities not included in the summary table: {{.Exclude
{{- define "vulnRsc" -}}
{{- $rsc := . -}}
- {{$rsc.Name | bold}}:
{{- range $row := $rsc.Rows}}{{range $header := $rsc.Header}}
{{$header | trim | bold}}: {{index $row $header | trim -}}
{{- range $row := $rsc.Rows}}{{range $i, $header := $rsc.Header}}
{{if eq $i 0}}- {{else}} {{end}}{{ $header | trim | bold}}: {{index $row $header | trim -}}
{{end}}{{end}}
{{- end -}}

Expand Down

0 comments on commit 64b49d0

Please sign in to comment.