Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 6868284

Browse files
committed
Merge branch 'master' into contributing
2 parents 196b4da + 25b548d commit 6868284

File tree

247 files changed

+11933
-6891
lines changed

Some content is hidden

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

247 files changed

+11933
-6891
lines changed

.github/workflows/ci.yaml

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- uses: actions/checkout@master
5858
- uses: actions/setup-go@v2-beta
5959
with:
60-
go-version: "1.13"
60+
go-version: "1.15"
6161
- name: "Lint Operator Go Code"
6262
run: |
6363
cd operator/
@@ -79,7 +79,7 @@ jobs:
7979
- uses: actions/checkout@master
8080
- uses: actions/setup-go@v2-beta
8181
with:
82-
go-version: "1.13"
82+
go-version: "1.15"
8383
- name: "Lint Lurcher Go Code"
8484
run: |
8585
cd lurcher/
@@ -131,6 +131,16 @@ jobs:
131131
tag_with_ref: true
132132
tag_with_sha: true
133133
build_args: baseImageTag=ci-local
134+
- uses: docker/build-push-action@v1
135+
name: "Build & Push Ncrack Parser Image"
136+
with:
137+
username: ${{ secrets.DOCKER_USERNAME }}
138+
password: ${{ secrets.DOCKER_PASSWORD }}
139+
repository: scbexperimental/parser-ncrack
140+
path: ./scanners/ncrack/parser/
141+
tag_with_ref: true
142+
tag_with_sha: true
143+
build_args: baseImageTag=ci-local
134144
- uses: docker/build-push-action@v1
135145
name: "Build & Push Nikto Parser Image"
136146
with:
@@ -201,6 +211,17 @@ jobs:
201211
tag_with_ref: true
202212
tag_with_sha: true
203213
build_args: baseImageTag=ci-local
214+
- uses: docker/build-push-action@v1
215+
name: "Build & Push wpscan Parser Image"
216+
with:
217+
username: ${{ secrets.DOCKER_USERNAME }}
218+
password: ${{ secrets.DOCKER_PASSWORD }}
219+
repository: scbexperimental/parser-wpscan
220+
path: ./scanners/wpscan/parser/
221+
tag_with_ref: true
222+
tag_with_sha: true
223+
build_args: baseImageTag=ci-local
224+
204225
hookImages:
205226
name: "Build / Hooks"
206227
runs-on: ubuntu-latest
@@ -278,6 +299,15 @@ jobs:
278299
runs-on: ubuntu-latest
279300
steps:
280301
- uses: actions/checkout@master
302+
- uses: docker/build-push-action@v1
303+
name: "Build & Push Ncrack Scanner Image"
304+
with:
305+
username: ${{ secrets.DOCKER_USERNAME }}
306+
password: ${{ secrets.DOCKER_PASSWORD }}
307+
repository: scbexperimental/ncrack
308+
path: ./scanners/ncrack/scanner/
309+
# Note: not prefixed with a "v" as this seems to match ncrack versioning standards
310+
tags: "0.7,latest"
281311
- uses: docker/build-push-action@v1
282312
name: "Build & Push Nmap Scanner Image"
283313
with:
@@ -316,7 +346,7 @@ jobs:
316346
runs-on: ubuntu-latest
317347
strategy:
318348
matrix:
319-
k8sVersion: ["1.18.2", "1.17.5", "1.16.9", "1.15.11"]
349+
k8sVersion: ["1.19.0", "1.18.8", "1.17.5", "1.16.9"]
320350
steps:
321351
- uses: actions/checkout@master
322352
- name: "Start kind cluster"
@@ -336,9 +366,7 @@ jobs:
336366
# Install Operator using the images of the current commit
337367
helm -n securecodebox-system install securecodebox-operator ./operator/ --wait \
338368
--set="image.tag=sha-$(git rev-parse --short HEAD)" \
339-
--set="image.digest=null" \
340369
--set="lurcher.image.tag=sha-$(git rev-parse --short HEAD)" \
341-
--set="lurcher.image.digest=null"
342370
- name: "Inspect Operator"
343371
run: |
344372
echo "Deployment in namespace 'securecodebox-system'"
@@ -380,11 +408,23 @@ jobs:
380408
cd tests/integration/
381409
npx jest --ci --color read-only-hook
382410
helm -n integration-tests uninstall test-scan http-webhook ro-hook
411+
- name: "Install Demo Apps"
412+
run: |
413+
# Install dummy-ssh app
414+
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
415+
# Install plain nginx server
416+
kubectl create deployment --image nginx:alpine nginx --namespace demo-apps
417+
kubectl expose deployment nginx --port 80 --namespace demo-apps
383418
- name: "nmap Integration Tests"
384419
run: |
385420
helm -n integration-tests install nmap ./scanners/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
386421
cd tests/integration/
387422
npx jest --ci --color nmap
423+
- name: "ncrack Integration Tests"
424+
run: |
425+
helm -n integration-tests install ncrack ./scanners/ncrack/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
426+
cd tests/integration/
427+
npx jest --ci --color ncrack
388428
- name: "kube-hunter Integration Tests"
389429
run: |
390430
helm -n integration-tests install kube-hunter ./scanners/kube-hunter/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
@@ -393,10 +433,13 @@ jobs:
393433
- name: "ssh-scan Integration Tests"
394434
run: |
395435
helm -n integration-tests install ssh-scan ./scanners/ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
396-
# Install dummy-ssh app
397-
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
398436
cd tests/integration/
399437
npx jest --ci --color ssh-scan
438+
- name: "zap Integration Tests"
439+
run: |
440+
helm -n integration-tests install zap ./scanners/zap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
441+
cd tests/integration/
442+
npx jest --ci --color zap
400443
- name: Inspect Post Failure
401444
if: failure()
402445
run: |

