Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trivy vulnerability scanner github action #473

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Trivy vulnerability scanner
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install go
uses: actions/setup-go@v2
with:
go-version: ^1.17

- name: Build images from Dockerfile
run: |
make
docker build -t test/velero-plugin-for-vsphere:latest -f Dockerfile-plugin --output=type=docker --label revision=latest .
docker build -t test/data-manager-for-plugin:latest -f Dockerfile-datamgr --output=type=docker --label revision=latest .
docker build -t test/backup-driver:latest -f Dockerfile-backup-driver --output=type=docker --label revision=latest .
- name: Run Trivy vulnerability scanner on velero-plugin-for-vsphere image
uses: aquasecurity/trivy-action@master
with:
image-ref: 'test/velero-plugin-for-vsphere:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

- name: Run Trivy vulnerability scanner on data-manager-for-plugin image
uses: aquasecurity/trivy-action@master
with:
image-ref: 'test/data-manager-for-plugin:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

- name: Run Trivy vulnerability scanner on backup-driver image
uses: aquasecurity/trivy-action@master
with:
image-ref: 'test/backup-driver:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'