Skip to content

Trivy vulnerability scanner for Docker Hub Image #19

Trivy vulnerability scanner for Docker Hub Image

Trivy vulnerability scanner for Docker Hub Image #19

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@v3
- 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@v2
with:
sarif_file: 'trivy-results.sarif'