Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
fde224c
ci(ci): simplify scanner makefile build
nigthknight Oct 5, 2021
b0aae7d
ci(ci): add nuclei to matrix build
nigthknight Oct 5, 2021
dc45669
ci(ci): add ssh-scan to matrix build
nigthknight Oct 5, 2021
11c57a4
ci(ci): add sslyze to matrix build with make
nigthknight Oct 5, 2021
794ae88
ci(ci): add trivy to matrix make build
nigthknight Oct 5, 2021
b06a2f4
ci(ci): add wpscan to matrix make build
nigthknight Oct 5, 2021
497bda8
ci(ci): disable cascading scans for sslyze
nigthknight Oct 11, 2021
f063ffc
ci(ci): add zap to matrix make build
nigthknight Oct 11, 2021
7747711
ci(ci): add angularjs-csti to matrix make build
nigthknight Oct 11, 2021
f984666
ci(ci): add gitleaks to matrix make build
nigthknight Oct 11, 2021
a2c3283
build: change parser to error on invaid findings
nigthknight Oct 11, 2021
c5b77bf
ci(ci): add kube-hunter to matrix make build
nigthknight Oct 11, 2021
bf4558b
ci(ci): add kubeaudit to matrix make build
nigthknight Oct 11, 2021
bb1dbdc
ci(ci): add ncrack to matrix make build
nigthknight Oct 11, 2021
41cc70b
fix(kube-hunter): fix makefile syntax
nigthknight Oct 11, 2021
21ab7d9
ci(ci): add nmap to matrix make build
nigthknight Oct 11, 2021
ab51315
ci(ci): add nikto to matrix make build
nigthknight Oct 11, 2021
50a8919
ci(ci): add typo3scan to matrix make build
nigthknight Oct 11, 2021
44d4501
ci(ci): add whatweb to matrix make build
nigthknight Oct 11, 2021
ae9ed6c
ci(ci): add screenshooter to matrix make build
nigthknight Oct 11, 2021
9eb0087
ci(ci): disable fail-fast for make build
nigthknight Oct 12, 2021
8217c4c
ci(ci): add debugging steps on failure
nigthknight Oct 12, 2021
2709126
build(common): default BASE_IMG_TAG to commit hash
nigthknight Oct 12, 2021
1b2f82a
ci(ci): remove unnecessary steps
nigthknight Oct 12, 2021
32eeb30
build(parser-sdk): add target to import sdk
nigthknight Oct 12, 2021
f75ae54
Merge branch 'main' into ci/switch-scanner-build
nigthknight Oct 12, 2021
2ec69ff
ci(ci): add cmseek to matrix make build
nigthknight Oct 12, 2021
7a57d32
build: add target to deploy old-joomla
nigthknight Oct 12, 2021
c8deec5
ci(ci): add git-repo-scanner to make matrix
nigthknight Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
469 changes: 52 additions & 417 deletions .github/workflows/ci.yaml

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SHELL = /bin/sh

IMG_NS ?= securecodebox
GIT_TAG ?= $$(git rev-parse --short HEAD)
BASE_IMG_TAG ?= latest
BASE_IMG_TAG ?= sha-$(GIT_TAG)
IMG_TAG ?= "sha-$(GIT_TAG)"
JEST_VERSION ?= latest

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

deploy-test-dep-old-joomla:
helm -n demo-targets install old-joomla ../../demo-targets/old-joomla/ --set="fullnameOverride=old-joomla" --wait

clean:
@echo ".: 🧹 Cleaning up all generated files."
rm -f ./$(module)-$(name).tar
Expand Down
6 changes: 5 additions & 1 deletion scanners.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@ deploy-without-scanner:
@echo ".: 💾 Deploying '$(name)' $(scanner-prefix) HelmChart with the docker tag '$(IMG_TAG)' into kind namespace 'integration-tests'."
helm -n integration-tests upgrade --install $(name) ./ --wait \
--set="parser.image.repository=docker.io/$(IMG_NS)/$(parser-prefix)-$(name)" \
--set="parser.image.tag=$(IMG_TAG)"
--set="parser.image.tag=$(IMG_TAG)" \
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
--set-string="parser.env[0].value=true"

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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions scanners/cmseek/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar
9 changes: 9 additions & 0 deletions scanners/cmseek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ scanner = cmseek
custom_scanner = set

