1010 run : ls
1111 - name : " Install npm dependencies in all parser sub projects"
1212 run : |
13- for dir in integrations /*/parser/
13+ for dir in scanner /*/parser/
1414 do
1515 cd $dir
1616 if [ -f package.json ] && [ -f package-lock.json ]; then
2020 # cd back
2121 cd -
2222 done
23- - name : " Install npm dependencies in all persistence sub projects"
23+ - name : " Install npm dependencies in all hook sub projects"
2424 run : |
25- for dir in persistence /*/
25+ for dir in hooks /*/
2626 do
2727 cd $dir
2828 if [ -f package.json ] && [ -f package-lock.json ]; then
3535 - name : " Install npm test dependencies"
3636 run : |
3737 npm ci
38- cd integrations/
38+ cd scanner/
39+ npm ci
40+ cd -
41+ cd hooks/
3942 npm ci
4043 - name : " Run tests"
4144 run : |
@@ -106,7 +109,7 @@ jobs:
106109 username : ${{ secrets.DOCKER_USERNAME }}
107110 password : ${{ secrets.DOCKER_PASSWORD }}
108111 repository : scbexperimental/parser-amass
109- path : ./integrations /amass/parser/
112+ path : ./scanner /amass/parser/
110113 tag_with_ref : true
111114 tag_with_sha : true
112115 - uses : docker/build-push-action@v1
@@ -115,7 +118,7 @@ jobs:
115118 username : ${{ secrets.DOCKER_USERNAME }}
116119 password : ${{ secrets.DOCKER_PASSWORD }}
117120 repository : scbexperimental/parser-kube-hunter
118- path : ./integrations /kube-hunter/parser/
121+ path : ./scanner /kube-hunter/parser/
119122 tag_with_ref : true
120123 tag_with_sha : true
121124 - uses : docker/build-push-action@v1
@@ -124,7 +127,7 @@ jobs:
124127 username : ${{ secrets.DOCKER_USERNAME }}
125128 password : ${{ secrets.DOCKER_PASSWORD }}
126129 repository : scbexperimental/parser-nikto
127- path : ./integrations /nikto/parser/
130+ path : ./scanner /nikto/parser/
128131 tag_with_ref : true
129132 tag_with_sha : true
130133 - uses : docker/build-push-action@v1
@@ -133,7 +136,7 @@ jobs:
133136 username : ${{ secrets.DOCKER_USERNAME }}
134137 password : ${{ secrets.DOCKER_PASSWORD }}
135138 repository : scbexperimental/parser-nmap
136- path : ./integrations /nmap/parser/
139+ path : ./scanner /nmap/parser/
137140 tag_with_ref : true
138141 tag_with_sha : true
139142 - uses : docker/build-push-action@v1
@@ -142,7 +145,7 @@ jobs:
142145 username : ${{ secrets.DOCKER_USERNAME }}
143146 password : ${{ secrets.DOCKER_PASSWORD }}
144147 repository : scbexperimental/parser-ssh-scan
145- path : ./integrations /ssh_scan/parser/
148+ path : ./scanner /ssh_scan/parser/
146149 tag_with_ref : true
147150 tag_with_sha : true
148151 - uses : docker/build-push-action@v1
@@ -151,7 +154,16 @@ jobs:
151154 username : ${{ secrets.DOCKER_USERNAME }}
152155 password : ${{ secrets.DOCKER_PASSWORD }}
153156 repository : scbexperimental/parser-sslyze
154- path : ./integrations/sslyze/parser/
157+ path : ./scanner/sslyze/parser/
158+ tag_with_ref : true
159+ tag_with_sha : true
160+ - uses : docker/build-push-action@v1
161+ name : " Build & Push test-scan Parser Image"
162+ with :
163+ username : ${{ secrets.DOCKER_USERNAME }}
164+ password : ${{ secrets.DOCKER_PASSWORD }}
165+ repository : scbexperimental/parser-test-scan
166+ path : ./scanner/test-scan/parser/
155167 tag_with_ref : true
156168 tag_with_sha : true
157169 - uses : docker/build-push-action@v1
@@ -160,7 +172,7 @@ jobs:
160172 username : ${{ secrets.DOCKER_USERNAME }}
161173 password : ${{ secrets.DOCKER_PASSWORD }}
162174 repository : scbexperimental/parser-trivy
163- path : ./integrations /trivy/parser/
175+ path : ./scanner /trivy/parser/
164176 tag_with_ref : true
165177 tag_with_sha : true
166178 - uses : docker/build-push-action@v1
@@ -169,40 +181,65 @@ jobs:
169181 username : ${{ secrets.DOCKER_USERNAME }}
170182 password : ${{ secrets.DOCKER_PASSWORD }}
171183 repository : scbexperimental/parser-zap
172- path : ./integrations /zap/parser/
184+ path : ./scanner /zap/parser/
173185 tag_with_ref : true
174186 tag_with_sha : true
175- persistenceImages :
176- name : " Build / PersistenceProviders "
187+ hookImages :
188+ name : " Build / Hooks "
177189 runs-on : ubuntu-latest
178190 steps :
179191 - uses : actions/checkout@master
180192 # SDK
181193 - uses : docker/build-push-action@v1
182- name : " Build & Push Persistence SDK"
194+ name : " Build & Push Hook SDK"
183195 with :
184196 username : ${{ secrets.DOCKER_USERNAME }}
185197 password : ${{ secrets.DOCKER_PASSWORD }}
186- repository : scbexperimental/persistence -sdk-nodejs
187- path : ./persistence -sdk/nodejs/
198+ repository : scbexperimental/hook -sdk-nodejs
199+ path : ./hook -sdk/nodejs/
188200 tag_with_ref : true
189201 # Actual PersistenceProviders
190202 - uses : docker/build-push-action@v1
191- name : " Build & Push Elastic PersistenceProvider Image"
203+ name : " Build & Push Elastic PersistenceProvider Hook Image"
192204 with :
193205 username : ${{ secrets.DOCKER_USERNAME }}
194206 password : ${{ secrets.DOCKER_PASSWORD }}
195207 repository : scbexperimental/persistence-elastic
196- path : ./persistence /persistence-elastic/
208+ path : ./hooks /persistence-elastic/
197209 tag_with_ref : true
198210 - uses : docker/build-push-action@v1
199211 name : " Build & Push Elastic PersistenceProvider Dashboard Importer Image"
200212 with :
201213 username : ${{ secrets.DOCKER_USERNAME }}
202214 password : ${{ secrets.DOCKER_PASSWORD }}
203215 repository : scbexperimental/persistence-elastic-dashboard-importer
204- path : ./persistence/persistence-elastic/dashboardImporter/
216+ path : ./hooks/persistence-elastic/dashboardImporter/
217+ tag_with_ref : true
218+ - uses : docker/build-push-action@v1
219+ name : " Build & Push GenericWebhook Hook Image"
220+ with :
221+ username : ${{ secrets.DOCKER_USERNAME }}
222+ password : ${{ secrets.DOCKER_PASSWORD }}
223+ repository : scbexperimental/generic-webhook
224+ path : ./hooks/generic-webhook/
225+ tag_with_ref : true
226+ - uses : docker/build-push-action@v1
227+ name : " Build & Push ImperativeSubsequentScans Hook Image"
228+ with :
229+ username : ${{ secrets.DOCKER_USERNAME }}
230+ password : ${{ secrets.DOCKER_PASSWORD }}
231+ repository : scbexperimental/hook-imperative-subsequent-scans
232+ path : ./hooks/imperative-subsequent-scans/
205233 tag_with_ref : true
234+ - uses : docker/build-push-action@v1
235+ name : " Build & Push UpdateField Hook Image"
236+ with :
237+ username : ${{ secrets.DOCKER_USERNAME }}
238+ password : ${{ secrets.DOCKER_PASSWORD }}
239+ repository : scbexperimental/update-field
240+ path : ./hooks/update-field/
241+ tag_with_ref : true
242+ tag_with_sha : true
206243 scannerImages :
207244 # Note we only build images for scanner that don't provider official public container images
208245 name : " Build / Scanner"
@@ -215,7 +252,7 @@ jobs:
215252 username : ${{ secrets.DOCKER_USERNAME }}
216253 password : ${{ secrets.DOCKER_PASSWORD }}
217254 repository : scbexperimental/nmap
218- path : ./integrations /nmap/scanner/
255+ path : ./scanner /nmap/scanner/
219256 # Note: not prefixed with a "v" as this seems to match nmap versioning standards
220257 tags : " 7.80,7.80-1,latest"
221258 - uses : docker/build-push-action@v1
@@ -224,14 +261,23 @@ jobs:
224261 username : ${{ secrets.DOCKER_USERNAME }}
225262 password : ${{ secrets.DOCKER_PASSWORD }}
226263 repository : scbexperimental/kube-hunter
227- path : ./integrations /kube-hunter/scanner/
264+ path : ./scanner /kube-hunter/scanner/
228265 # Note: not prefixed with a "v" as this matches the aquasec/kube-hunter tags
229266 tags : " 0.3.0,latest"
267+ - uses : docker/build-push-action@v1
268+ name : " Build & Push test-scan Scanner Image"
269+ with :
270+ username : ${{ secrets.DOCKER_USERNAME }}
271+ password : ${{ secrets.DOCKER_PASSWORD }}
272+ repository : scbexperimental/test-scan
273+ path : ./scanner/test-scan/scanner/
274+ # Note: not prefixed with a "v" as this seems to match nmap versioning standards
275+ tags : " latest"
230276 integrationTests :
231277 name : " Test / Integration / k8s ${{ matrix.k8sVersion }}"
232278 needs :
233279 - scannerImages
234- - persistenceImages
280+ - hookImages
235281 - parserImages
236282 - operator
237283 - lurcher
@@ -276,23 +322,37 @@ jobs:
276322 cd tests/integration/
277323 npm ci
278324 # This steps should include Integration tests which are not related to a Specific Scanner
279- - name : " Generic Integration Tests"
325+ - name : " Throws NoScanDefiniton Error Integration Tests"
280326 run : |
281327 cd tests/integration/
282328 npx jest --ci --color no-scan-definition-error
329+ - name : " Hooks Integration Tests"
330+ run : |
331+ helm -n integration-tests install update-category ./hooks/update-field/ \
332+ --set="image.tag=sha-$(git rev-parse --short HEAD)" \
333+ --set="attribute.name=category" \
334+ --set="attribute.value=fancy-category"
335+ helm -n integration-tests install update-severity ./hooks/update-field/ \
336+ --set="image.tag=sha-$(git rev-parse --short HEAD)" \
337+ --set="attribute.name=severity" \
338+ --set="attribute.value=high"
339+ helm -n integration-tests install test-scan ./scanner/test-scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
340+ cd tests/integration/
341+ npx jest --ci --color read-write-hook
342+ helm -n integration-tests uninstall test-scan update-category update-severity
283343 - name : " nmap Integration Tests"
284344 run : |
285- helm -n integration-tests install nmap ./integrations /nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
345+ helm -n integration-tests install nmap ./scanner /nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
286346 cd tests/integration/
287347 npx jest --ci --color nmap
288348 - name : " kube-hunter Integration Tests"
289349 run : |
290- helm -n integration-tests install kube-hunter ./integrations /kube-hunter/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
350+ helm -n integration-tests install kube-hunter ./scanner /kube-hunter/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
291351 cd tests/integration/
292352 npx jest --ci --color kube-hunter
293353 - name : " ssh-scan Integration Tests"
294354 run : |
295- helm -n integration-tests install ssh-scan ./integrations /ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
355+ helm -n integration-tests install ssh-scan ./scanner /ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
296356 # Install dummy-ssh app
297357 helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
298358 cd tests/integration/
@@ -304,6 +364,7 @@ jobs:
304364 kubectl -n integration-tests get jobs -o wide
305365 kubectl -n integration-tests get pods -o wide
306366 - name : " Inspect Operator"
367+ if : failure()
307368 run : |
308369 echo "Deployment in namespace 'securecodebox-system'"
309370 kubectl -n securecodebox-system get deployments
0 commit comments