Skip to content

Commit

Permalink
add template
Browse files Browse the repository at this point in the history
  • Loading branch information
R-HNF committed Oct 15, 2023
1 parent 49a0598 commit 119ba1c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/daily-vul-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
scan-type: image
image-ref: "zozo-gatling-operator:${{ github.sha }}"
format: "template"
template: "@/contrib/html.tpl"
template: "@gitrivy.tpl"
exit-code: "1"
ignore-unfixed: false
vuln-type: "os,library"
Expand Down
38 changes: 38 additions & 0 deletions gitrivy.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{$d := dict "CRITICAL" "🔴" "HIGH" "🟠" "MEDIUM" "🟡" "UNKNOWN" "🟤" }}

{{- range . -}}
## {{ .Target }}

### {{ .Type }}

{{- $prev := "" }}
{{- range $i, $v := .Vulnerabilities }}
{{- if eq 0 $i }}
| Library | Vulnerability | Fixed Version | Title |
|---------|---------------|---------------|-------|
{{- end }}
{{- with $v }}
{{- $new := ne .PkgName $prev }}
| {{ if $new }}{{ .PkgName }}<br/>{{ .InstalledVersion }}{{ end -}}
| {{ get $d .Vulnerability.Severity }} {{ .VulnerabilityID -}}
| {{ .FixedVersion -}}
| {{ escapeXML .Title -}}
|
{{- $prev = .PkgName }}
{{- end }}
{{- end }}

{{ range $i, $v := .Misconfigurations }}
{{- if eq 0 $i }}
| Type | Vulnerability | Title |
|------|---------------|-------|
{{- end }}
{{- with $v }}
| {{ .Type -}}
| {{ get $d .Severity }} {{ .ID -}}
| {{ escapeXML .Title -}}
|
{{- end }}
{{- end }}

{{- end }}

0 comments on commit 119ba1c

Please sign in to comment.