File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 dockerfile : Containerfile
3131
3232 build :
33- name : Test build
33+ name : Build and scan
3434 runs-on : ubuntu-latest
3535 needs : [hadolint]
3636 steps :
4949 done
5050 # shellcheck disable=SC2086
5151 docker build -f Containerfile ${BUILD_ARGS} -t test-build .
52+
53+ - name : Install Dive
54+ run : |
55+ DIVE_VERSION=0.12.0
56+ curl -sSL -o /tmp/dive.deb "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
57+ sudo apt install -y /tmp/dive.deb
58+ rm /tmp/dive.deb
59+
60+ - name : Dive filesystem scan
61+ run : dive --ci --source=docker test-build
62+
63+ - name : Cache Trivy vulnerability DB
64+ uses : actions/cache@v4
65+ with :
66+ path : ~/.cache/trivy
67+ key : trivy-db-${{ runner.os }}-${{ github.run_id }}
68+ restore-keys : |
69+ trivy-db-${{ runner.os }}-
70+
71+ - name : Trivy vulnerability scan
72+ uses : aquasecurity/trivy-action@0.24.0
73+ with :
74+ image-ref : test-build
75+ severity : ' HIGH,CRITICAL'
76+ exit-code : ' 1'
You can’t perform that action at this time.
0 commit comments