forked from pdrakesnyk/juice-shop-goof
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (75 loc) · 2.5 KB
/
snyk-scans-cli.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Snyk Full Platform (CLI)
# Prerequisites: j
# - Set a SNYK_TOKEN under env secrets in an env called "Snyk"
# - If you are not running the scan on your default org in Snyk, set the org id in a secret called SNYK_ORG in the same env as above (env called "Snyk") and add an additional --org=${{ secrets.SNYK_ORG }} parameter in all the test commands
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
snyk-os:
environment: snyk
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@master
- name: Install Snyk CLI
run: |
wget -O snyk https://static.snyk.io/cli/latest/snyk-linux
chmod +x ./snyk
mv ./snyk /usr/local/bin/
- name: Authenticate and run Snyk Open Source Scan + Monitor
run: |
npm install
snyk auth ${{ secrets.SNYK_TOKEN }}
snyk test
snyk monitor
snyk-code:
environment: snyk
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@master
- name: Install Snyk CLI
run: |
wget -O snyk https://static.snyk.io/cli/latest/snyk-linux
chmod +x ./snyk
mv ./snyk /usr/local/bin/
- name: Configure and run Snyk Code Scan
run: |
snyk auth ${{ secrets.SNYK_TOKEN }}
snyk code test
snyk-container:
environment: snyk
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@master
- name: Build the Docker image
run: docker build . --file Dockerfile --tag boosef-juiceshop:latest
- name: Install Snyk CLI
run: |
wget -O snyk https://static.snyk.io/cli/latest/snyk-linux
chmod +x ./snyk
mv ./snyk /usr/local/bin/
- name: Scan and Monitor Docker Vulnerabilities
run: |
snyk auth ${{ secrets.SNYK_TOKEN }}
snyk container test boosef-juiceshop:latest --file=Dockerfile
snyk container monitor boosef-juiceshop:latest --file=Dockerfile
snyk-iac:
environment: snyk
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@master
- name: Install Snyk CLI
run: |
wget -O snyk https://static.snyk.io/cli/latest/snyk-linux
chmod +x ./snyk
mv ./snyk /usr/local/bin/
- name: Run and monitor Snyk to check configuration files for security issues
run: |
snyk auth ${{ secrets.SNYK_TOKEN }}
snyk iac test --report