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

Commit 304a32c

Browse files
J12934fuhrmeisteryjorgestiga
committed
Add vulnarable demo-ssh service for ssh-scan
Co-authored-by: Yannik Fuhrmeister <12710254+fuhrmeistery@users.noreply.github.com> Co-authored-by: Jorge Estigarribia <jorgestiga@hotmail.com>
1 parent 5cc7752 commit 304a32c

File tree

8 files changed

+212
-0
lines changed

8 files changed

+212
-0
lines changed

Diff for: demo-apps/dummy-ssh/.helmignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/

Diff for: demo-apps/dummy-ssh/Chart.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
version: 0.1.0
3+
type: application
4+
appVersion: "v1.0.0"
5+
name: dummy-ssh
6+
description: "SSH Server for scan testing."
7+
home: https://wordpress.org
8+
icon: https://www.securecodebox.io/integrationIcons/SSH.svg
9+
keywords:
10+
- vulnerable
11+
- ssh
12+
sources:
13+
- https://github.com/secureCodeBox/secureCodeBox/tree/master/demo/dummy-ssh
14+
maintainers:
15+
- name: iteratec GmbH
16+
email: security@iteratec.com
17+

Diff for: demo-apps/dummy-ssh/questions.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
categories:
2+
- "Vulnerable App"
3+
- "Demo Scan Target"
4+
questions: []

Diff for: demo-apps/dummy-ssh/templates/NOTES.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Demo SSH Server deployed.
2+
3+
Note this should used for demo and test purposes.
4+
Do not expose this to the Internet!

Diff for: demo-apps/dummy-ssh/templates/_helpers.tpl

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "dummy-ssh.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "dummy-ssh.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "dummy-ssh.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "dummy-ssh.labels" -}}
38+
helm.sh/chart: {{ include "dummy-ssh.chart" . }}
39+
{{ include "dummy-ssh.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end -}}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "dummy-ssh.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "dummy-ssh.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end -}}

Diff for: demo-apps/dummy-ssh/templates/deployment.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "dummy-ssh.fullname" . }}
5+
labels:
6+
{{- include "dummy-ssh.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "dummy-ssh.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "dummy-ssh.selectorLabels" . | nindent 8 }}
16+
spec:
17+
{{- with .Values.imagePullSecrets }}
18+
imagePullSecrets:
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
securityContext:
22+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
23+
containers:
24+
- name: {{ .Chart.Name }}
25+
securityContext:
26+
{{- toYaml .Values.securityContext | nindent 12 }}
27+
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
28+
imagePullPolicy: {{ .Values.image.pullPolicy }}
29+
ports:
30+
- name: ssh
31+
containerPort: 22
32+
protocol: TCP
33+
livenessProbe:
34+
tcpSocket:
35+
port: 22
36+
readinessProbe:
37+
tcpSocket:
38+
port: 22
39+
resources:
40+
{{- toYaml .Values.resources | nindent 12 }}
41+
{{- with .Values.nodeSelector }}
42+
nodeSelector:
43+
{{- toYaml . | nindent 8 }}
44+
{{- end }}
45+
{{- with .Values.affinity }}
46+
affinity:
47+
{{- toYaml . | nindent 8 }}
48+
{{- end }}
49+
{{- with .Values.tolerations }}
50+
tolerations:
51+
{{- toYaml . | nindent 8 }}
52+
{{- end }}

Diff for: demo-apps/dummy-ssh/templates/service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "dummy-ssh.fullname" . }}
5+
labels:
6+
{{- include "dummy-ssh.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: ssh
12+
protocol: TCP
13+
name: ssh
14+
selector:
15+
{{- include "dummy-ssh.selectorLabels" . | nindent 4 }}

Diff for: demo-apps/dummy-ssh/values.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Default values for dummy-ssh.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
7+
image:
8+
repository: securecodebox/dummy-ssh
9+
pullPolicy: IfNotPresent
10+
11+
imagePullSecrets: []
12+
nameOverride: ""
13+
fullnameOverride: ""
14+
15+
podSecurityContext: {}
16+
# fsGroup: 2000
17+
18+
securityContext: {}
19+
# capabilities:
20+
# drop:
21+
# - ALL
22+
# readOnlyRootFilesystem: true
23+
# runAsNonRoot: true
24+
# runAsUser: 1000
25+
26+
service:
27+
type: ClusterIP
28+
port: 22
29+
30+
resources: {}
31+
# We usually recommend not to specify default resources and to leave this as a conscious
32+
# choice for the user. This also increases chances charts run on environments with little
33+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
34+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
35+
# limits:
36+
# cpu: 100m
37+
# memory: 128Mi
38+
# requests:
39+
# cpu: 100m
40+
# memory: 128Mi
41+
42+
nodeSelector: {}
43+
44+
tolerations: []
45+
46+
affinity: {}

0 commit comments

Comments
 (0)