Skip to content

Commit

Permalink
Try out Trivy container scanner.
Browse files Browse the repository at this point in the history
  • Loading branch information
tpendragon committed Jul 22, 2024
1 parent 5738bcb commit 1f25068
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,29 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: Dockerfile
container-vuln-scan:
needs: build-and-push-image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
env:
DOCKER_METADATA_PR_HEAD_SHA: true
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'ghcr.io/pulibrary/dpul-collections:${{ steps.meta.outputs.tags[0] }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

0 comments on commit 1f25068

Please sign in to comment.