Skip to content

Commit 9ec9806

Browse files
author
Pavan Sokke Nagaraj
authored
add cve scan github cron action (#572)
1 parent 061ce1d commit 9ec9806

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

.github/workflows/daily-scan.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Scan vulnerabilities
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
scan_troubleshoot_files_systems:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Run Trivy vulnerability scanner in repo mode
16+
uses: aquasecurity/trivy-action@master
17+
with:
18+
scan-type: 'fs'
19+
ignore-unfixed: true
20+
format: 'sarif'
21+
output: 'trivy-results.sarif'
22+
severity: 'HIGH,CRITICAL'
23+
24+
- name: Upload Trivy scan results to GitHub Security tab
25+
uses: github/codeql-action/upload-sarif@v1
26+
with:
27+
sarif_file: 'trivy-results.sarif'

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,12 @@ longhorn:
169169
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/types/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/types/g"
170170
find pkg/longhorn -type f | xargs sed -i "s/github.com\/longhorn\/longhorn-manager\/util/github.com\/replicatedhq\/troubleshoot\/pkg\/longhorn\/util/g"
171171
rm -rf longhorn-manager
172+
173+
.PHONY: scan
174+
scan:
175+
trivy fs \
176+
--security-checks vuln \
177+
--exit-code=1 \
178+
--severity="HIGH,CRITICAL" \
179+
--ignore-unfixed \
180+
./

0 commit comments

Comments
 (0)