Skip to content

Commit

Permalink
feat(report): add secrets template for codequality report (#2461)
Browse files Browse the repository at this point in the history
  • Loading branch information
natefive authored Jul 27, 2022
1 parent f9c17bd commit 946ce16
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion contrib/gitlab-codequality.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand All @@ -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 }}
]

0 comments on commit 946ce16

Please sign in to comment.