Skip to content

Commit c14469f

Browse files
authored
Merge pull request #524 from RADAR-base/feature/snyk-docker-image-action
Add weekly Snyk Docker image scan to Github actions
2 parents f8739db + 680599c commit c14469f

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
- name: Upload build artifacts
5959
if: always()
60-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
6161
with:
6262
path: build/reports
6363
if-no-files-found: ignore
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Snyk scheduled Docker image scan
2+
on:
3+
schedule:
4+
- cron: '0 3 * * 1'
5+
workflow_dispatch:
6+
7+
jobs:
8+
security:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Run Snyk to check for vulnerabilities
15+
uses: snyk/actions/docker@master
16+
env:
17+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
18+
with:
19+
image: radarbase/radar-appserver
20+
args: |
21+
--file=Dockerfile
22+
--all-projects
23+
--org=radar-base
24+
--fail-on=upgradable
25+
--severity-threshold=high
26+
--json-file-output=snyk.json
27+
--policy-path=$PWD/.snyk
28+
29+
- name: Report new vulnerabilities
30+
uses: thehyve/report-vulnerability@master
31+
if: success() || failure()
32+
with:
33+
report-file: snky.json
34+
env:
35+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
name: Snyk scheduled test
1+
name: Snyk scheduled code base scan
22
on:
33
schedule:
44
- cron: '0 2 * * 1'
5-
push:
6-
branches:
7-
- master
5+
workflow_dispatch:
86

97
jobs:
108
security:
119
runs-on: ubuntu-latest
12-
env:
13-
REPORT_FILE: test.json
10+
1411
steps:
1512
- uses: actions/checkout@v3
1613

@@ -19,12 +16,19 @@ jobs:
1916
env:
2017
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
2118
with:
22-
args: --all-projects --configuration-matching='^runtimeClasspath$' --json-file-output=${{ env.REPORT_FILE }} --severity-threshold=high --policy-path=$PWD/.snyk
19+
args: |
20+
--all-projects
21+
--configuration-matching='^runtimeClasspath$'
22+
--org=radar-base
23+
--fail-on=upgradable
24+
--json-file-output=snyk.json
25+
--severity-threshold=high
26+
--policy-path=$PWD/.snyk
2327
2428
- name: Report new vulnerabilities
2529
uses: thehyve/report-vulnerability@master
2630
if: success() || failure()
2731
with:
28-
report-file: ${{ env.REPORT_FILE }}
32+
report-file: snky.json
2933
env:
3034
TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)