include ../../scanners.mk

deploy-test-deps: | deploy-test-dep-old-joomla

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
1 change: 1 addition & 0 deletions scanners/cmseek/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions scanners/git-repo-scanner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ include ../../scanners.mk

unit-tests:
@$(MAKE) -s unit-test-py

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
@echo "Disabled due to performance."
#kubectl -n integration-tests delete scans --all
#cd ../../tests/integration/ && npm ci
#cd ../../scanners/${scanner}
#npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions scanners/gitleaks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ scanner = gitleaks
custom_scanner = set

include ../../scanners.mk

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
1 change: 1 addition & 0 deletions scanners/gitleaks/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 7 additions & 0 deletions scanners/kube-hunter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ scanner = kube-hunter
custom_scanner = set

include ../../scanners.mk

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/kube-hunter/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/kubeaudit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ deploy-test-deps:
kubectl create namespace kubeaudit-tests --dry-run=client -o yaml | kubectl apply -f -
# Install jshop in kubeaudit-tests namespace
helm -n kubeaudit-tests upgrade --install juice-shop ../../demo-targets/juice-shop/ --wait

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/kubeaudit/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/ncrack/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ custom_scanner = set
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-dummy-ssh

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/ncrack/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/nikto/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ custom_scanner = set
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-bodgeit

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/nikto/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/nmap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ scanner = nmap
custom_scanner = set

include ../../scanners.mk

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/nmap/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
1 change: 1 addition & 0 deletions scanners/nuclei/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.tar
1 change: 1 addition & 0 deletions scanners/nuclei/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ docs/
integration-tests/
coverage/
Makefile
*.tar
12 changes: 12 additions & 0 deletions scanners/nuclei/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ include_guard = set
scanner = nuclei

include ../../scanners.mk

deploy-without-scanner:
@echo ".: 💾 Deploying '$(name)' $(scanner-prefix) HelmChart with the docker tag '$(IMG_TAG)' into kind namespace 'integration-tests'."
helm -n integration-tests upgrade --install $(name) ./ --wait \
--set="parser.image.repository=docker.io/$(IMG_NS)/$(parser-prefix)-$(name)" \
--set="parser.image.tag=$(IMG_TAG)" \
--set="parser.env[0].name=CRASH_ON_FAILED_VALIDATION" \
--set-string="parser.env[0].value=true" \
--set="scanner.image.repository=docker.io/$(IMG_NS)/$(scanner-prefix)-$(name)" \
--set="scanner.image.tag=$(IMG_TAG)" \
--set="nucleiTemplateCache.enabled=false"

1 change: 1 addition & 0 deletions scanners/nuclei/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 7 additions & 0 deletions scanners/screenshooter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ scanner = screenshooter
custom_scanner = set

include ../../scanners.mk

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/screenshooter/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 7 additions & 0 deletions scanners/ssh-scan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ scanner = ssh-scan
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-dummy-ssh

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/ssh-scan/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0

// todo: Integrate into github ci pipeline
const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers.js");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/sslyze/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ scanner = sslyze
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-unsafe-https

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/sslyze/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/trivy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ include_guard = set
scanner = trivy

include ../../scanners.mk

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/trivy/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/typo3scan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ custom_scanner = set
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-old-typo3

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/typo3scan/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/whatweb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ scanner = whatweb
custom_scanner = set

include ../../scanners.mk

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/whatweb/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/wpscan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ scanner = wpscan
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-old-wordpress

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/wpscan/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

const { scan } = require("../helpers");
const { scan } = require("../../../tests/integration/helpers");

jest.retryTimes(3);

Expand Down
7 changes: 7 additions & 0 deletions scanners/zap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ scanner = zap
include ../../scanners.mk

deploy-test-deps: deploy-test-dep-nginx

integration-tests:
@echo ".: 🩺 Starting integration test in kind namespace 'integration-tests'."
kubectl -n integration-tests delete scans --all
cd ../../tests/integration/ && npm ci
cd ../../scanners/${scanner}
npx --yes --package jest@$(JEST_VERSION) jest --verbose --ci --colors --coverage --passWithNoTests ${scanner}/integration-tests
1 change: 1 addition & 0 deletions scanners/zap/integration-tests/jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading