chore(ci): improve a bit on security docs generation

This commit is contained in:
kjeld Schouten-Lebbing 2021-12-04 21:29:28 +01:00
parent 1e5e56b8ad
commit d245835726
No known key found for this signature in database
GPG Key ID: 4CDAD4A532BC1EDB
5 changed files with 11 additions and 1678 deletions

View File

@ -21,7 +21,7 @@ name: jackett
sources:
- https://github.com/Jackett/Jackett
type: application
version: 9.0.30
version: 9.0.31
annotations:
truecharts.org/catagories: |
- media

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
{{- if . -}}
#### {{ escapeXML ( index . 0 ).Target }}
#### Container: {{ escapeXML ( index . 0 ).Target }}
{{ range . }}
**{{ escapeXML .Type }}**
{{ if (eq (len .Vulnerabilities) 0) }}
@ -16,6 +17,7 @@
{{- end }}
{{- end }}
{{- else }}
| No Vulnerabilities found |
|:---------------------------------|
{{- end }}

View File

@ -299,7 +299,9 @@ helm_sec_scan() {
echo "##### Scan Results" >> ${chart}/security.md
echo "" >> ${chart}/security.md
helm template ${chart} --output-dir ${chart}/render > /dev/null
trivy config -f template --template "@./templates/trivy.tpl" ${chart}/render >> ${chart}/security.md
trivy config -f template --template "@./templates/trivy.tpl" -o ${chart}/render/tmpsec${chartname}.md ${chart}/render
cat ${chart}/render/tmpsec${chartname}.md >> ${chart}/security.md
rm -rf ${chart}/render/tmpsec${chartname}.md || true
echo "" >> ${chart}/security.md
}
export -f helm_sec_scan
@ -320,11 +322,12 @@ container_sec_scan() {
echo "##### Scan Results" >> ${chart}/security.md
echo "" >> ${chart}/security.md
for container in $(cat ${chart}/render/containers.tmp); do
ghcrcont="$(echo ${container} | sed 's/tccr.io/ghcr.io/g')"
echo "processing container: ${container} using ${ghcrcont}"
echo "processing container: ${container}"
echo "**Container: ${container}**" >> ${chart}/security.md
echo "" >> ${chart}/security.md
trivy image -f template --template "@./templates/trivy.tpl" "${ghcrcont}" >> ${chart}/security.md
trivy image -f template --template "@./templates/trivy-container.tpl" -o ${chart}/render/tmpsec${chartname}.md "${container}"
cat ${chart}/render/tmpsec${chartname}.md >> ${chart}/security.md
rm -rf ${chart}/render/tmpsec${chartname}.md || true
echo "" >> ${chart}/security.md
done