Skip to content

Commit 74365c7

Browse files
committed
store trivy scan config in a file
Storing trivy scan configuration in a file will ensure the same configuration is used regardless if trivy is run as GitHub action or when trivy is used locally.
1 parent c9e4cc3 commit 74365c7

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/security-scan.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,20 @@ jobs:
2323
with:
2424
scan-type: fs
2525
scan-ref: ./php-agent
26-
scanners: vuln,misconfig
27-
skip-dirs: vendor
26+
trivy-config: ./php-agent/trivy.yaml
2827
format: table
2928
exit-code: 1
30-
ignore-unfixed: true
31-
severity: CRITICAL,HIGH,MEDIUM,LOW
3229

3330
- name: Run Trivy in report mode
3431
# Only generate sarif when running nightly on the dev branch.
3532
if: ${{ github.event_name == 'schedule' }}
3633
uses: aquasecurity/[email protected]
3734
with:
3835
scan-type: fs
39-
skip-dirs: vendor
36+
scan-ref: ./php-agent
37+
trivy-config: ./php-agent/trivy.yaml
4038
format: sarif
4139
output: trivy-results.sarif
42-
ignore-unfixed: true
43-
severity: 'CRITICAL,HIGH,MEDIUM,LOW'
4440

4541
- name: Upload Trivy scan results to GitHub Security tab
4642
# Only upload sarif when running nightly on the dev branch.

trivy.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
scan:
2+
scanners:
3+
- vuln
4+
- misconfig
5+
skip-dirs: vendor
6+
7+
severities:
8+
- CRITICAL
9+
- HIGH
10+
- MEDIUM
11+
- LOW
12+
13+
vulnerability:
14+
ignore-unfixed: true

0 commit comments

Comments
 (0)