Skip to content

Trivy Scan for Public Image #17

Trivy Scan for Public Image

Trivy Scan for Public Image #17

Workflow file for this run

name: Trivy Scan for Public Image
on:
workflow_dispatch:
jobs:
pull-image:
name: Pull Docker Image
runs-on: ubuntu-latest
steps:
- name: Pull Alpine Image
run: docker pull alpine:3.20
scan:
name: Scan Docker Image with Trivy
runs-on: ubuntu-latest
needs: pull-image
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.0.6
with:
scan-type: image
image-ref: alpine:3.20
format: sarif
output: 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