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

Commit 963585e

Browse files
committed
Added helm charts for some more demo/testing apps.
1 parent e22e85c commit 963585e

Some content is hidden

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

41 files changed

+1173
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ Optional deploy some demo apps for scanning:
100100

101101
```bash
102102
helm upgrade --install dummy-ssh ./demo-apps/dummy-ssh/
103+
helm upgrade --install bodgeit ./demo-apps/bodgeit/
104+
helm upgrade --install juice-shop ./demo-apps/juice-shop/
105+
helm upgrade --install old-wordpress ./demo-apps/old-wordpress/
106+
helm upgrade --install swagger-petstore ./demo-apps/swagger-petstore/
103107
```
104108

105109
Deploy secureCodeBox Hooks:

demo-apps/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Demo Apps
2+
This folder contains a list of demo apps like vulnerable applications or services.
3+
These can be used to demonstrate or test the secureCodeBox capabilities.

demo-apps/bodgeit/.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/

demo-apps/bodgeit/Chart.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v2
2+
version: 0.1.0
3+
type: application
4+
appVersion: "latest"
5+
name: bodgeit
6+
description: "The BodgeIt Store is a vulnerable web app which is aimed at people who are new to pen testing"
7+
home: https://github.com/psiinon/bodgeit
8+
icon: https://scb-art.j12934.now.sh/bodgeit.png
9+
keywords:
10+
- vulnerable
11+
- webapp
12+
- demo
13+
sources:
14+
- https://github.com/secureCodeBox/helm
15+
- https://github.com/psiinon/bodgeit
16+
maintainers:
17+
- name: iteratec GmbH
18+
email: security@iteratec.com
19+

demo-apps/bodgeit/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: []

demo-apps/bodgeit/templates/NOTES.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "bodgeit.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "bodgeit.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "bodgeit.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "bodgeit.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
echo "Visit http://127.0.0.1:8080 to use your application"
20+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
21+
{{- end }}
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "bodgeit.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 "bodgeit.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 "bodgeit.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "bodgeit.labels" -}}
38+
helm.sh/chart: {{ include "bodgeit.chart" . }}
39+
{{ include "bodgeit.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 "bodgeit.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "bodgeit.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end -}}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "bodgeit.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create -}}
59+
{{ default (include "bodgeit.fullname" .) .Values.serviceAccount.name }}
60+
{{- else -}}
61+
{{ default "default" .Values.serviceAccount.name }}
62+
{{- end -}}
63+
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "bodgeit.fullname" . }}
5+
labels:
6+
{{- include "bodgeit.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
{{- include "bodgeit.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "bodgeit.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: http
31+
containerPort: 8080
32+
protocol: TCP
33+
livenessProbe:
34+
httpGet:
35+
path: /
36+
port: http
37+
readinessProbe:
38+
httpGet:
39+
path: /
40+
port: http
41+
resources:
42+
{{- toYaml .Values.resources | nindent 12 }}
43+
{{- with .Values.nodeSelector }}
44+
nodeSelector:
45+
{{- toYaml . | nindent 8 }}
46+
{{- end }}
47+
{{- with .Values.affinity }}
48+
affinity:
49+
{{- toYaml . | nindent 8 }}
50+
{{- end }}
51+
{{- with .Values.tolerations }}
52+
tolerations:
53+
{{- toYaml . | nindent 8 }}
54+
{{- end }}
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "bodgeit.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
5+
apiVersion: networking.k8s.io/v1beta1
6+
{{- else -}}
7+
apiVersion: extensions/v1beta1
8+
{{- end }}
9+
kind: Ingress
10+
metadata:
11+
name: {{ $fullName }}
12+
labels:
13+
{{- include "bodgeit.labels" . | nindent 4 }}
14+
{{- with .Values.ingress.annotations }}
15+
annotations:
16+
{{- toYaml . | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- if .Values.ingress.tls }}
20+
tls:
21+
{{- range .Values.ingress.tls }}
22+
- hosts:
23+
{{- range .hosts }}
24+
- {{ . | quote }}
25+
{{- end }}
26+
secretName: {{ .secretName }}
27+
{{- end }}
28+
{{- end }}
29+
rules:
30+
{{- range .Values.ingress.hosts }}
31+
- host: {{ .host | quote }}
32+
http:
33+
paths:
34+
{{- range .paths }}
35+
- path: {{ . }}
36+
backend:
37+
serviceName: {{ $fullName }}
38+
servicePort: {{ $svcPort }}
39+
{{- end }}
40+
{{- end }}
41+
{{- end }}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "bodgeit.fullname" . }}
5+
labels:
6+
{{- include "bodgeit.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "bodgeit.selectorLabels" . | nindent 4 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "bodgeit.fullname" . }}-test-connection"
5+
labels:
6+
{{ include "bodgeit.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test-success
9+
spec:
10+
containers:
11+
- name: wget
12+
image: busybox
13+
command: ['wget']
14+
args: ['{{ include "bodgeit.fullname" . }}:{{ .Values.service.port }}']
15+
restartPolicy: Never

demo-apps/bodgeit/values.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Default values for bodgeit.
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: psiinon/bodgeit
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: 8080
29+
30+
ingress:
31+
enabled: false
32+
annotations: {}
33+
# kubernetes.io/ingress.class: nginx
34+
# kubernetes.io/tls-acme: "true"
35+
hosts:
36+
- host: chart-example.local
37+
paths: []
38+
tls: []
39+
# - secretName: chart-example-tls
40+
# hosts:
41+
# - chart-example.local
42+
43+
resources: {}
44+
# We usually recommend not to specify default resources and to leave this as a conscious
45+
# choice for the user. This also increases chances charts run on environments with little
46+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
47+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
48+
# limits:
49+
# cpu: 100m
50+
# memory: 128Mi
51+
# requests:
52+
# cpu: 100m
53+
# memory: 128Mi
54+
55+
nodeSelector: {}
56+
57+
tolerations: []
58+
59+
affinity: {}

demo-apps/juice-shop/.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/

demo-apps/juice-shop/Chart.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: v2
2+
version: 0.1.0
3+
appVersion: "v10.0.0"
4+
name: juice-shop
5+
description: "OWASP Juice Shop: Probably the most modern and sophisticated insecure web application"
6+
type: application
7+
home: https://owasp.org/www-project-juice-shop/
8+
icon: https://raw.githubusercontent.com/bkimminich/juice-shop/bdbcc0ea4484a2dd6b8ca243daa34c882129cdd4/frontend/src/assets/public/images/JuiceShop_Logo_400px.png
9+
keywords:
10+
- owasp
11+
- javascript
12+
- vulnerable
13+
- hacking
14+
- application-security
15+
- owasp-top-10
16+
- owasp-top-ten
17+
- pentesting
18+
- vulnapp
19+
- appsec
20+
- ctf
21+
sources:
22+
- https://github.com/secureCodeBox/helm
23+
- https://github.com/bkimminich/juice-shop
24+
maintainers:
25+
- name: iteratec GmbH
26+
email: security@iteratec.com

demo-apps/juice-shop/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: []

0 commit comments

Comments
 (0)