Skip to content

Commit d3f3991

Browse files
committed
Fixes for documentation mostly
1 parent 5a04902 commit d3f3991

File tree

7 files changed

+59
-67
lines changed

7 files changed

+59
-67
lines changed

guides/k8s/k8s.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Example Setup with kubernetes(k8s)
22

33
**WARNING:** It takes into account that you already have k8s cluster setup.
4+
**WARNING-2:** this document is not yet up to date, it will be fixed in [https://github.com/commjoen/wrongsecrets-ctf-party/issues/79](https://github.com/commjoen/wrongsecrets-ctf-party/issues/79).
5+
46

57
## Prerequisites
68

guides/production-notes/production-notes.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ To ensure MultiJuicer runs as smoothly during your CTF's / trainings / workshops
44

55
1. Set `.balancer.cookie.cookieParserSecret` to a random alpha-numeric value (recommended length 24 chars), this value is used to sign cookies. If you don't set this, each `helm upgrade` you run will generate a new one, which invalidates all user sessions, forcing users to rejoin their team.
66
2. As you are running this with https (right?), you should set `balancer.cookie.secure` to `true`. This marks the cookie used to associate a browser with a team to transmitted via https only.
7-
3. Make sure the value you have configured for `juiceShop.maxInstances` fits your CTF / training / whatever you are running. The default is set to only allow 10 instances. Set to -1 to remove any restrictions.
7+
3. Make sure the value you have configured for `wrongsecrets.maxInstances` & `virtualdesktop.maxInstances` fits your CTF / training / whatever you are running. The default is set to only allow 10 instances. Set to -1 to remove any restrictions.
88
4. Set `balancer.replicas` to at least 2, so that you have at least one fall back JuiceBalancer when one crashes or the node it lives on goes down.
99
5. When running a CTF with JuiceShop challenge flags, make sure to change `juiceShop.ctfKey` from the default. Otherwise users will be able to generate their own flags relatively easily. See
1010
6. When using prometheus metrics, e.g. when you have followed the [Monitoring SetUp Guide](https://github.com/iteratec/multi-juicer/blob/main/guides/monitoring-setup/monitoring.md) you'll want to change `balancer.metrics.basicAuth.password` to a non default values. Otherwise users can use the default value to access the technical metrics of the JuiceBalancer pods.
11+
7. If you host this CTF in a public domain, change the `balancer.env.REACT_APP_ACCESS_PASSWORD` to a password you communicate to your users at the start of teh CTF.
12+
8. Make sure to rotate the `balancer.env.REACT_APP_CREATE_TEAM_HMAC_KEY` HMAC key for anti-infra-creation-fuzzing as well into something else than 'hardcodedkey' when you see players generating 100s of instances in minutes.
1113

1214
## TLDR
1315

@@ -22,8 +24,12 @@ balancer:
2224
metrics:
2325
basicAuth:
2426
password: "ROTATE_THIS_YOU_LAZY_ASS"
27+
env:
28+
REACT_APP_ACCESS_PASSWORD: 'CHANGE_THIS_ASS_WELL'
29+
REACT_APP_CREATE_TEAM_HMAC_KEY: 'PLEASE_CHANGE_ME'
2530

2631
juiceShop:
2732
maxInstances: 42
2833
ctfKey: "DONT_LET_ME_FIND_YOU_USING_THIS_EXACT_VALUE"
2934
```
35+

helm/wrongsecrets-ctf-party/templates/wrongsecrets-balancer/config-map.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data:
2424
"enabled": true
2525
},
2626
{{- end }}
27-
"juiceShop": {
27+
"wrongsecrets": {
2828
"image": {{ .Values.wrongsecrets.image | quote }},
2929
"tag": {{ .Values.wrongsecrets.tag | quote }},
3030
"imagePullPolicy": {{ .Values.imagePullPolicy | quote }},

helm/wrongsecrets-ctf-party/values.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ balancer:
6363
# -- If set to true this skips setting ownerReferences on the teams JuiceShop Deployment and Services. This lets MultiJuicer run in older kubernetes cluster which don't support the reference type or the app/v1 deployment type
6464
skipOwnerReference: false
6565
env:
66-
REACT_APP_MOVING_GIF_LOGO : 'https://i.gifer.com/9kGQ.gif'
67-
REACT_APP_HEROKU_WRONGSECRETS_URL : 'https://wrongsecrets-ctf.herokuapp.com'
68-
REACT_APP_CTFD_URL : 'https://ctfd.io'
69-
REACT_APP_S3_BUCKET_URL : 's3://funstuff'
70-
K8S_ENV: 'k8s' #oraws
66+
REACT_APP_MOVING_GIF_LOGO : 'https://i.gifer.com/9kGQ.gif' #displayed at the frontend when you enter the CTF
67+
REACT_APP_HEROKU_WRONGSECRETS_URL : 'https://wrongsecrets-ctf.herokuapp.com' #required for 3 domain setup
68+
REACT_APP_CTFD_URL : 'https://ctfd.io' #requierd for 2 and 3 domain setup
69+
REACT_APP_S3_BUCKET_URL : 's3://funstuff' #the s3 bucket you use for teh aws challenges, don't forget to make it accessible!
70+
K8S_ENV: 'k8s' #or 'aws'
7171
REACT_APP_ACCESS_PASSWORD: '' #DEFAULT NO PASSWORD, PLAYING THIS IN PUBLIC? PUT A FANCY STRING HERE, BUT BE GENTLE: USERS NEED TO BE ABLE TO COPY THAT STUFF...
72-
IRSA_ROLE: arn:aws:iam::233483431651:role/wrongsecrets-secret-manager
73-
SECRETS_MANAGER_SECRET_ID_1: 'wrongsecret'
74-
SECRETS_MANAGER_SECRET_ID_2: 'wrongsecret-2'
72+
REACT_APP_CREATE_TEAM_HMAC_KEY: 'hardcodedkey'
73+
IRSA_ROLE: arn:aws:iam::233483431651:role/wrongsecrets-secret-manager #change this in your own AWS role!
74+
SECRETS_MANAGER_SECRET_ID_1: 'wrongsecret' #only change if you need non-default AWS SM entries
75+
SECRETS_MANAGER_SECRET_ID_2: 'wrongsecret-2' #only change if you need non-default AWS SM entries
7576
metrics:
7677
# -- enables prometheus metrics for the balancer. If set to true you should change the prometheus-scraper password
7778
enabled: true
@@ -182,7 +183,7 @@ virtualdesktop:
182183
# -- Specifies how many JuiceShop instances MultiJuicer should start at max. Set to -1 to remove the max Juice Shop instance cap
183184
maxInstances: 500
184185
# -- Juice Shop Image to use
185-
image: jeroenwillemsen/wrongsecrets-desktop
186+
image: jeroenwillemsen/wrongsecrets-desktop-k8s
186187
tag: test2
187188
repository: commjoenie/wrongSecrets
188189
resources:

readme.md

Lines changed: 21 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,16 @@ You need 2 things:
4949
- A CTFD/Facebook-CTF host which is populated with the challenges based on your secondary hosted WrongSecrets application.
5050

5151

52+
### General Helm usage
5253

54+
This setup works best if you have Calico installed as your CNI, if you want to use the helm directly, without the AWS Challenges, do:
55+
56+
```shell
57+
58+
helm upgrade --install mj ./helm/wrongsecrets-ctf-party
59+
60+
```
61+
from this repo. We will host the helm chart soon for you.
5362

5463
### Play with Minikube:
5564

@@ -80,46 +89,14 @@ For AWS EKS follow the instrucrtions in the `/eks` folder.
8089
Then open a browser and go to [localhost:3000](http:localhost:3000) and have fun :D .
8190

8291

92+
### Some production notes
8393

84-
85-
86-
87-
88-
89-
90-
91-
92-
ORIGINAL README:
93-
94-
95-
![MultiJuicer, High Level Architecture Diagram](./images/high-level-architecture.svg)
96-
97-
## Installation
98-
99-
MultiJuicer runs on kubernetes, to install it you'll need [helm](https://helm.sh).
100-
101-
```sh
102-
helm repo add wrongsecrets-ctf-party https://iteratec.github.io/multi-juicer/
103-
104-
helm install wrongsecrets-ctf-party wrongsecrets-ctf-party/wrongsecrets-ctf-party
105-
```
106-
107-
See [production notes](./guides/production-notes/production-notes.md) for a checklist of values you'll likely need to configure before using MultiJuicer in proper events.
108-
109-
### Installation Guides for specific Cloud Providers / Environments
110-
111-
Generally MultiJuicer runs on pretty much any kubernetes cluster, but to make it easier for anybody who is new to kubernetes we got some guides on how to setup a kubernetes cluster with MultiJuicer installed for some specific Cloud providers.
112-
113-
- [Digital Ocean](./guides/digital-ocean/digital-ocean.md)
114-
- [AWS](./guides/aws/aws.md)
115-
- [OpenShift](./guides/openshift/openshift.md)
116-
- [Plain Kubernetes](./guides/k8s/k8s.md)
117-
- [Azure](./guides/azure/azure.md)
94+
See [production notes](./guides/production-notes/production-notes.md) for a checklist of values you'll likely need to configure before using Wrongsecrets-ctf-party in proper events.
11895

11996
### Customizing the Setup
12097

121-
You got some options on how to setup the stack, with some option to customize the JuiceShop instances to your own liking.
122-
You can find the default config values under: [helm/multi-juicer/values.yaml](helm/wrongsecrets-ctf-party/values.yaml)
98+
You got some options on how to setup the stack, with some option to customize the WrongSecrets and Virtual desktop instances to your own liking.
99+
You can find the default config values under: [helm/wrongsecrets-ctf-party/values.yaml](helm/wrongsecrets-ctf-party/values.yaml)
123100

124101
Download & Save the file and tell helm to use your config file over the default by running:
125102

@@ -135,21 +112,6 @@ helm delete wrongsecrets-ctf-party
135112

136113
## FAQ
137114

138-
### How much compute resources will the cluster require?
139-
140-
To be on the safe side calculate with:
141-
142-
- _1GB memory & 1CPU overhead_, for the balancer & co
143-
- _200MB & 0.2CPU \* number of participants_, for the individual JuiceShop Instances
144-
145-
The numbers above reflect the default resource limits. These can be tweaked, see: [Customizing the Setup](#customizing-the-setup)
146-
147-
### How many users can MultiJuicer handle?
148-
149-
There is no real fixed limit. (Even thought you can configure one 😉)
150-
The custom LoadBalancer, through which all traffic for the individual Instances flows, can be replicated as much as you'd like.
151-
You can also attach a [Horizontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) to automatically scale the LoadBalancer.
152-
153115
### Why a custom LoadBalancer?
154116

155117
There are some special requirements which we didn't find to be easily solved with any pre build load balancer:
@@ -168,19 +130,22 @@ There are some pretty good reasons for this:
168130
- To ensure that pods are still properly associated with teams after a pod gets recreated. This is a non problem with separate deployment and really hard with scaled deployments.
169131
- The ability to embed the team name in the deployment name. This seems like a stupid reason but make debugging SOOO much easier, with just using `kubectl`.
170132

171-
### How to manage JuiceShop easily using `kubectl`?
133+
### How to manage WrongSecrets easily using `kubectl`?
172134

173-
You can list all JuiceShops with relevant information using the custom-columns feature of kubectl.
174-
You'll need to down load the juiceShop.txt from the repository first:
135+
You can list all WrongSecrets with relevant information using the custom-columns feature of kubectl.
136+
You'll need to down load the wrongsecrets.txt from the repository first:
175137

176138
```bash
177-
kubectl get -l app=wrongsecrets -o custom-columns-file=juiceShop.txt deployments
139+
kubectl get -l app=wrongsecrets -o custom-columns-file=wrongsecrets.txt deployments
178140
```
179141

142+
There are a few more ways how you can check whether all is going well: have a look in the [/scripts](/scripts/) folder for various tools that can help you to see if there are too many namespaces created for instance. This does require you to export the teams and players from ctfd.
143+
144+
180145
### Did somebody actually ask any of these questions?
181146

182147
No 😉
183148

184149
## Talk with Us!
185150

186-
You can reach us in the `#project-juiceshop` channel of the OWASP Slack Workspace. We'd love to hear any feedback or usage reports you got. If you are not already in the OWASP Slack Workspace, you can join via [this link](https://owasp.slack.com/join/shared_invite/enQtNjExMTc3MTg0MzU4LWQ2Nzg3NGJiZGQ2MjRmNzkzN2Q4YzU1MWYyZTdjYjA2ZTA5M2RkNzE2ZjdkNzI5ZThhOWY5MjljYWZmYmY4ZjM)
151+
You can reach us in the `#project-wrongsecrets` channel of the OWASP Slack Workspace. We'd love to hear any feedback or usage reports you got. If you are not already in the OWASP Slack Workspace, you can join via [this link](https://owasp.slack.com/join/shared_invite/enQtNjExMTc3MTg0MzU4LWQ2Nzg3NGJiZGQ2MjRmNzkzN2Q4YzU1MWYyZTdjYjA2ZTA5M2RkNzE2ZjdkNzI5ZThhOWY5MjljYWZmYmY4ZjM)

wrongsecrets-balancer/config/config.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,23 @@
3838
},
3939
"tolerations": [],
4040
"affinity": {}
41+
},
42+
"virtualdesktop": {
43+
"image": "jeroenwillemsen/wrongsecrets-desktop-k8s",
44+
"tag": "latest-no-vault",
45+
"imagePullPolicy": "IfNotPresent",
46+
"nodeEnv": "wrongsecrets-ctf-party",
47+
"resources:": {
48+
"requests": {
49+
"memory": "256Mi",
50+
"cpu": "200m"
51+
},
52+
"limits": {
53+
"memory": "256Mi",
54+
"cpu": "200m"
55+
}
56+
},
57+
"tolerations": [],
58+
"affinity": {}
4159
}
4260
}
File renamed without changes.

0 commit comments

Comments
 (0)