Skip to content

Commit

Permalink
Restore failing when CVE scanner finds a vulnerability
Browse files Browse the repository at this point in the history
During the migration to GitHub Actions in #160 this functionality
was mistakenly and overzealously removed. Since PHP 8 and
Alpine 3.13 are out and #166 has been filed, currently with a CVE
for musl in it, this check should have failed as it is our goal
to ship images without known CVE's in it. On my own PHP images
the CVE checking fails and as such I was surprised that #166
didn't have any failures. Up on checking the CI logs it showed
the musl CVE but the step didn't fail.

This commit restores the original functionality and will make the
CI once again fail when it finds a CVE in one of the images.
  • Loading branch information
WyriHaximus committed Feb 22, 2021
1 parent b2e2e44 commit 6357665
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
path: ./tmp
- run: docker load --input ./tmp/image*.tar
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
- run: make scan-vulnerability
- run: make ci-scan-vulnerability
scan-vulnerability-http:
name: Scan nginx ${{ matrix.nginx }} for vulnerabilities
needs:
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
shell: bash
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
shell: bash
- run: make scan-vulnerability
- run: make ci-scan-vulnerability
shell: bash
scan-vulnerability-prometheus-exporter-file:
name: Scan HTTP prometheus-exporter-file for vulnerabilities
Expand All @@ -258,7 +258,7 @@ jobs:
path: ./tmp
- run: docker load --input ./tmp/image*.tar
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
- run: make scan-vulnerability
- run: make ci-scan-vulnerability
test-php:
name: Functionaly test PHP ${{ matrix.php }} for ${{ matrix.type }} on Alpine ${{ matrix.alpine }}
needs:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,9 @@ scan-vulnerability:
mkdir -p ./tmp/clair/usabillabv
cat ./tmp/build-*.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./tmp/clair/%.json" -l ./tmp/clair/clair.log % || echo "% is vulnerable"'
docker-compose -f test/security/docker-compose.yml -p clair-ci down

ci-scan-vulnerability:
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
RETRIES=0 && while ! wget -T 10 -q -O /dev/null http://localhost:6060/v1/namespaces ; do sleep 1 ; echo -n "." ; if [ $${RETRIES} -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; RETRIES=$$(($${RETRIES}+1)) ; done
mkdir -p ./tmp/clair/usabillabv
cat ./tmp/build-*.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./tmp/clair/%.json" -l ./tmp/clair/clair.log %'

0 comments on commit 6357665

Please sign in to comment.