Skip to content

Commit

Permalink
fix(vuln): GitLab report template
Browse files Browse the repository at this point in the history
- Upgrade to schema 14.0.6 (https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/blob/v14.0.6/dist/container-scanning-report-format.json).
- Drop unsupported `confidence` property. Currently optional and will be removed by GitLab in schema 15-0-0.
  • Loading branch information
thiago-gitlab committed Jul 25, 2022
1 parent c2f3731 commit 26853fc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contrib/gitlab.tpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- /* Template based on https://docs.gitlab.com/ee/user/application_security/container_scanning/#reports-json-format */ -}}
{
"version": "2.3",
"version": "14.0.6",
"vulnerabilities": [
{{- $t_first := true }}
{{- range . }}
{{- $target := .Target }}
{{ $image := $target | regexFind "^[^:\\s]+" }}
{{- range .Vulnerabilities -}}
{{- if $t_first -}}
{{- $t_first = false -}}
Expand All @@ -31,8 +32,6 @@
{{- else -}}
"{{ .Severity }}"
{{- end }},
{{- /* TODO: Define confidence */}}
"confidence": "Unknown",
"solution": {{ if .FixedVersion -}}
"Upgrade {{ .PkgName }} to {{ .FixedVersion }}"
{{- else -}}
Expand All @@ -51,7 +50,7 @@
},
{{- /* TODO: No mapping available - https://github.com/aquasecurity/trivy/issues/332 */}}
"operating_system": "Unknown",
"image": "{{ $target }}"
"image": "{{ $image }}"
},
"identifiers": [
{
Expand Down

0 comments on commit 26853fc

Please sign in to comment.