From a1339113b0033c5bf82109afc486e1e993a04c92 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 6 Oct 2026 23:03:02 +0800 Subject: [PATCH] ci(security): add Trivy security scanning - Scan pull requests, main updates, and daily schedules for security findings - Fail on high and critical vulnerabilities, secrets, and misconfigurations --- .github/workflows/security.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/security.yml 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"