33
33
type : boolean
34
34
required : false
35
35
default : true
36
- push-dirty :
36
+ sbom :
37
+ description : Generate SBOM?
38
+ type : boolean
39
+ required : false
40
+ default : true
41
+ push-critical :
37
42
description : Push scanned images that have critical vulnerabilities?
38
43
type : boolean
39
44
required : false
@@ -244,14 +249,14 @@ jobs:
244
249
run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
245
250
246
251
- name : Scan built container images
247
- run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }}
252
+ run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }} ${{ inputs.sbom && '--sbom'}}
248
253
249
254
- name : Move image scan logs to output artifact
250
255
run : mv image-scan-output image-build-logs/image-scan-output
251
256
252
- - name : Fail if no images have passed scanning
257
+ - name : Fail if any images have critical vulnerabilities
253
258
run : if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then exit 1; fi
254
- if : ${{ !inputs.push-dirty }}
259
+ if : ${{ !inputs.push-critical }}
255
260
256
261
- name : Copy clean images to push-attempt-images list
257
262
run : cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
@@ -261,13 +266,13 @@ jobs:
261
266
# This should be reverted when it's decided to filter high level CVEs as well.
262
267
- name : Append dirty images to push list
263
268
run : |
264
- cat image-build-logs/image-scan-output/dirty -images.txt >> image-build-logs/push-attempt-images.txt
269
+ cat image-build-logs/image-scan-output/high -images.txt >> image-build-logs/push-attempt-images.txt
265
270
if : ${{ inputs.push }}
266
271
267
272
- name : Append images with critical vulnerabilities to push list
268
273
run : |
269
274
cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
270
- if : ${{ inputs.push && inputs.push-dirty }}
275
+ if : ${{ inputs.push && inputs.push-critical }}
271
276
272
277
- name : Push images
273
278
run : |
@@ -316,12 +321,12 @@ jobs:
316
321
# This can be used again instead of "Fail when critical vulnerabilities are found" when it's
317
322
# decided to fail the job on detecting high CVEs as well.
318
323
# - name: Fail when images failed scanning
319
- # run: if [ $(wc -l < image-build-logs/image-scan-output/dirty -images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/dirty -images.txt && exit 1; fi
320
- # if: ${{ !inputs.push-dirty && !cancelled() }}
324
+ # run: if [ $(wc -l < image-build-logs/image-scan-output/high -images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/high -images.txt && exit 1; fi
325
+ # if: ${{ !inputs.push-critical && !cancelled() }}
321
326
322
327
- name : Fail when critical vulnerabilities are found
323
328
run : if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then cat image-build-logs/image-scan-output/critical-images.txt && exit 1; fi
324
- if : ${{ !inputs.push-dirty && !cancelled() }}
329
+ if : ${{ !inputs.push-critical && !cancelled() }}
325
330
326
331
# NOTE(mgoddard): Trigger another CI workflow in the
327
332
# stackhpc-release-train repository.
0 commit comments