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
@@ -252,14 +257,14 @@ jobs:
252
257
run : if [ $(wc -l < ${{ matrix.distro.name }}-${{ matrix.distro.release }}-container-images) -le 1 ]; then exit 1; fi
253
258
254
259
- name : Scan built container images
255
- run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }}
260
+ run : src/kayobe-config/tools/scan-images.sh ${{ matrix.distro.name }}-${{ matrix.distro.release }} ${{ steps.write-kolla-tag.outputs.kolla-tag }} ${{ inputs.sbom && '--sbom'}}
256
261
257
262
- name : Move image scan logs to output artifact
258
263
run : mv image-scan-output image-build-logs/image-scan-output
259
264
260
- - name : Fail if no images have passed scanning
265
+ - name : Fail if any images have critical vulnerabilities
261
266
run : if [ $(wc -l < image-build-logs/image-scan-output/critical-images.txt) -gt 0 ]; then exit 1; fi
262
- if : ${{ !inputs.push-dirty }}
267
+ if : ${{ !inputs.push-critical }}
263
268
264
269
- name : Copy clean images to push-attempt-images list
265
270
run : cp image-build-logs/image-scan-output/clean-images.txt image-build-logs/push-attempt-images.txt
@@ -269,13 +274,13 @@ jobs:
269
274
# This should be reverted when it's decided to filter high level CVEs as well.
270
275
- name : Append dirty images to push list
271
276
run : |
272
- cat image-build-logs/image-scan-output/dirty -images.txt >> image-build-logs/push-attempt-images.txt
277
+ cat image-build-logs/image-scan-output/high -images.txt >> image-build-logs/push-attempt-images.txt
273
278
if : ${{ inputs.push }}
274
279
275
280
- name : Append images with critical vulnerabilities to push list
276
281
run : |
277
282
cat image-build-logs/image-scan-output/critical-images.txt >> image-build-logs/push-attempt-images.txt
278
- if : ${{ inputs.push && inputs.push-dirty }}
283
+ if : ${{ inputs.push && inputs.push-critical }}
279
284
280
285
- name : Push images
281
286
run : |
@@ -324,12 +329,12 @@ jobs:
324
329
# This can be used again instead of "Fail when critical vulnerabilities are found" when it's
325
330
# decided to fail the job on detecting high CVEs as well.
326
331
# - name: Fail when images failed scanning
327
- # 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
328
- # if: ${{ !inputs.push-dirty && !cancelled() }}
332
+ # 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
333
+ # if: ${{ !inputs.push-critical && !cancelled() }}
329
334
330
335
- name : Fail when critical vulnerabilities are found
331
336
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
332
- if : ${{ !inputs.push-dirty && !cancelled() }}
337
+ if : ${{ !inputs.push-critical && !cancelled() }}
333
338
334
339
# NOTE(mgoddard): Trigger another CI workflow in the
335
340
# stackhpc-release-train repository.
0 commit comments