Skip to content

Commit

Permalink
Switch to image scan for trivy scan
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelpuchta committed Nov 28, 2024
1 parent f67ab86 commit 6db2590
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
workflow_dispatch:
workflow_call:

env:
CONTAINER_REGISTRY: ghcr.io
CONTAINER_IMAGE_NAME: ${{ github.repository }}
CONTAINER_IMAGE_VERSION: ${{ github.sha }}

jobs:
vulnerability-scan:
runs-on: ubuntu-latest
Expand All @@ -31,15 +36,14 @@ jobs:
# Specify multiple registries: try default GitHub registry, if too many requests, use the aws mirror.
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db
with:
scanners: "vuln"
scan-type: "fs"
image-ref: ${{ env.CONTAINER_REGISTRY }}/${{ env.CONTAINER_IMAGE_NAME }}:${{ env.CONTAINER_IMAGE_VERSION }}
format: "sarif"
# By default SARIF format enforces output of all vulnerabilities regardless of configured severities.
# To override this set limit-severities-for-sarif to true.
limit-severities-for-sarif: true
# limit-severities-for-sarif: true
output: "trivy-results.sarif"
severity: "CRITICAL,HIGH"
exit-code: "1" # Fail the build!
# severity: "CRITICAL,HIGH"
# exit-code: "1" # Fail the build!

- name: Check trivy results
run: |
Expand Down

0 comments on commit 6db2590

Please sign in to comment.