-
Notifications
You must be signed in to change notification settings - Fork 4
242 lines (222 loc) · 6.58 KB
/
snyk.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Snyk Scan
on:
workflow_dispatch:
# push:
schedule:
- cron: '30 5 * * 6'
env:
SNYK_SCAN_COMMAND: test
# SNYK_SCAN_COMMAND: monitor
# full repository list from Zowe manifest.json sourceDependencies
# - api-layer
# - common-java
# - data-sets
# - explorer-api-common
# - explorer-ip
# - explorer-jes
# - explorer-mvs
# - explorer-ui-server
# - explorer-uss
# - imperative
# - jobs
# - keyring-utilities
# - launcher ?
# - orion-editor-component
# - perf-timing
# - sample-angular-app
# - sample-iframe-app
# - sample-react-app
# - tn3270-ng2
# - vscode-extension-for-zowe
# - vt-ng2
# - zlux-app-manager
# - zlux-app-server
# - zlux-build
# - zlux-editor
# - zlux-file-explorer
# - zlux-grid
# - zlux-platform
# - zlux-server-framework
# - zlux-shared
# - zlux-widgets
# - zlux-workflow
# - zosmf-auth
# - zowe-cli
# - zowe-cli-cics-plugin
# - zowe-cli-db2-plugin
# - zowe-cli-ftp-plugin
# - zowe-cli-ims-plugin
# - zowe-cli-mq-plugin
# - zowe-cli-scs-plugin
# - zowe-common-c ?
# - zowe-install-packaging-tools
# - zss ?
# - zss-auth
jobs:
snyk-node:
strategy:
matrix:
repository:
- explorer-ip
- explorer-jes
- explorer-mvs
- explorer-ui-server
- explorer-uss
- imperative
- keyring-utilities
- orion-editor-component
- perf-timing
- sample-angular-app
- sample-iframe-app
- sample-react-app
- tn3270-ng2
- vt-ng2
- zlux-app-manager
- zlux-app-server
- zlux-build
- zlux-editor
- zlux-file-explorer
- zlux-grid
- zlux-platform
- zlux-server-framework
- zlux-shared
- zlux-widgets
- zlux-workflow
- zosmf-auth
- zowe-cli
- cics-for-zowe-client
- zowe-cli-db2-plugin
- zowe-cli-ftp-plugin
- zowe-cli-ims-plugin
- zowe-cli-mq-plugin
- zowe-cli-scs-plugin
- zowe-explorer-vscode
- zss-auth
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: zowe/${{ matrix.repository }}
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Run npm install
continue-on-error: true
run: |
root_dir=$(pwd)
package_jsons=$(find . -name package.json)
echo "package.json in ${root_dir}:"
echo "${package_jsons}"
echo
while read -r line; do
package_json_path=$(dirname "${line}")
echo ">>>>>>>>>>>>>>>>>>>>>>> npm install on ${package_json_path} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
cd "${root_dir}"
cd "${package_json_path}"
npm install --no-audit --ignore-scripts || true
done <<EOF
$(echo "${package_jsons}")
EOF
- name: Prepare report directory
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "BRANCH=${BRANCH}"
COMMIT_HASH=$(git rev-parse --verify HEAD)
echo "COMMIT_HASH=${COMMIT_HASH}"
SCAN_REPORT_DIR=.snyk-reports/${{ matrix.repository }}.${BRANCH}
echo "SCAN_REPORT_DIR=${SCAN_REPORT_DIR}"
mkdir -p ${SCAN_REPORT_DIR}
echo "${COMMIT_HASH}" > ${SCAN_REPORT_DIR}/COMMIT
echo "SCAN_REPORT_DIR=${SCAN_REPORT_DIR}" >> $GITHUB_ENV
- name: Run Snyk to check Docker image for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
uses: snyk/actions/node@master
with:
command: ${{ env.SNYK_SCAN_COMMAND }}
args: --sarif-file-output=${{ env.SCAN_REPORT_DIR }}/snyk.sarif --all-projects
- uses: actions/upload-artifact@v3
with:
name: snyk-report
path: .snyk-reports/
snyk-gradle:
strategy:
matrix:
repository:
- api-layer
- common-java
- data-sets
- explorer-api-common
- jobs
- zowe-install-packaging-tools
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: zowe/${{ matrix.repository }}
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Run npm install
continue-on-error: true
run: |
root_dir=$(pwd)
package_jsons=$(find . -name package.json)
echo "package.json in ${root_dir}:"
echo "${package_jsons}"
echo
while read -r line; do
package_json_path=$(dirname "${line}")
echo ">>>>>>>>>>>>>>>>>>>>>>> npm install on ${package_json_path} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
cd "${root_dir}"
cd "${package_json_path}"
npm install --no-audit --ignore-scripts || true
done <<EOF
$(echo "${package_jsons}")
EOF
- name: Prepare report directory
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "BRANCH=${BRANCH}"
COMMIT_HASH=$(git rev-parse --verify HEAD)
echo "COMMIT_HASH=${COMMIT_HASH}"
SCAN_REPORT_DIR=.snyk-reports/${{ matrix.repository }}.${BRANCH}
echo "SCAN_REPORT_DIR=${SCAN_REPORT_DIR}"
mkdir -p ${SCAN_REPORT_DIR}
echo "${COMMIT_HASH}" > ${SCAN_REPORT_DIR}/COMMIT
echo "SCAN_REPORT_DIR=${SCAN_REPORT_DIR}" >> $GITHUB_ENV
- name: Run Snyk to check Docker image for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
uses: snyk/actions/gradle@master
with:
command: ${{ env.SNYK_SCAN_COMMAND }}
args: --sarif-file-output=${{ env.SCAN_REPORT_DIR }}/snyk.sarif --all-projects
- uses: actions/upload-artifact@v3
with:
name: snyk-report
path: .snyk-reports/
upload-reports:
needs:
- snyk-node
- snyk-gradle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: zowe/security-reports
token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
- uses: actions/download-artifact@v4.1.7
with:
name: snyk-report
path: Snyk/
- name: Upload reports
run: |
git config --global user.name ${{ secrets.ZOWE_ROBOT_USER }}
git config --global user.email ${{ secrets.ZOWE_ROBOT_EMAIL }}
git add Snyk/
git commit -s -m "Committing Snyk reports from scan ${GITHUB_RUN_NUMBER}"
git status
git push