From d3d8f986befc6c775083781326ce1bc2675919d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=BCsgen?= <andre.buesgen@posteo.de> Date: Sat, 19 Apr 2025 21:41:24 +0200 Subject: [PATCH] refactor(ci): add trivy repo scan --- .github/workflows/security.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 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..b5f9803 --- /dev/null +++ b/.github/workflows/security.yml @@ -0,0 +1,35 @@ +name: 'Run Security Tests' +on: + push: + branches: + - main + - dev + pull_request: + schedule: + - cron: '* * * * 0' # run weekly + +permissions: + contents: read + actions: read + checks: write + security-events: write + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Run Trivy vulnerability scanner in repo mode + uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30.0 + with: + scan-type: 'fs' + format: 'sarif' + output: 'trivy-results-fs.sarif' + severity: 'CRITICAL,HIGH,MEDIUM' + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3 + with: + sarif_file: 'trivy-results-fs.sarif' -- GitLab