.github/workflows/helm-charts.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
release:
3+
types: [published]
4+
name: "Publish Helm Charts"
5+
jobs:
6+
helm:
7+
name: Package and Publish
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: "Install yq"
12+
run: |
13+
sudo snap install yq
14+
- name: Parse Tag
15+
run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
16+
- name: "Publish Helm Chart"
17+
env:
18+
HELM_REGISTRY: https://charts.securecodebox.io
19+
USERNAME: ${{ secrets.HELM_REGISTRY_USERNAME }}
20+
PASSWORD: ${{ secrets.HELM_REGISTRY_PASSWORD }}
21+
run: |
22+
# Publish charts in all folders containing a `Chart.yaml` file
23+
# https://github.com/koalaman/shellcheck/wiki/SC2044
24+
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
25+
(
26+
dir="$(dirname "${chart}")"
27+
cd "${dir}" || exit
28+
echo "Processing Chart in $dir"
29+
helm package --version $RELEASE_VERSION .
30+
NAME=$(yq read - name < Chart.yaml)
31+
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
32+
)
33+
done

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# secureCodeBox – v2 ALPHA
1+
# secureCodeBox – v2 Beta
22

33
<p align="center">
44
<img alt="secureCodeBox Logo" src="./docs/resources/securecodebox-logo.svg" width="500px">
@@ -7,25 +7,28 @@
77

