Skip to content

Commit 6357665

Browse files
committed
Restore failing when CVE scanner finds a vulnerability
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.
1 parent b2e2e44 commit 6357665

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ jobs:
204204
path: ./tmp
205205
- run: docker load --input ./tmp/image*.tar
206206
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
207-
- run: make scan-vulnerability
207+
- run: make ci-scan-vulnerability
208208
scan-vulnerability-http:
209209
name: Scan nginx ${{ matrix.nginx }} for vulnerabilities
210210
needs:
@@ -233,7 +233,7 @@ jobs:
233233
shell: bash
234234
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
235235
shell: bash
236-
- run: make scan-vulnerability
236+
- run: make ci-scan-vulnerability
237237
shell: bash
238238
scan-vulnerability-prometheus-exporter-file:
239239
name: Scan HTTP prometheus-exporter-file for vulnerabilities
@@ -258,7 +258,7 @@ jobs:
258258
path: ./tmp
259259
- run: docker load --input ./tmp/image*.tar
260260
- run: mkdir -p "./clair/${DOCKER_IMAGE}"
261-
- run: make scan-vulnerability
261+
- run: make ci-scan-vulnerability
262262
test-php:
263263
name: Functionaly test PHP ${{ matrix.php }} for ${{ matrix.type }} on Alpine ${{ matrix.alpine }}
264264
needs:

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,9 @@ scan-vulnerability:
110110
mkdir -p ./tmp/clair/usabillabv
111111
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"'
112112
docker-compose -f test/security/docker-compose.yml -p clair-ci down
113+
114+
ci-scan-vulnerability:
115+
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
116+
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
117+
mkdir -p ./tmp/clair/usabillabv
118+
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 commit comments

Comments
 (0)