Skip to content

Commit 55a16d1

Browse files
authored
Merge pull request #129 from WyriHaximusNet/use-trivy-for-cve-scanning
Use Trivy for CVE scanning
2 parents e853fda + 6f0727a commit 55a16d1

2 files changed

Lines changed: 3 additions & 29 deletions

File tree

.docker/security/docker-compose.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,9 @@ test-zts: ./docker-image/image.tags
4343
xargs -I % ./test-zts.sh % < ./docker-image/image.tags
4444

4545
scan-vulnerability:
46-
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
47-
RETRIES=0 && while ! wget -T 10 -q -O /dev/null http://localhost:6060/v1/namespaces ; do sleep 1 ; echo -n "." ; if [ $${RETRIES} -eq 60 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; RETRIES=$$(($${RETRIES}+1)) ; done
48-
cat ./docker-image/image.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./docker-imageclair/%.json" -l ./clair/clair.log % || echo "% is vulnerable"'
49-
docker-compose -f test/security/docker-compose.yml -p clair-ci down
46+
cat ./docker-image/image.tags | xargs -I % sh -c 'docker run -v /tmp/trivy:/var/lib/trivy -t aquasec/trivy:latest --cache-dir /var/lib/trivy image --exit-code 1 --no-progress --format table % || echo "% is vulnerable"'
5047

5148
ci-scan-vulnerability:
52-
docker-compose -f test/security/docker-compose.yml -p clair-ci up -d
53-
RETRIES=0 && while ! wget -T 10 -q -O /dev/null http://localhost:6060/v1/namespaces ; do sleep 1 ; echo -n "." ; if [ $${RETRIES} -eq 60 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; RETRIES=$$(($${RETRIES}+1)) ; done
54-
cat ./docker-image/image.tags | xargs -I % sh -c 'clair-scanner --ip 172.17.0.1 -r "./clair/%.json" -l ./clair/clair.log %'; \
49+
cat ./docker-image/image.tags | xargs -I % sh -c 'docker run -v /tmp/trivy:/var/lib/trivy -t aquasec/trivy:latest --cache-dir /var/lib/trivy image --exit-code 1 --no-progress --format table %'; \
5550
XARGS_EXIT=$$?; \
56-
if [ $${XARGS_EXIT} -eq 123 ]; then find ./clair/wyrihaximusnet -type f | sed 's/^/-Fjson=@/' | xargs -d'\n' curl -X POST ${WALLE_REPORT_URL} -F channel=team_oz -F buildUrl=https://circleci.com/gh/wyrihaximusnet/docker-php/${CIRCLE_BUILD_NUM}#artifacts/containers/0; else exit $${XARGS_EXIT}; fi
51+
exit $${XARGS_EXIT}

0 commit comments

Comments
 (0)