Skip to content

Trivy - scheduled scan #1231

Trivy - scheduled scan

Trivy - scheduled scan #1231

# Trivy: Scan of current branch
# Trivy 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
#
# This runs on scheduled time (08:25 and 12:25)for the develop image
# ------------------------------------------------------------------
name: Trivy - scheduled scan
on:
workflow_dispatch:
schedule:
- cron: '25 8,12 * * *'
jobs:
scan:
permissions:
contents: read
security-events: write
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Ensure lowercase name
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Run Trivy vulnerability scanner
env:
TRIVY_DB_REPOSITORY: 'ghcr.io/aquasecurity/trivy-db,public.ecr.aws/aquasecurity/trivy-db'
uses: aquasecurity/[email protected]
with:
image-ref: 'ghcr.io/${{ env.REPOSITORY_OWNER }}/rdm-guidelines:main'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
category: trivy-cron