@@ -362,6 +362,54 @@ jobs:
362362 - name : Setup tmate debug session
363363 uses : mxschmitt/action-tmate@v3
364364 if : env.RUN_TMATE
365+ scan :
366+ name : Scan the image for vulnerabilities
367+ needs :
368+ - diagnostics
369+ - repo-metadata
370+ - build
371+ permissions :
372+ # actions/checkout needs this to fetch code
373+ contents : read
374+ runs-on : ubuntu-latest
375+ steps :
376+ - name : Apply standard cisagov job preamble
377+ uses : cisagov/action-job-preamble@v1
378+ with :
379+ # This functionality is poorly implemented and has been
380+ # causing problems due to the MITM implementation hogging or
381+ # leaking memory. As a result we disable it by default. If
382+ # you want to temporarily enable it, simply set
383+ # monitor_permissions equal to "true".
384+ #
385+ # TODO: Re-enable this functionality when practical. See
386+ # cisagov/skeleton-docker#224 for more details.
387+ monitor_permissions : " false"
388+ # Use a variable to specify the permissions monitoring
389+ # configuration. By default this will yield the
390+ # configuration stored in the cisagov organization-level
391+ # variable, but if you want to use a different configuration
392+ # then simply:
393+ # 1. Create a repository-level variable with the name
394+ # ACTIONS_PERMISSIONS_CONFIG.
395+ # 2. Set this new variable's value to the configuration you
396+ # want to use for this repository.
397+ #
398+ # Note in particular that changing the permissions
399+ # monitoring configuration *does not* require you to modify
400+ # this workflow.
401+ permissions_monitoring_config : ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
402+ - name : Download docker image artifact
403+ uses : actions/download-artifact@v4
404+ with :
405+ name : dist
406+ path : dist
407+ - name : Load docker image
408+ run : docker load < dist/image.tar.gz
409+ - name : Run Trivy vulnerability scanner
410+ uses : aquasecurity/trivy-action@0.32.0
411+ with :
412+ image-ref : ${{ needs.repo-metadata.outputs.image-name }}:latest
365413 test :
366414 # Executes tests on the single-platform image created in the "build" job.
367415 name : Test image
@@ -450,6 +498,7 @@ jobs:
450498 - lint
451499 - repo-metadata
452500 - prepare
501+ - scan
453502 - test
454503 permissions :
455504 # actions/checkout needs this to fetch code
0 commit comments