Skip to content

Commit ac82b67

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 bbd1708 commit ac82b67

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,9 @@ scan-vulnerability:
108108
mkdir -p ./tmp/clair/usabillabv
109109
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"'
110110
docker-compose -f test/security/docker-compose.yml -p clair-ci down
111+
112+
ci-scan-vulnerability:
113+
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
114+
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
115+
mkdir -p ./tmp/clair/usabillabv
116+
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)