Skip to content

Commit

Permalink
feat(report): update gitlab template to check for os packages to dete…
Browse files Browse the repository at this point in the history
…rmine image and os
  • Loading branch information
aarongoldenthal committed Oct 22, 2024
1 parent 2536016 commit 4a5ad14
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions contrib/gitlab.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@
"status": "success",
"type": "container_scanning"
},
{{- $image := "Unknown" -}}
{{- $os := "Unknown" -}}
{{- range . }}
{{- if eq .Class "os-pkgs" -}}
{{- $target := .Target }}
{{- $image = $target | regexFind "[^\\s]+" }}
{{- $os = $target | splitList "(" | last | trimSuffix ")" }}
{{- end }}
{{- end }}
"vulnerabilities": [
{{- $t_first := true }}
{{- range . }}
{{- $target := .Target }}
{{- $image := $target | regexFind "[^\\s]+" }}
{{- $os := $target | splitList "(" | last | trimSuffix ")" }}
{{- if eq $os $target -}}
{{- $os = "Unknown" -}}
{{- end }}
{{- range .Vulnerabilities -}}
{{- if $t_first -}}
{{- $t_first = false -}}
Expand Down

0 comments on commit 4a5ad14

Please sign in to comment.