From 9cff99f0327cf691415d132cd2940d28854b50d8 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 14 Mar 2023 16:43:52 -0700 Subject: [PATCH] Add trivy to ci-yml --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1409364c4..336a4dc41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,3 +90,26 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ignored_types: '["chore","pr"]' type_labels: '{"feat": "feature", "fix": "fix", "bug": "fix", "doc": "documentation", "ci": "ci", "chore": "chore", "breaking": "breaking", "BREAKING CHANGE": "breaking"}' + + # https://github.com/marketplace/actions/aqua-security-trivy + trivy: + name: Trivy Security Scan + if: github.event_name != 'pull_request' || !github.event.pull_request.draft + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@0.9.2 + with: + format: "sarif" + output: "trivy-results.sarif" + ignore-unfixed: true + scan-type: "fs" + security-checks: "vuln,secret,config" + severity: "CRITICAL,HIGH" + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "trivy-results.sarif"