Add CVE scanning with trivy

This commit is contained in:
stefanprodan
2020-05-29 12:37:00 +03:00
parent 113360052b
commit a066ff5385
2 changed files with 25 additions and 1 deletions

23
.github/workflows/cve-scan.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: cve-scan
on:
push:
branches:
- 'master'
jobs:
trivy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
id: build
run: |
IMAGE=test/podinfo:${GITHUB_SHA}
docker build -t ${IMAGE} .
echo "::set-output name=image::$IMAGE"
- name: Scan image
uses: docker://docker.io/aquasec/trivy:latest
with:
args: --cache-dir /var/lib/trivy --no-progress --exit-code 1 --severity MEDIUM,HIGH,CRITICAL ${{ steps.build.outputs.image }}