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

Commit e7c7ec2

Browse files
committed
Merge branch 'hooks' of github.com:secureCodeBox/secureCodeBox-v2-alpha into hooks
1 parent ce90452 commit e7c7ec2

File tree

202 files changed

+65
-177
lines changed

Some content is hidden

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

202 files changed

+65
-177
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
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
@@ -35,7 +35,7 @@ jobs:
3535
- name: "Install npm test dependencies"
3636
run: |
3737
npm ci
38-
cd integrations/
38+
cd scanner/
3939
npm ci
4040
cd -
4141
cd hooks/
@@ -109,7 +109,7 @@ jobs:
109109
username: ${{ secrets.DOCKER_USERNAME }}
110110
password: ${{ secrets.DOCKER_PASSWORD }}
111111
repository: scbexperimental/parser-amass
112-
path: ./integrations/amass/parser/
112+
path: ./scanner/amass/parser/
113113
tag_with_ref: true
114114
tag_with_sha: true
115115
- uses: docker/build-push-action@v1
@@ -118,7 +118,7 @@ jobs:
118118
username: ${{ secrets.DOCKER_USERNAME }}
119119
password: ${{ secrets.DOCKER_PASSWORD }}
120120
repository: scbexperimental/parser-kube-hunter
121-
path: ./integrations/kube-hunter/parser/
121+
path: ./scanner/kube-hunter/parser/
122122
tag_with_ref: true
123123
tag_with_sha: true
124124
- uses: docker/build-push-action@v1
@@ -127,7 +127,7 @@ jobs:
127127
username: ${{ secrets.DOCKER_USERNAME }}
128128
password: ${{ secrets.DOCKER_PASSWORD }}
129129
repository: scbexperimental/parser-nikto
130-
path: ./integrations/nikto/parser/
130+
path: ./scanner/nikto/parser/
131131
tag_with_ref: true
132132
tag_with_sha: true
133133
- uses: docker/build-push-action@v1
@@ -136,7 +136,7 @@ jobs:
136136
username: ${{ secrets.DOCKER_USERNAME }}
137137
password: ${{ secrets.DOCKER_PASSWORD }}
138138
repository: scbexperimental/parser-nmap
139-
path: ./integrations/nmap/parser/
139+
path: ./scanner/nmap/parser/
140140
tag_with_ref: true
141141
tag_with_sha: true
142142
- uses: docker/build-push-action@v1
@@ -145,7 +145,7 @@ jobs:
145145
username: ${{ secrets.DOCKER_USERNAME }}
146146
password: ${{ secrets.DOCKER_PASSWORD }}
147147
repository: scbexperimental/parser-ssh-scan
148-
path: ./integrations/ssh_scan/parser/
148+
path: ./scanner/ssh_scan/parser/
149149
tag_with_ref: true
150150
tag_with_sha: true
151151
- uses: docker/build-push-action@v1
@@ -154,7 +154,7 @@ jobs:
154154
username: ${{ secrets.DOCKER_USERNAME }}
155155
password: ${{ secrets.DOCKER_PASSWORD }}
156156
repository: scbexperimental/parser-sslyze
157-
path: ./integrations/sslyze/parser/
157+
path: ./scanner/sslyze/parser/
158158
tag_with_ref: true
159159
tag_with_sha: true
160160
- uses: docker/build-push-action@v1
@@ -163,7 +163,7 @@ jobs:
163163
username: ${{ secrets.DOCKER_USERNAME }}
164164
password: ${{ secrets.DOCKER_PASSWORD }}
165165
repository: scbexperimental/parser-test-scan
166-
path: ./integrations/test-scan/parser/
166+
path: ./scanner/test-scan/parser/
167167
tag_with_ref: true
168168
tag_with_sha: true
169169
- uses: docker/build-push-action@v1
@@ -172,7 +172,7 @@ jobs:
172172
username: ${{ secrets.DOCKER_USERNAME }}
173173
password: ${{ secrets.DOCKER_PASSWORD }}
174174
repository: scbexperimental/parser-trivy
175-
path: ./integrations/trivy/parser/
175+
path: ./scanner/trivy/parser/
176176
tag_with_ref: true
177177
tag_with_sha: true
178178
- uses: docker/build-push-action@v1
@@ -181,7 +181,7 @@ jobs:
181181
username: ${{ secrets.DOCKER_USERNAME }}
182182
password: ${{ secrets.DOCKER_PASSWORD }}
183183
repository: scbexperimental/parser-zap
184-
path: ./integrations/zap/parser/
184+
path: ./scanner/zap/parser/
185185
tag_with_ref: true
186186
tag_with_sha: true
187187
hookImages:
@@ -252,7 +252,7 @@ jobs:
252252
username: ${{ secrets.DOCKER_USERNAME }}
253253
password: ${{ secrets.DOCKER_PASSWORD }}
254254
repository: scbexperimental/nmap
255-
path: ./integrations/nmap/scanner/
255+
path: ./scanner/nmap/scanner/
256256
# Note: not prefixed with a "v" as this seems to match nmap versioning standards
257257
tags: "7.80,7.80-1,latest"
258258
- uses: docker/build-push-action@v1
@@ -261,7 +261,7 @@ jobs:
261261
username: ${{ secrets.DOCKER_USERNAME }}
262262
password: ${{ secrets.DOCKER_PASSWORD }}
263263
repository: scbexperimental/kube-hunter
264-
path: ./integrations/kube-hunter/scanner/
264+
path: ./scanner/kube-hunter/scanner/
265265
# Note: not prefixed with a "v" as this matches the aquasec/kube-hunter tags
266266
tags: "0.3.0,latest"
267267
- uses: docker/build-push-action@v1
@@ -270,7 +270,7 @@ jobs:
270270
username: ${{ secrets.DOCKER_USERNAME }}
271271
password: ${{ secrets.DOCKER_PASSWORD }}
272272
repository: scbexperimental/test-scan
273-
path: ./integrations/test-scan/scanner/
273+
path: ./scanner/test-scan/scanner/
274274
# Note: not prefixed with a "v" as this seems to match nmap versioning standards
275275
tags: "latest"
276276
integrationTests:
@@ -336,23 +336,23 @@ jobs:
336336
--set="image.tag=sha-$(git rev-parse --short HEAD)" \
337337
--set="attribute.name=severity" \
338338
--set="attribute.value=high"
339-
helm -n integration-tests install test-scan ./integrations/test-scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
339+
helm -n integration-tests install test-scan ./scanner/test-scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
340340
cd tests/integration/
341341
npx jest --ci --color read-write-hook
342342
helm -n integration-tests uninstall test-scan update-category update-severity
343343
- name: "nmap Integration Tests"
344344
run: |
345-
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)"
346346
cd tests/integration/
347347
npx jest --ci --color nmap
348348
- name: "kube-hunter Integration Tests"
349349
run: |
350-
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)"
351351
cd tests/integration/
352352
npx jest --ci --color kube-hunter
353353
- name: "ssh-scan Integration Tests"
354354
run: |
355-
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)"
356356
# Install dummy-ssh app
357357
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
358358
cd tests/integration/

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- [Purpose of this Project](#purpose-of-this-project)
2121
- [Quickstart](#quickstart)
2222
- [Prerequisites](#prerequisites)
23-
- [Deployment](#deployment)
23+
- [Deployment (based on Helm)](#deployment-based-on-helm)
2424
- [Examples](#examples)
2525
- [Access Services](#access-services)
2626
- [How does it work?](#how-does-it-work)
@@ -58,14 +58,14 @@ There is a german article about [Security DevOps – Angreifern (immer) einen Sc
5858

5959
- kubernetes (last 4 mayor releases supported: `1.15`, `1.16`, `1.17` & `1.18`)
6060

61-
### Deployment
61+
### Deployment (based on Helm)
6262

6363
```bash
64-
# Deploy secureCodeBox Operator
64+
# Deploy the secureCodeBox Operator first
6565
kubectl create namespace securecodebox-system
66-
helm -n securecodebox-system install securecodebox-operator ./operator/ --set image.tag=hooks
66+
helm -n securecodebox-system install securecodebox-operator ./operator/
6767

68-
# Deploy definitions for the integrated scanners
68+
# Deploy SCB scanner Charts for each security scanner you want to use (all optional)
6969
helm upgrade --install amass ./integrations/amass/
7070
helm upgrade --install kube-hunter ./integrations/kube-hunter/
7171
helm upgrade --install nikto ./integrations/nikto
@@ -80,12 +80,12 @@ helm upgrade --install wpscan ./integrations/wpscan/
8080
helm upgrade --install dummy-ssh ./demo-apps/dummy-ssh/
8181

8282
# Deploy secureCodeBox Hooks
83-
helm upgrade --install add-attributes ./hooks/add-attributes/
84-
helm upgrade --install generic-webhook ./hooks/generic-webhook/
85-
helm upgrade --install imperative-subsequent-scans ./hooks/imperative-subsequent-scans/
83+
helm upgrade --install aah ./hooks/add-attributes/
84+
helm upgrade --install gwh ./hooks/generic-webhook/
85+
helm upgrade --install issh ./hooks/imperative-subsequent-scans/
8686

8787
## Persistence Provider: Elasticsearch
88-
helm upgrade --install persistence-elastic ./hooks/persistence-elastic/
88+
helm upgrade --install elkh ./hooks/persistence-elastic/
8989
```
9090

9191
### Examples
@@ -116,11 +116,11 @@ kubectl get scans
116116

117117
### Access Services
118118

119-
* Minio UI
119+
* Minio UI:
120120
* AccessKey: `kubectl get secret securecodebox-operator-minio -n securecodebox-system -o=jsonpath='{.data.accesskey}' | base64 --decode; echo`
121121
* SecretKey: `kubectl get secret securecodebox-operator-minio -n securecodebox-system -o=jsonpath='{.data.secretkey}' | base64 --decode; echo`
122122
* Port Forward Minio UI: `kubectl port-forward -n securecodebox-system service/securecodebox-operator-minio 9000:9000`
123-
* Elastic / Kibana UI
123+
* Elastic / Kibana UI:
124124
* User: `elastic`
125125
* Password: `kubectl get secret scb-elasticsearch-es-elastic-user -n scb-analytics -o=jsonpath='{.data.elastic}' | base64 --decode; echo`
126126
* Port Forward Kibana: `kubectl port-forward -n default service/persistence-elastic-kibana 5601:5601`

hooks/imperative-subsequent-scans/hook.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ async function handle({
5454
if (
5555
cascadeNmapSmb &&
5656
finding.attributes.port === 445 &&
57-
finding.attributes.service === "microsoft-ds"
57+
(finding.attributes.service === "microsoft-ds" ||
58+
finding.attributes.service === "netbios-ssn")
5859
) {
5960
await startSMBScan({
6061
parentScan: scan,

hooks/imperative-subsequent-scans/scan-helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function startSubsequentSecureCodeBoxScan({
2121
...parentScan.metadata.labels,
2222
},
2323
annotations: {
24-
"securecodebox.io/hook": "nmap-subsequent-scans",
24+
"securecodebox.io/hook": "imperative-subsequent-scans",
2525
"securecodebox.io/parent-scan": parentScan.metadata.name,
2626
},
2727
ownerReferences: [

hooks/imperative-subsequent-scans/values.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ cascade:
66
# Cascade nmap scans for each subdomain found by amass
77
amassNmap: true
88
# Cascade nmap SMB scans for each SMB Port found by nmap
9-
nmapSmb: false
9+
nmapSmb: true
1010
# Cascade SSH scans for each SSH Port found by nmap
11-
nmapSsh: false
11+
nmapSsh: true
1212
# Cascade SSL scans for each HTTP Port found by nmap
13-
nmapSsl: false
13+
nmapSsl: true
1414
# Cascade Nikto scans for each HTTP Port found by nmap
15-
nmapNikto: false
15+
nmapNikto: true
1616
# Cascade ZAP scans for each HTTP Port found by nmap
17-
nmapZapBaseline: false
17+
nmapZapBaseline: true
1818

1919
image:
2020
registry: docker.io

hooks/persistence-elastic/templates/persistence-provider.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: "execution.experimental.securecodebox.io/v1"
22
kind: ScanCompletionHook
33
metadata:
4-
name: {{ include "persistence-elastic.fullname" . }}
4+
name: {{ .Release.Name }}
55
labels:
66
type: Structured
77
spec:

hooks/persistence-elastic/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
image:
66
registry: docker.io
77
repository: scbexperimental/persistence-elastic
8-
tag: null
9-
digest: sha256:25e860d051de0fb7ecb74508d749909d9ec8b5d49cb10466509777bc98e3ec7a
8+
tag: hooks
9+
digest: null
1010

1111
indexPrefix: "scbv2"
1212

operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66

77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
9-
version: 0.1.0
9+
version: 0.2.0
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application.

operator/config/samples/execution_v1_scan/amass_securecodebox_io.yaml

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

operator/config/samples/execution_v1_scan/kube-hunter_in_cluster.yaml

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

0 commit comments

Comments
 (0)