diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml new file mode 100644 index 000000000..a1b321f1c --- /dev/null +++ b/.github/workflows/trivy.yml @@ -0,0 +1,28 @@ +--- +name: build +on: + push: + branches: + - main + pull_request: +jobs: + build: + name: Trivy vulnerability scan + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@0.18.0 + with: + scan-type: "fs" + ignore-unfixed: true + format: "sarif" + output: "trivy-results.sarif" + severity: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL" + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: "trivy-results.sarif"