mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-05 19:40:23 +00:00
Add CVE scanning with trivy
This commit is contained in:
23
.github/workflows/cve-scan.yml
vendored
Normal file
23
.github/workflows/cve-scan.yml
vendored
Normal 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 }}
|
||||
Reference in New Issue
Block a user