Security Scan #90
This file contains hidden or 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: Security Scan | |
on: | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 0 * * 0' # Run weekly on Sundays at midnight | |
jobs: | |
trivy-scan: | |
name: Trivy Security Scan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run Trivy vulnerability scanner in repo mode | |
uses: aquasecurity/trivy-action@0.31.0 | |
with: | |
scan-type: 'fs' | |
ignore-unfixed: true | |
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 | |
if: always() | |
with: | |
sarif_file: 'trivy-results.sarif' | |
category: 'trivy-fs' | |
- name: Run Trivy vulnerability scanner in IaC mode | |
uses: aquasecurity/trivy-action@0.31.0 | |
with: | |
scan-type: 'config' | |
hide-progress: false | |
format: 'sarif' | |
output: 'trivy-config-results.sarif' | |
exit-code: '1' | |
severity: 'CRITICAL,HIGH' | |
- name: Upload Trivy IaC scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
if: always() | |
with: | |
sarif_file: 'trivy-config-results.sarif' | |
category: 'trivy-config' |