Skip to content

Commit

Permalink
tests: add trivy scanner
Browse files Browse the repository at this point in the history
This adds a trivy scanner test to report vulnerabilities.

Signed-off-by: Humble Chirammal <[email protected]>
Co-Authored-by: Guillaume Abrioux <[email protected]>
  • Loading branch information
humblec and guits committed Aug 1, 2023
1 parent 54fe819 commit 77c0368
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: trivy vulnerability scanner
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3

- name: install go
uses: actions/[email protected]
with:
go-version: ^1.18

- name: build Ceph container images daemon-base and demo
run: |
make build BASEOS_REPO=centos BASEOS_REGISTRY=quay.io/centos BASEOS_TAG=stream8 FLAVORS="main,centos,8" IMAGES_TO_BUILD="daemon-base demo"
- name: run trivy vulnerability scanner against daemon-base
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ceph/daemon-base:HEAD-main-centos-stream8-x86_64'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

- name: run trivy vulnerability scanner against demo
uses: aquasecurity/trivy-action@master
with:
image-ref: 'ceph/demo:HEAD-main-centos-stream8-x86_64'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

0 comments on commit 77c0368

Please sign in to comment.