Skip to content

Commit a1e566c

Browse files
committed
ci(ci): add whatweb to matrix make build
I removed the old build job for third party scanners because it is not needed anymore Signed-off-by: Yannik Fuhrmeister <yannik.fuhrmeister@iteratec.com>
1 parent 50a8919 commit a1e566c

4 files changed

Lines changed: 10 additions & 75 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ jobs:
290290
- sslyze
291291
- trivy
292292
- typo3scan
293+
- whatweb
293294
- wpscan
294295
- zap
295296
steps:
@@ -470,7 +471,6 @@ jobs:
470471
- git-repo-scanner
471472
- screenshooter
472473
- test-scan
473-
- whatweb
474474

475475
steps:
476476
- name: Checkout
@@ -541,66 +541,6 @@ jobs:
541541
# This Matrix should contain Third Party Scanners
542542
# The Tag for the Image should be the current version of the Scanner
543543

544-
scanners-third-party:
545-
name: "Build | Third Party Scanner"
546-
needs:
547-
- unit-python
548-
- unit-javascript
549-
runs-on: ubuntu-latest
550-
strategy:
551-
matrix:
552-
scanner:
553-
- whatweb
554-
555-
steps:
556-
- name: Checkout
557-
uses: actions/checkout@v2
558-
559-
- name: Set ENV Var with Scanner Version
560-
uses: mikefarah/yq@v4.4.1
561-
# Notice: The current version of the scanner is provided via the Chart.yaml to ensure
562-
# there is only one place to edit the version of a scanner
563-
with:
564-
cmd: echo scannerVersion=$(yq e .appVersion scanners/${{ matrix.scanner }}/Chart.yaml) >> $GITHUB_ENV
565-
566-
- name: Docker Meta
567-
id: docker_meta
568-
uses: docker/metadata-action@v3
569-
with:
570-
images: ${{ env.DOCKER_NAMESPACE }}/scanner-${{ matrix.scanner }}
571-
tags: |
572-
type=sha
573-
${{ env.scannerVersion }}
574-
575-
- name: Set up Docker Buildx
576-
uses: docker/setup-buildx-action@v1
577-
578-
- name: Login to DockerHub
579-
uses: docker/login-action@v1
580-
with:
581-
username: ${{ secrets.DOCKER_USERNAME }}
582-
password: ${{ secrets.DOCKER_TOKEN }}
583-
584-
- name: Build and Push
585-
uses: docker/build-push-action@v2
586-
with:
587-
context: ./scanners/${{ matrix.scanner }}/scanner
588-
file: ./scanners/${{ matrix.scanner }}/scanner/Dockerfile
589-
build-args: |
590-
scannerVersion=${{ env.scannerVersion }}
591-
platforms: linux/amd64
592-
push: true
593-
tags: ${{ steps.docker_meta.outputs.tags }}
594-
labels: ${{ steps.docker_meta.outputs.labels }}
595-
596-
- name: Update Docker Hub Description
597-
uses: peter-evans/dockerhub-description@v2
598-
with:
599-
username: ${{ secrets.DOCKERHUB_USERNAME }}
600-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
601-
repository: ${{ env.DOCKER_NAMESPACE }}/scanner-${{ matrix.scanner }}
602-
readme-filepath: ./scanners/${{ matrix.scanner }}/docs/README.DockerHub-Scanner.md
603-
604544
# ---- Build | Scanners | Custom Scanner ----
605545

606546
# This Section contains Scanners that are developed by the secureCodeBox project
@@ -922,19 +862,6 @@ jobs:
922862
npx jest --ci --color ./hooks/notification.test.js
923863
helm -n integration-tests uninstall test-scan http-webhook notification-hook
924864
925-
# ---- Whatweb Integration Tests ----
926-
927-
- name: "Whatweb Integration Tests"
928-
run: |
929-
kubectl -n integration-tests delete scans --all
930-
helm -n integration-tests install whatweb ./scanners/whatweb/ \
931-
--set="parser.image.tag=sha-$(git rev-parse --short HEAD)" \
932-
--set="parser.image.repository=docker.io/${{ env.DOCKER_NAMESPACE }}/parser-whatweb" \
933-
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
934-
--set-string="parser.env[0].value=true"
935-
cd tests/integration/
936-
npx jest --ci --color scanner/whatweb.test.js
937-
938865
# ---- Zap Extended Integration Tests ----
939866

940867
- name: "ZAP Extended Integration Tests"

‎scanners/whatweb/Makefile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ scanner = whatweb
1010
custom_scanner = set
1111

1212
include ../../scanners.mk
13+
14+
integration-tests:
15+
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
16+
kubectl -n integration-tests delete scans --all
17+
cd ../../tests/integration/ && npm ci
18+
cd ../../scanners/${scanner}
19+
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

tests/integration/scanner/whatweb.test.js renamed to scanners/whatweb/integration-tests/whatweb.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// SPDX-License-Identifier: Apache-2.0
44

5-
const { scan } = require("../helpers");
5+
const { scan } = require("../../../tests/integration/helpers");
66

77
jest.retryTimes(3);
88

0 commit comments

Comments
 (0)