Skip to content

Commit 7416b68

Browse files
authored
Merge pull request #1 from commjoen/firstport-activities
WIP for porting
2 parents fb3e677 + 98d8081 commit 7416b68

File tree

2,964 files changed

+1020175
-1753
lines changed

Some content is hidden

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

2,964 files changed

+1020175
-1753
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
run: |
1313
sudo snap install yq
1414
- name: "Patch Chart.yaml to the current released version"
15-
working-directory: helm/multi-juicer/
15+
working-directory: helm/wrongsecrets-ctf-party/
1616
run: |
1717
RELEASE_VERSION="${GITHUB_REF#refs/*/}"
1818
# Remove leading 'v' from git tag to create valid semver
@@ -30,9 +30,9 @@ jobs:
3030
strategy:
3131
matrix:
3232
component:
33-
- progress-watchdog
33+
- unusued-progress-watchdog
3434
- cleaner
35-
- juice-balancer
35+
- wrongsecrets-balancer
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v2

.github/workflows/test.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,29 @@ jobs:
2525
- uses: actions/checkout@master
2626
- name: "Install & Build BalancerUI"
2727
run: |
28-
cd juice-balancer/ui
28+
cd wrongsecrets-balancer/ui
2929
npm ci
3030
npm run build
3131
- name: Install Balancer
3232
run: |
33-
cd juice-balancer
33+
cd wrongsecrets-balancer
3434
npm ci
3535
- name: Run Linter
3636
run: |
37-
cd juice-balancer
37+
cd wrongsecrets-balancer
3838
npm run lint
3939
- name: Test Balancer
4040
run: |
41-
cd juice-balancer
41+
cd wrongsecrets-balancer
4242
npm test -- --ci --color --verbose
43-
progressWatchdog:
44-
name: ProgressWatchdog
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: actions/checkout@master
48-
- name: "Test ProgressWatchdog"
49-
run: |
50-
cd progress-watchdog
51-
go vet
52-
go test -cover
43+
#disabled as for now: we cannot use it yet
44+
# progressWatchdog:
45+
# name: ProgressWatchdog
46+
# runs-on: ubuntu-latest
47+
# steps:
48+
# - uses: actions/checkout@master
49+
# - name: "Test ProgressWatchdog"
50+
# run: |
51+
# cd progress-watchdog
52+
# go vet
53+
# go test -cover

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/aws.xml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/azure/azureSettings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/wrongsecrets-ctf-party.iml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ATTRIBUTION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Original Attirbution file of Multijuicer from which we Forked:
2+
13
MultiJuicer uses multiple Icons / Emojis from OpenMoji: https://openmoji.org/
24

