Trivy vulnerability scanner for Docker Hub Image #482
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Trivy vulnerability scanner for Docker Hub Image" | |
on: | |
workflow_dispatch: # Trigger manually | |
workflow_call: # Trigger by another workflow | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
image-scan: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: 'tractusx/irs-api:latest' | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
- run: cat trivy-results.sarif | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' |