Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Security Scan

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
trivy-scan:
name: Trivy
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Trivy vulnerability scan
uses: aquasecurity/trivy-action@77137e9dc3ab1b329b7c8a38c2eb7475850a14e8
with:
scan-type: fs
scan-ref: .
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM,LOW
exit-code: 0

- name: Check for critical and high vulnerabilities
uses: aquasecurity/trivy-action@77137e9dc3ab1b329b7c8a38c2eb7475850a14e8
with:
scan-type: fs
scan-ref: .
format: table
severity: CRITICAL,HIGH
exit-code: 1

- name: Upload SARIF to Security tab
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: trivy-results.sarif
category: trivy-security-scan
continue-on-error: true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Using continue-on-error: true may hide upload failures.

This setting may cause missed security reports if uploads fail. Consider removing it or handling failures to ensure reliable reporting.