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

Commit 1a6a3c0

Browse files
committed
Add WIP kube-hunter integration
1 parent a03199f commit 1a6a3c0

File tree

11 files changed

+91
-0
lines changed

11 files changed

+91
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,15 @@ jobs:
109109
path: ./integrations/amass/parser/
110110
tag_with_ref: true
111111
tag_with_sha: true
112+
- uses: docker/build-push-action@v1
113+
name: "Build & Push kube-hunter Parser Image"
114+
with:
115+
username: ${{ secrets.DOCKER_USERNAME }}
116+
password: ${{ secrets.DOCKER_PASSWORD }}
117+
repository: scbexperimental/parser-kube-hunter
118+
path: ./integrations/kube-hunter/parser/
119+
tag_with_ref: true
120+
tag_with_sha: true
112121
- uses: docker/build-push-action@v1
113122
name: "Build & Push Nikto Parser Image"
114123
with:
@@ -200,6 +209,15 @@ jobs:
200209
path: ./integrations/nmap/scanner/
201210
# Note: not prefixed with a "v" as this seems to match nmap versioning standards
202211
tags: "7.80,7.80-1,latest"
212+
- uses: docker/build-push-action@v1
213+
name: "Build & Push kube-hunter Scanner Image"
214+
with:
215+
username: ${{ secrets.DOCKER_USERNAME }}
216+
password: ${{ secrets.DOCKER_PASSWORD }}
217+
repository: scbexperimental/kube-hunter
218+
path: ./integrations/kube-hunter/scanner/
219+
# Note: not prefixed with a "v" as this matches the aquasec/kube-hunter tags
220+
tags: "0.3.0,latest"
203221
integrationTests:
204222
name: "Test / Integration / k8s ${{ matrix.k8sVersion }}"
205223
needs:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
3+
parser/
4+
scanner/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v2
2+
name: kube-hunter
3+
description: A Helm chart for the kube-hunter security Scanner that integrates with the secureCodeBox.
4+
5+
type: application
6+
version: 0.1.0
7+
appVersion: 0.1.0
8+
9+
keywords:
10+
- security
11+
- kube-hunter
12+
- scanner
13+
- secureCodeBox
14+
home: https://www.securecodebox.io/scanner/kube-hunter
15+
icon: https://www.securecodebox.io/integrationIcons/kube-hunter.svg
16+
sources:
17+
- https://github.com/secureCodeBox/secureCodeBox
18+
maintainers:
19+
- name: iteratec GmbH
20+
email: security@iteratec.com
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM scbexperimental/parser-sdk-nodejs:latest
2+
WORKDIR /home/app/parser-wrapper/parser/
3+
COPY --chown=app:app ./parser.js ./parser.js
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
async function parse() {
2+
return [];
3+
}
4+
5+
module.exports.parse = parse;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test('passes', async () => {
2+
expect(true).toBe(true);
3+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM aquasec/kube-hunter:0.3.0
2+
COPY wrapper.sh /wrapper.sh
3+
ENTRYPOINT [ "sh", "/wrapper.sh" ]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kube-hunter $@ 2> /home/securecodebox/kube-hunter-results.json
2+
exit $?
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: "execution.experimental.securecodebox.io/v1"
2+
kind: ParseDefinition
3+
metadata:
4+
name: "kube-hunter"
5+
spec:
6+
handlesResultsType: kube-hunter
7+
image: "{{ .Values.parserImage.registry }}/{{ .Values.parserImage.repository }}:{{ .Values.parserImage.tag }}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: 'execution.experimental.securecodebox.io/v1'
2+
kind: ScanType
3+
metadata:
4+
name: 'kube-hunter'
5+
spec:
6+
extractResults:
7+
type: kube-hunter-json
8+
location: '/home/securecodebox/kube-hunter-results.json'
9+
jobTemplate:
10+
spec:
11+
ttlSecondsAfterFinished: 10
12+
template:
13+
spec:
14+
restartPolicy: Never
15+
containers:
16+
- name: kube-hunter
17+
image: scbexperimental/kube-hunter:latest
18+
command:
19+
- 'sh'
20+
- '/wrapper.sh'
21+
- '--report'
22+
- 'json'

0 commit comments

Comments
 (0)