diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml new file mode 100644 index 0000000..6b453be --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,32 @@ +name: Trivy Security Scan + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "0 0 * * *" # Daily scan at midnight UTC + workflow_dispatch: # Allow manual trigger + +jobs: + trivy-scan: + name: Trivy Security Scan + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Run Trivy vulnerability scanner (table output) + uses: aquasecurity/trivy-action@v0.36.0 + if: always() + with: + scan-type: "fs" + scan-ref: "." + format: "table" + severity: "CRITICAL,HIGH" + scanners: "vuln,secret,misconfig" + exit-code: "1"