|
5 | 5 | apiVersion: "execution.securecodebox.io/v1" |
6 | 6 | kind: ScanType |
7 | 7 | metadata: |
8 | | - name: "trivy{{ .Values.scanner.nameAppend | default ""}}" |
| 8 | + name: "trivy-image{{ .Values.scanner.nameAppend | default ""}}" |
9 | 9 | spec: |
10 | 10 | extractResults: |
11 | 11 | type: trivy-json |
|
32 | 32 | imagePullPolicy: {{ .Values.scanner.image.pullPolicy }} |
33 | 33 | command: |
34 | 34 | - "trivy" |
| 35 | + - "image" |
| 36 | + # Suppress progress bar, as it pollutes non interactive terminal logs |
| 37 | + - "--no-progress" |
| 38 | + - "--format" |
| 39 | + - "json" |
| 40 | + - "--output" |
| 41 | + - "/home/securecodebox/trivy-results.json" |
| 42 | + resources: |
| 43 | + {{- toYaml .Values.scanner.resources | nindent 16 }} |
| 44 | + securityContext: |
| 45 | + {{- toYaml .Values.scanner.securityContext | nindent 16 }} |
| 46 | + env: |
| 47 | + {{- toYaml .Values.scanner.env | nindent 16 }} |
| 48 | + volumeMounts: |
| 49 | + {{- toYaml .Values.scanner.extraVolumeMounts | nindent 16 }} |
| 50 | + {{- if .Values.scanner.extraContainers }} |
| 51 | + {{- toYaml .Values.scanner.extraContainers | nindent 12 }} |
| 52 | + {{- end }} |
| 53 | + volumes: |
| 54 | + {{- toYaml .Values.scanner.extraVolumes | nindent 12 }} |
| 55 | +--- |
| 56 | +apiVersion: "execution.securecodebox.io/v1" |
| 57 | +kind: ScanType |
| 58 | +metadata: |
| 59 | + name: "trivy-filesystem{{ .Values.scanner.nameAppend | default ""}}" |
| 60 | +spec: |
| 61 | + extractResults: |
| 62 | + type: trivy-json |
| 63 | + location: "/home/securecodebox/trivy-results.json" |
| 64 | + jobTemplate: |
| 65 | + spec: |
| 66 | + {{- if .Values.scanner.ttlSecondsAfterFinished }} |
| 67 | + ttlSecondsAfterFinished: {{ .Values.scanner.ttlSecondsAfterFinished }} |
| 68 | + {{- end }} |
| 69 | + backoffLimit: {{ .Values.scanner.backoffLimit }} |
| 70 | + {{- if .Values.scanner.activeDeadlineSeconds }} |
| 71 | + activeDeadlineSeconds: {{ .Values.scanner.activeDeadlineSeconds }} |
| 72 | + {{- end }} |
| 73 | + template: |
| 74 | + spec: |
| 75 | + restartPolicy: OnFailure |
| 76 | + affinity: |
| 77 | + {{- toYaml .Values.scanner.affinity | nindent 12 }} |
| 78 | + tolerations: |
| 79 | + {{- toYaml .Values.scanner.tolerations | nindent 12 }} |
| 80 | + containers: |
| 81 | + - name: trivy |
| 82 | + image: "{{ .Values.scanner.image.repository }}:{{ .Values.scanner.image.tag | default .Chart.AppVersion }}" |
| 83 | + imagePullPolicy: {{ .Values.scanner.image.pullPolicy }} |
| 84 | + command: |
| 85 | + - "trivy" |
| 86 | + - "filesystem" |
35 | 87 | # Suppress progress bar, as it pollutes non interactive terminal logs |
36 | 88 | - "--no-progress" |
37 | 89 | - "--format" |
|
0 commit comments