diff --git a/contrib/gitlab-codequality.tpl b/contrib/gitlab-codequality.tpl index 2137c3de6704..5beec257e078 100644 --- a/contrib/gitlab-codequality.tpl +++ b/contrib/gitlab-codequality.tpl @@ -45,7 +45,7 @@ "type": "issue", "check_name": "container_scanning", "categories": [ "Security" ], - "description": {{ list .ID .Title | join ": " | printf "%q" }}, + "description": {{ list "Misconfig" .ID .Title | join " - " | printf "%q" }}, "fingerprint": "{{ list .ID .Title $target | join "" | sha1sum }}", "content": {{ .Description | printf "%q" }}, "severity": {{ if eq .Severity "LOW" -}} @@ -67,5 +67,37 @@ } } {{- end -}} + {{- range .Secrets -}} + {{- if $t_first -}} + {{- $t_first = false -}} + {{ else -}} + , + {{- end }} + { + "type": "issue", + "check_name": "container_scanning", + "categories": [ "Security" ], + "description": {{ list "Secret" .RuleID .Title | join " - " | printf "%q" }}, + "fingerprint": "{{ list .RuleID .Title $target | join "" | sha1sum }}", + "content": {{ .Title | printf "%q" }}, + "severity": {{ if eq .Severity "LOW" -}} + "info" + {{- else if eq .Severity "MEDIUM" -}} + "minor" + {{- else if eq .Severity "HIGH" -}} + "major" + {{- else if eq .Severity "CRITICAL" -}} + "critical" + {{- else -}} + "info" + {{- end }}, + "location": { + "path": "{{ $target }}", + "lines": { + "begin": {{ .StartLine }} + } + } + } + {{- end -}} {{- end }} ]