35
The Logo was originally created by [Straight outta Mane](https://en.99designs.de/profiles/2794862) via [99Desgins](https://en.99designs.de/logo-brand-guide/contests/create-juicy-logo-open-source-project-multijuicer-1075365/entries).

build-an-deploy.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
#!/usr/bin/env bash
22

3-
echo "This Script canbe used to 'easily' build all MultiJuicer Components and install them to a local kubernetes cluster"
3+
echo "This Script can be used to 'easily' build all WrongSecrets CTF party Components and install them to a local kubernetes cluster"
44
echo "For this to work the local kubernetes cluster must have access to the same local registry / image cache which 'docker build ...' writes its image to"
55
echo "For example docker-desktop with its included k8s cluster"
66

77
echo "Usage: ./build-and-deploy.sh"
88

99
version="$(uuidgen)"
1010

11-
docker build -t local/juice-balancer:$version ./juice-balancer &
11+
docker build -t local/wrongsecrets-balancer:$version ./wrongsecrets-balancer &
1212
docker build -t local/cleaner:$version ./cleaner &
13-
docker build -t local/progress-watchdog:$version ./progress-watchdog &
13+
#docker build -t local/unusued-progress-watchdog:$version ./unusued-progress-watchdog &
1414

1515
wait
1616

17-
helm upgrade --install mj ./helm/multi-juicer --set="imagePullPolicy=Never" --set="balancer.repository=local/juice-balancer" --set="balancer.tag=$version" --set="progressWatchdog.repository=local/progress-watchdog" --set="progressWatchdog.tag=$version" --set="juiceShopCleanup.repository=local/cleaner" --set="juiceShopCleanup.tag=$version"
17+
#helm upgrade --install mj ./helm/wrongsecrets-ctf-party --set="imagePullPolicy=Never" --set="balancer.repository=local/wrongsecrets-balancer" --set="balancer.tag=$version" --set="progressWatchdog.repository=local/unusued-progress-watchdog" --set="progressWatchdog.tag=$version" --set="wrongsecretsCleanup.repository=local/cleaner" --set="wrongsecretsCleanup.tag=$version"
18+
helm upgrade --install mj ./helm/wrongsecrets-ctf-party --set="imagePullPolicy=Never" --set="balancer.repository=local/wrongsecrets-balancer" --set="balancer.tag=$version" --set="wrongsecretsCleanup.repository=local/cleaner" --set="wrongsecretsCleanup.tag=$version"
19+
#helm upgrade --install mj ./helm/wrongsecrets-ctf-party --set="imagePullPolicy=Always" --set="balancer.repository=jeroenwillemsen/wrongsecrets-balancer" --set="balancer.tag=0.1" --set="wrongsecretsCleanup.repository=jeroenwillemsen/wrongsecrets-ctf-cleaner" --set="wrongsecretsCleanup.tag=0.1"

cleaner/cleaner-cover.svg

Lines changed: 4 additions & 4 deletions
Loading

cleaner/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cleaner",
33
"version": "1.0.0",
4-
"description": "k8s ChronJob for cleaning up unused Juice Shop instances.",
4+
"description": "k8s ChronJob for cleaning up unused WrongSecrets instances.",
55
"main": "src/main.js",
66
"scripts": {
77
"test": "jest",

cleaner/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#WrongSecrets CTF Cleaner
2+
3+
This is a port from the Multijuice Cleaner. Original readme:
4+
15
![Cleaner Cover](./cleaner-cover.svg)
26

37
Cleaner is a sub component of MultiJuicer, a kubernetes Jobs which is responsible for cleaning up Juice Shop instances which haven't been used for some time.

cleaner/src/main.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,22 @@ async function main() {
3636
};
3737

3838
console.log(
39-
`Looking for Juice Shop Instances which have been inactive for more than ${MaxInactiveDuration}.`
39+
`Looking for WrongSecerets Instances which have been inactive for more than ${MaxInactiveDuration}.`
4040
);
41-
const instances = await k8sAppsApi.listNamespacedDeployment(
42-
Namespace,
41+
const instances = await k8sAppsApi.listDeploymentForAllNamespaces(
4342
true,
4443
undefined,
4544
undefined,
46-
undefined,
47-
'app=juice-shop'
45+
'app in (wrongsecrets, virtualdesktop)',
46+
200
4847
);
4948

5049
console.log(`Found ${instances.body.items.length} instances. Checking their activity.`);
5150

5251
for (const instance of instances.body.items) {
5352
const instanceName = instance.metadata.name;
5453
const lastConnectTimestamps = parseInt(
55-
instance.metadata.annotations['multi-juicer.iteratec.dev/lastRequest'],
54+
instance.metadata.annotations['wrongsecrets.owasp.dev/lastRequest'],
5655
10
5756
);
5857

@@ -99,7 +98,7 @@ async function main() {
9998

10099
main()
101100
.then((counts) => {
102-
console.log('Finished Juice Shop Instance Cleanup');
101+
console.log('Finished WrongSecrets Instance Cleanup');
103102
console.log('');
104103
console.log('Successful deletions:');
105104
console.log(` Deployments: ${counts.successful.deployments}`);

guides/aws/aws.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This example expects you to have the following cli tools setup.
1515
# First we'll need a cluster, you can create one using the eksctl cli.
1616
# This will take a couple of minutes
1717
eksctl create cluster \
18-
--name multi-juicer \
18+
--name wrongsecrets-ctf-party \
1919
--version 1.21 \
2020
--nodegroup-name standard-workers \
2121
--node-type t3.medium \
@@ -25,22 +25,22 @@ eksctl create cluster \
2525
--node-ami auto
2626

2727
# After completion verify that your kubectl context has been updated:
28-
# Should print something like: Administrator@multi-juicer.eu-central-1.eksctl.io
28+
# Should print something like: Administrator@wrongsecrets-ctf-party.eu-central-1.eksctl.io
2929
kubectl config current-context
3030
```
3131

3232
## Step 2. Installing MultiJuicer via helm
3333

3434
```sh
35-
# You'll need to add the multi-juicer helm repo to your helm repos
36-
helm repo add multi-juicer https://iteratec.github.io/multi-juicer/
35+
# You'll need to add the wrongsecrets-ctf-party helm repo to your helm repos
36+
helm repo add wrongsecrets-ctf-party https://iteratec.github.io/multi-juicer/
3737

38-
helm install multi-juicer multi-juicer/multi-juicer
38+
helm install wrongsecrets-ctf-party wrongsecrets-ctf-party/wrongsecrets-ctf-party
3939

4040
# kubernetes will now spin up the pods
4141
# to verify every thing is starting up, run:
4242
kubectl get pods
43-
# This should show you two pods a juice-balancer pod and a progress-watchdog pod
43+
# This should show you two pods a wrongsecrets-balancer pod and a unusued-progress-watchdog pod
4444
# Wait until both pods are ready
4545
```
4646

@@ -51,7 +51,7 @@ This step is optional, but helpful to catch errors quicker.
5151
```sh
5252
# lets test out if the app is working correctly before proceeding
5353
# for that we can port forward the JuiceBalancer service to your local machine
54-
kubectl port-forward service/juice-balancer 3000:3000
54+
kubectl port-forward service/wrongsecrets-balancer 3000:3000
5555

5656
# Open up your browser for localhost:3000
5757
# You should be able to see the MultiJuicer Balancer UI
@@ -64,15 +64,15 @@ kubectl port-forward service/juice-balancer 3000:3000
6464
# Go back to localhost:3000/balancer
6565
# To log in as the admin log in as the team "admin"
6666
# The password for the team gets autogenerated if not specified, you can extract it from the kubernetes secret:
67-
kubectl get secrets juice-balancer-secret -o=jsonpath='{.data.adminPassword}' | base64 --decode
67+
kubectl get secrets wrongsecrets-balancer-secret -o=jsonpath='{.data.adminPassword}' | base64 --decode
6868
```
6969

7070
## Step 4. Add Ingress to expose the app to the world
7171

7272
Create a loadbalancer which is exposed is achieved by running the following command:
7373

7474
```sh
75-
kubectl create -f https://raw.githubusercontent.com/iteratec/multi-juicer/main/guides/aws/loadbalancer.yaml
75+
kubectl create -f https://raw.githubusercontent.com/commjoen/wrongsecrets-ctf-party/firstport-activities/guides/aws/loadbalancer.yaml
7676
```
7777

7878
You can get the LoadBalancer's DNS record either from the AWS console, or by running:
@@ -81,9 +81,9 @@ You can get the LoadBalancer's DNS record either from the AWS console, or by run
8181
kubectl get services
8282

8383
# NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
84-
# juice-balancer ClusterIP 10.100.29.23 <none> 3000/TCP 3m14s
84+
# wrongsecrets-balancer ClusterIP 10.100.29.23 <none> 3000/TCP 3m14s
8585
# kubernetes ClusterIP 10.100.0.1 <none> 443/TCP 11h
86-
# multi-juicer-service-loadbalancer LoadBalancer 10.100.134.210 YOUR_DNS_RECORD_WILL_BE_HERE.eu-north-1.elb.amazonaws.com 80:32111/TCP 3m13s
86+
# wrongsecrets-ctf-party-service-loadbalancer LoadBalancer 10.100.134.210 YOUR_DNS_RECORD_WILL_BE_HERE.eu-north-1.elb.amazonaws.com 80:32111/TCP 3m13s
8787
```
8888

8989
Use `kubectl get pods`to see the pods you have successfully running, which should be similar to
@@ -92,8 +92,8 @@ Use `kubectl get pods`to see the pods you have successfully running, which shoul
9292
kubectl get pods
9393
# NAME READY STATUS RESTARTS AGE
9494
# cleanup-job-ID-ID 0/1 Completed 0 48m
95-
# juice-balancer-ID-ID 1/1 Running 0 80m
96-
# progress-watchdog-ID-ID 1/1 Running 0 80m
95+
# wrongsecrets-balancer-ID-ID 1/1 Running 0 80m
96+
# unusued-progress-watchdog-ID-ID 1/1 Running 0 80m
9797

9898

9999
kubectl get pods -n kube-system
@@ -110,11 +110,11 @@ kubectl get pods -n kube-system
110110
## Step 5. Deinstallation
111111

112112
```sh
113-
helm delete multi-juicer
113+
helm delete wrongsecrets-ctf-party
114114

115115
# Delete the loadbalancer setup
116-
kubectl delete -f kubectl create -f https://raw.githubusercontent.com/iteratec/multi-juicer/main/guides/aws/loadbalancer.yaml
116+
kubectl delete -f kubectl create -f https://raw.githubusercontent.com/commjoen/wrongsecrets-ctf-party/firstport-activities/guides/aws/loadbalancer.yaml
117117

118118
# Delete the kubernetes cluster
119-
eksctl delete cluster multi-juicer
119+
eksctl delete cluster wrongsecrets-ctf-party
120120
```

guides/aws/loadbalancer.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: multi-juicer-service-loadbalancer
4+
name: wrongsecrets-balancer-public
55
spec:
66
type: LoadBalancer
77
selector:
8-
app.kubernetes.io/name: multi-juicer
9-
app.kubernetes.io/instance: multi-juicer
8+
app.kubernetes.io/name: wrongsecrets-ctf-party
9+
app.kubernetes.io/instance: wrongsecrets-ctf-party
1010
ports:
1111
- protocol: TCP
1212
port: 80

0 commit comments

Comments
 (0)