Skip to content

Commit c1e5321

Browse files
authored
Merge pull request #712 from secureCodeBox/ci/switch-scanner-build
Build Scanners With New Make Targets
2 parents a125bea + c8deec5 commit c1e5321

57 files changed

Lines changed: 222 additions & 434 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yaml‎

Lines changed: 52 additions & 417 deletions
Large diffs are not rendered by default.

‎common.mk‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SHELL = /bin/sh
5353

5454
IMG_NS ?= securecodebox
5555
GIT_TAG ?= $$(git rev-parse --short HEAD)
56-
BASE_IMG_TAG ?= latest
56+
BASE_IMG_TAG ?= sha-$(GIT_TAG)
5757
IMG_TAG ?= "sha-$(GIT_TAG)"
5858
JEST_VERSION ?= latest
5959

@@ -160,6 +160,9 @@ deploy-test-dep-test-scan:
160160
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
161161
--set-string="parser.env[0].value=true"
162162

163+
deploy-test-dep-old-joomla:
164+
helm -n demo-targets install old-joomla ../../demo-targets/old-joomla/ --set="fullnameOverride=old-joomla" --wait
165+
163166
clean:
164167
@echo ".: 🧹 Cleaning up all generated files."
165168
rm -f ./$(module)-$(name).tar

‎scanners.mk‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,17 @@ deploy-without-scanner:
6464
@echo ".: 💾 Deploying '$(name)' $(scanner-prefix) HelmChart with the docker tag '$(IMG_TAG)' into kind namespace 'integration-tests'."
6565
helm -n integration-tests upgrade --install $(name) ./ --wait \
6666
--set="parser.image.repository=docker.io/$(IMG_NS)/$(parser-prefix)-$(name)" \
67-
--set="parser.image.tag=$(IMG_TAG)"
67+
--set="parser.image.tag=$(IMG_TAG)" \
68+
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
69+
--set-string="parser.env[0].value=true"
6870

6971
deploy-with-scanner:
7072
@echo ".: 💾 Deploying '$(name)' $(scanner-prefix) HelmChart with the docker tag '$(IMG_TAG)' into kind namespace 'integration-tests'."
7173
helm -n integration-tests upgrade --install $(name) ./ --wait \
7274
--set="parser.image.repository=docker.io/$(IMG_NS)/$(parser-prefix)-$(name)" \
7375
--set="parser.image.tag=$(IMG_TAG)" \
76+
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
77+
--set-string="parser.env[0].value=true" \
7478
--set="scanner.image.repository=docker.io/$(IMG_NS)/$(scanner-prefix)-$(name)" \
7579
--set="scanner.image.tag=$(IMG_TAG)"
7680

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

‎scanners/cmseek/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.tar

‎scanners/cmseek/Makefile‎

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

1212
include ../../scanners.mk
13+
14+
deploy-test-deps: | deploy-test-dep-old-joomla
15+
16+
integration-tests:
17+
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
18+
kubectl -n integration-tests delete scans --all
19+
cd ../../tests/integration/ && npm ci
20+
cd ../../scanners/${scanner}
21+
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests

tests/integration/scanner/cmseek.test.js renamed to scanners/cmseek/integration-tests/cmseek.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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

‎scanners/git-repo-scanner/Makefile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,11 @@ include ../../scanners.mk
1313

1414
unit-tests:
1515
@$(MAKE) -s unit-test-py
16+
17+
integration-tests:
18+
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
19+
@echo "Disabled due to performance."
20+
#kubectl -n integration-tests delete scans --all
21+
#cd ../../tests/integration/ && npm ci
22+
#cd ../../scanners/${scanner}
23+
#npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests

tests/integration/scanner/git-repo-scanner.test.js renamed to scanners/git-repo-scanner/integration-tests/git-repo-scanner.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)