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

Commit 66ba54a

Browse files
committed
Merge branch 'master' into ensure-helm-charts-use-corresponding-image-versions
2 parents d6c0e4f + 6ac36be commit 66ba54a

22 files changed

+541
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -278,6 +288,15 @@ jobs:
278288
runs-on: ubuntu-latest
279289
steps:
280290
- uses: actions/checkout@master
291+
- uses: docker/build-push-action@v1
292+
name: "Build & Push Ncrack Scanner Image"
293+
with:
294+
username: ${{ secrets.DOCKER_USERNAME }}
295+
password: ${{ secrets.DOCKER_PASSWORD }}
296+
repository: scbexperimental/ncrack
297+
path: ./scanners/ncrack/scanner/
298+
# Note: not prefixed with a "v" as this seems to match ncrack versioning standards
299+
tags: "0.7,latest"
281300
- uses: docker/build-push-action@v1
282301
name: "Build & Push Nmap Scanner Image"
283302
with:
@@ -378,11 +397,20 @@ jobs:
378397
cd tests/integration/
379398
npx jest --ci --color read-only-hook
380399
helm -n integration-tests uninstall test-scan http-webhook ro-hook
400+
- name: "Install Demo Apps"
401+
run: |
402+
# Install dummy-ssh app
403+
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
381404
- name: "nmap Integration Tests"
382405
run: |
383406
helm -n integration-tests install nmap ./scanners/nmap/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
384407
cd tests/integration/
385408
npx jest --ci --color nmap
409+
- name: "ncrack Integration Tests"
410+
run: |
411+
helm -n integration-tests install ncrack ./scanners/ncrack/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
412+
cd tests/integration/
413+
npx jest --ci --color ncrack
386414
- name: "kube-hunter Integration Tests"
387415
run: |
388416
helm -n integration-tests install kube-hunter ./scanners/kube-hunter/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
@@ -391,8 +419,6 @@ jobs:
391419
- name: "ssh-scan Integration Tests"
392420
run: |
393421
helm -n integration-tests install ssh-scan ./scanners/ssh_scan/ --set="parserImage.tag=sha-$(git rev-parse --short HEAD)"
394-
# Install dummy-ssh app
395-
helm -n demo-apps install dummy-ssh ./demo-apps/dummy-ssh/ --wait
396422
cd tests/integration/
397423
npx jest --ci --color ssh-scan
398424
- name: Inspect Post Failure

scanners/ncrack/.helmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
3+
parser/
4+
scanner/
5+
examples/
6+

scanners/ncrack/Chart.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v2
2+
name: ncrack
3+
description: A Helm chart for the NCRACK security Scanner that integrates with the secureCodeBox.
4+
5+
type: application
6+
version: 0.1.0
7+
appVersion: 0.7
8+
9+
keywords:
10+
- security
11+
- ncrack
12+
- scanner
13+
- secureCodeBox
14+
home: https://www.securecodebox.io/scanners/ncrack
15+
icon: https://www.securecodebox.io/scannerIcons/Ncrack.svg
16+
sources:
17+
- https://github.com/secureCodeBox/secureCodeBox
18+
maintainers:
19+
- name: iteratec GmbH
20+
email: security@iteratec.com
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
In this example we execute an ncrack scan against the intentional vulnerable ssh service (dummy-ssh)
2+
3+
### Install dummy-ssh
4+
5+
Before executing the scan, make sure to have dummy-ssh installed:
6+
7+
```bash
8+
helm install dummy-ssh ./demo-apps/dummy-ssh/ --wait
9+
```
10+
11+
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: "execution.experimental.securecodebox.io/v1"
2+
kind: Scan
3+
metadata:
4+
name: "dummy-ssh"
5+
spec:
6+
scanType: "ncrack"
7+
parameters:
8+
- -v
9+
- --user=root,admin
10+
- --pass=THEPASSWORDYOUCREATED,12345
11+
- ssh://dummy-ssh
12+

scanners/ncrack/parser/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+

scanners/ncrack/parser/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+

scanners/ncrack/parser/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG baseImageTag
2+
FROM node:12-alpine as build
3+
RUN mkdir -p /home/app
4+
WORKDIR /home/app
5+
COPY package.json package-lock.json ./
6+
RUN npm ci --production
7+
8+
FROM scbexperimental/parser-sdk-nodejs:${baseImageTag:-latest}
9+
WORKDIR /home/app/parser-wrapper/parser/
10+
COPY --from=build --chown=app:app /home/app/node_modules/ ./node_modules/
11+
COPY --chown=app:app ./parser.js ./parser.js
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE ncrackrun>
3+
<!-- Ncrack 0.7 scan initiated Wed Dec 4 22:50:34 2019 as: ncrack -p ftp:3210 -oX /tmp/ncrack.xml scanme.nmap.org -->
4+
<ncrackrun scanner="ncrack" args="ncrack -p ftp:3210 -oX /tmp/ncrack.xml scanme.nmap.org" start="1575496234" startstr="Wed Dec 4 22:50:34 2019" version="0.7" xmloutputversion="1.00">
5+
<verbose level="0"/>
6+
<debugging level="0"/>
7+
<service starttime="1575496234" endtime="1575496234">
8+
<address addr="45.33.32.156" addrtype="ipv4"/>
9+
<port protocol="tcp" portid="3210" name="ftp"></port>
10+
</service>
11+
</ncrackrun>
12+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE ncrackrun>
3+
<!-- Ncrack 0.7 scan initiated Wed Dec 11 17:44:38 2019 as: ncrack -p ssh,http -oX ncrackResults2.xml -vv -P passwords.txt -U usernames.txt scanme.nmap.org -->
4+
<ncrackrun scanner="ncrack" args="ncrack -p ssh,http -oX ncrackResults2.xml -vv -P passwords.txt -U usernames.txt scanme.nmap.org" start="1576082678" startstr="Wed Dec 11 17:44:38 2019" version="0.7" xmloutputversion="1.00">
5+
<verbose level="2"/>
6+
<debugging level="0"/>
7+
<service starttime="1576082678" endtime="1576082712">
8+
<address addr="45.33.32.156" addrtype="ipv4"/>
9+
<port protocol="tcp" portid="22" name="ssh"></port>
10+
</service>
11+
<service starttime="1576082678" endtime="1576082678">
12+
<address addr="45.33.32.156" addrtype="ipv4"/>
13+
<port protocol="tcp" portid="80" name="http"></port>
14+
</service>
15+
</ncrackrun>

0 commit comments

Comments
 (0)