Trivy - ghcr image scan - master #1260
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
# Trivy: Scan remote image on GHCR on schedule | |
# Trivy (pronunciation) is a comprehensive and versatile security scanner. | |
# Trivy has scanners that look for security issues, | |
# and targets where it can find those issues. | |
# https://github.com/aquasecurity/trivy | |
# --------------------------------- | |
name: Trivy - ghcr image scan - master | |
on: | |
schedule: | |
- cron: "0 7,15 * * *" | |
jobs: | |
scan: | |
permissions: | |
contents: read | |
security-events: write | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Ensure lowercase name | |
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr "[:upper:]" "[:lower:]") >> $GITHUB_ENV | |
- name: Run Trivy on latest release image | |
uses: aquasecurity/[email protected] | |
env: | |
TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db | |
with: | |
image-ref: "ghcr.io/${{ env.REPOSITORY_OWNER }}/dds-backend:latest" | |
format: "sarif" | |
output: "trivy-results-master.sarif" | |
severity: "CRITICAL,HIGH" | |
- name: Upload Trivy scan results to master branch GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: "trivy-results-master.sarif" | |
category: trivy-master |