88
<p align="center">
99
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="License Apache-2.0" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
10-
<a href="https://github.com/secureCodeBox/secureCodeBox/releases/latest"><img alt="Latest GitHub Release" src="https://img.shields.io/github/release/secureCodeBox/secureCodeBox.svg"></a>
10+
<a href="https://github.com/secureCodeBox/secureCodeBox-v2/releases/tag/v2.0.0-rc.1"><img alt="Preview GitHub Release" src="https://img.shields.io/badge/release-v2.0.0%7Erc.1-blue.svg"></a>
1111
<a href="https://owasp.org/www-project-securecodebox/"><img alt="OWASP Incubator Project" src="https://img.shields.io/badge/OWASP-Incubator%20Project-365EAA"></a>
1212
<a href="https://twitter.com/securecodebox"><img alt="Twitter Follower" src="https://img.shields.io/twitter/follow/securecodebox?style=flat&color=blue&logo=twitter"></a>
1313
</p>
1414
<p align="center">
15-
<a href="https://github.com/secureCodeBox/secureCodeBox-v2-alpha/actions?query=workflow%3ACI"><img alt="Build" src="https://github.com/secureCodeBox/secureCodeBox-v2-alpha/workflows/CI/badge.svg"></a>
16-
<a href="https://codeclimate.com/github/secureCodeBox/secureCodeBox-v2-alpha/test_coverage"><img alt="Test Coverage" src="https://api.codeclimate.com/v1/badges/b6bf3af707671b5e5251/test_coverage" /></a>
17-
<a href="https://snyk.io/test/github/secureCodeBox/secureCodeBox-v2-alpha/"><img alt="Known Vulnerabilities" src="https://snyk.io/test/github/secureCodeBox/secureCodeBox-v2-alpha/badge.svg"></a>
15+
<a href="https://github.com/secureCodeBox/secureCodeBox-v2/actions?query=workflow%3ACI"><img alt="Build" src="https://github.com/secureCodeBox/secureCodeBox-v2/workflows/CI/badge.svg"></a>
16+
<a href="https://codeclimate.com/github/secureCodeBox/secureCodeBox-v2/test_coverage"><img alt="Test Coverage" src="https://api.codeclimate.com/v1/badges/b6bf3af707671b5e5251/test_coverage" /></a>
17+
<a href="https://snyk.io/test/github/secureCodeBox/secureCodeBox-v2/"><img alt="Known Vulnerabilities" src="https://snyk.io/test/github/secureCodeBox/secureCodeBox-v2/badge.svg"></a>
1818
</p>
1919

