Skip to content

Commit e520701

Browse files
Add Trivy dependency scan as a PR quality gate
1 parent 6a6a2e7 commit e520701

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/trivy.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Trivy Dependency Scan
2+
3+
# Quality gate for dependency bumps (incl. Renovate automerge): fail the PR if a
4+
# changed dependency pulls in a known HIGH/CRITICAL vulnerability, so we never ship
5+
# an update with a known issue.
6+
7+
on:
8+
push:
9+
branches: [localstack]
10+
pull_request:
11+
branches: [localstack]
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
trivy-fs:
19+
name: Scan go.mod for known CVEs
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v7
23+
24+
- name: Run Trivy filesystem scan
25+
uses: aquasecurity/trivy-action@v0.36.0
26+
with:
27+
scan-type: fs
28+
scanners: vuln
29+
severity: HIGH,CRITICAL
30+
# Skip CVEs with no fix available, otherwise an unfixable upstream CVE would
31+
# permanently block every merge until a patch exists.
32+
ignore-unfixed: true
33+
exit-code: "1"

0 commit comments

Comments
 (0)