20-
**NOTE**: This Repository contains a **work in progress** preview of the planned next major secureCodeBox Release. You can find the current **stable release** here [https://github.com/secureCodeBox/secureCodeBox](https://github.com/secureCodeBox/secureCodeBox). The release of version 2.0 is still at least some month away but you can already get a sneak peak here 😀. The release will contain a major architecture change which will not be backward compatible. More details will follow soon in a series of blog articles.
20+
**NOTE**: This Repository contains the stable beta preview of the next major secureCodeBox (SCB) Release v2.
21+
You can find the current **stable release** here [https://github.com/secureCodeBox/secureCodeBox](https://github.com/secureCodeBox/secureCodeBox).
22+
23+
_The major release of SCB version 2.0 will be available in the next weeks._ The release will contain a major architecture change which will not be backward compatible. More details will follow soon in a series of blog articles.
2124

2225
> _secureCodeBox_ is a kubernetes based, modularized toolchain for continuous security scans of your software project. Its goal is to orchestrate and easily automate a bunch of security-testing tools out of the box.
2326
2427
## Overview
2528

2629
<!-- toc -->
2730

28-
- [secureCodeBox – v2 ALPHA](#securecodebox--v2-alpha)
31+
- [secureCodeBox – v2 Beta](#securecodebox--v2-beta)
2932
- [Overview](#overview)
3033
- [Purpose of this Project](#purpose-of-this-project)
3134
- [Quickstart](#quickstart)
@@ -35,6 +38,7 @@
3538
- [Local Scan Examples](#local-scan-examples)
3639
- [Public Scan Examples](#public-scan-examples)
3740
- [Then get the current State of the Scan by running:](#then-get-the-current-state-of-the-scan-by-running)
41+
- [To delete a scan, use `kubectl delete`, e.g. for localhost nmap scan:](#to-delete-a-scan-use-kubectl-delete-eg-for-localhost-nmap-scan)
3842
- [Access Services](#access-services)
3943
- [How does it work?](#how-does-it-work)
4044
- [Architecture](#architecture)
@@ -55,11 +59,11 @@ For additional documentation aspects please have a look at our:
5559
The typical way to ensure application security is to hire a security specialist (aka penetration tester) at some point in your project to check the application for security bugs and vulnerabilities. Usually, this check is done at a later stage of the project and has two major drawbacks:
5660

5761
1. Nowadays, a lot of projects do continuous delivery, which means the developers deploy new versions multiple times each day. The penetration tester is only able to check a single snapshot, but some further commits could introduce new security issues. To ensure ongoing application security, the penetration tester should also continuously test the application. Unfortunately, such an approach is rarely financially feasible.
58-
2. Due to a typically time boxed analysis, the penetration tester has to focus on trivial security issues (low-hanging fruits) and therefore will not address the serious, non-obvious ones.
62+
2. Due to a typically time boxed analysis, the penetration tester has to focus on trivial security issues (low-hanging fruit) and therefore will probably not address the serious, non-obvious ones.
5963

6064
With the _secureCodeBox_ we provide a toolchain for continuous scanning of applications to find the low-hanging fruit issues early in the development process and free the resources of the penetration tester to concentrate on the major security issues.
6165

62-
The purpose of _secureCodeBox_ **is not** to replace the penetration testers or make them obsolete. We strongly recommend to run extensive tests by experienced penetration testers on all your applications.
66+
The purpose of _secureCodeBox_ **is not** to replace the penetration testers or make them obsolete. We strongly recommend running extensive tests by experienced penetration testers on all your applications.
6367

6468
**Important note**: The _secureCodeBox_ is no simple one-button-click-solution! You must have a deep understanding of security and how to configure the scanners. Furthermore, an understanding of the scan results and how to interpret them is also necessary.
6569

@@ -69,11 +73,12 @@ There is a German article about [Security DevOps – Angreifern (immer) einen Sc
6973

7074
### Prerequisites
7175

72-
- kubernetes (last 4 major releases supported: `1.15`, `1.16`, `1.17` & `1.18`)
76+
- kubernetes (last 4 major releases supported: `1.16`, `1.17`, `1.18` & `1.19`)
7377

7478
### Deployment (based on Helm)
7579

76-
There are shorthand scripts to un-/install everything in the `bin` directory.
80+
> The install instructions require you to have the repository cloned and to have your terminal located in the folder of repository.
81+
> There are shorthand scripts to un-/install everything in the `bin` directory.
7782
7883
Deploy the secureCodeBox operator first:
7984

@@ -109,9 +114,10 @@ helm upgrade --install swagger-petstore ./demo-apps/swagger-petstore/
109114
Deploy secureCodeBox Hooks:
110115

111116
```bash
112-
helm upgrade --install aah ./hooks/update-field/
117+
helm upgrade --install ufh ./hooks/update-field/
113118
helm upgrade --install gwh ./hooks/generic-webhook/
114119
helm upgrade --install issh ./hooks/imperative-subsequent-scans/
120+
helm upgrade --install dssh ./hooks/declarative-subsequent-scans/
115121
```
116122

117123
Persistence provider Elasticsearch:
@@ -144,7 +150,8 @@ kubectl apply -f scanners/nmap/examples/scan.nmap.org/scan.yaml
144150
kubectl get scans
145151
```
146152

147-
#### To delete a scan, use ```kubectl delete```, e.g. for localhost nmap scan:
153+
#### To delete a scan, use `kubectl delete`, e.g. for localhost nmap scan:
154+
148155
```
149156
kubectl delete -f scanners/nmap/examples/localhost/scan.yaml
150157
```
@@ -193,5 +200,5 @@ Sponsored by [iteratec GmbH](https://www.iteratec.de/) - [secureCodeBox.io](http
193200
[scb-github]: https://github.com/secureCodeBox/
194201
[scb-engine]: https://github.com/secureCodeBox/engine
195202
[scb-twitter]: https://twitter.com/secureCodeBox
196-
[scb-slack]: https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTJiNzg3MmU2ZDY2NDFiMGI0Y2FkM2I5Mzc2ZmEzYTcyN2FlN2Y2NDFiZDE5NjAxMjg1M2IxNDViNzE3OTIxMGU
203+
[scb-slack]: https://join.slack.com/t/securecodebox/shared_invite/enQtNDU3MTUyOTM0NTMwLTBjOWRjNjVkNGEyMjQ0ZGMyNDdlYTQxYWQ4MzNiNGY3MDMxNThkZjJmMzY2NDRhMTk3ZWM3OWFkYmY1YzUxNTU
197204
[scb-license]: https://github.com/secureCodeBox/secureCodeBox/blob/master/LICENSE

auto-discovery/kubernetes/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

auto-discovery/kubernetes/Dockerfile

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)