Skip to content

Commit 332dca5

Browse files
puneeth072003commjoendependabot[bot]bendehaan
authored
updation (#4)
* Feat: initial start with k8s 1.25 migration * bump to k8s 1.25.6 in workflows * Feat(646): Adding PSA to k8s def files * feat(646): Update required config for minikube configration part 2 * feat(1.25): updated namespaced creation of vault as vault needs different security context config than our main workload * feat(1.25): updated vault liveiness checks as we have to test after every step again * feat(646): adding service account, BUT CONFIG OF APP NEEDS TO BE UPDATED TO CONTACT VAULT IN THE RIGHT NS * feat(646): First working setup for k8s minikube vault done, now preparing aws, azure, and okteto (to be finished & tested) * feat(646): complete okteto setup: we cannot do anything with workspace patching, tehrefore limitting securitycontext only * Feat(636): fix docs * feat(646): make http the same for all providers * feat(646): make precommit happy :( * fix(646): fix readmes again.... * build(deps): update hashicorp/google-beta requirement from ~> 4.54.0 to ~> 4.55.0 Updates the requirements on [hashicorp/google-beta](https://github.com/hashicorp/terraform-provider-google-beta) to permit the latest version. - [Release notes](https://github.com/hashicorp/terraform-provider-google-beta/releases) - [Changelog](https://github.com/hashicorp/terraform-provider-google-beta/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-provider-google-beta@v4.54.0...v4.55.0) --- updated-dependencies: - dependency-name: hashicorp/google-beta dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): update hashicorp/google requirement from ~> 4.54.0 to ~> 4.55.0 Updates the requirements on [hashicorp/google](https://github.com/hashicorp/terraform-provider-google) to permit the latest version. - [Release notes](https://github.com/hashicorp/terraform-provider-google/releases) - [Changelog](https://github.com/hashicorp/terraform-provider-google/blob/main/CHANGELOG.md) - [Commits](hashicorp/terraform-provider-google@v4.54.0...v4.55.0) --- updated-dependencies: - dependency-name: hashicorp/google dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Adding the Table of contents * doc(x): added @puneeth072003 as contriubtor * Adding the requeseted changes * Making corrections * Fixed spelling * Update README.md * Feat(OWASP#646): updated centralized vault upgrade script, migrated GCP to k8s 1.25 * Feat(OWASP#646): updated gcp docs * feat(OWASP#646): Started Azure migration (Found out we have to migrate to azure identities, wIP * feat(OWASP#646): Got Kubernetes 1.25 working in Azure using audit with aad-pod-identity * fix: add terraform lockfiles * fix: fix AWS setup for k8s 1.25 * Update README.md * build(deps): bump erzz/codeclimate-standalone from 0.0.4 to 0.0.5 Bumps [erzz/codeclimate-standalone](https://github.com/erzz/codeclimate-standalone) from 0.0.4 to 0.0.5. - [Release notes](https://github.com/erzz/codeclimate-standalone/releases) - [Changelog](https://github.com/erzz/codeclimate-standalone/blob/main/CHANGELOG.md) - [Commits](erzz/codeclimate-standalone@v0.0.4...v0.0.5) --- updated-dependencies: - dependency-name: erzz/codeclimate-standalone dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update codeclimate_standalone.yml --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Jeroen Willemsen <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ben de Haan <[email protected]>
1 parent 9156463 commit 332dca5

32 files changed

+505
-97
lines changed

.github/workflows/codeclimate_standalone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
uses: actions/checkout@v3
1818

1919
- name: Run Code Climate
20-
uses: erzz/[email protected].4
20+
uses: erzz/[email protected].5
2121
with:
2222
html_report: true
2323
info_threshold: 50
2424
minor_threshold: 25
25-
major_threshold: 10
25+
major_threshold: 30
2626
critical_threshold: 5
2727
blocker_threshold: 1
2828

.github/workflows/minikube-k8s-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ jobs:
2121
- name: Start minikube
2222
uses: medyagh/setup-minikube@master
2323
with:
24-
minikube-version: 1.28.0
24+
minikube-version: 1.29.0
2525
driver: docker
26-
kubernetes-version: v1.23.12
26+
kubernetes-version: v1.25.6
2727
- name: test script
2828
run: |
29+
kubectl apply -f k8s/workspace-psa.yml
2930
kubectl apply -f k8s/secrets-config.yml
3031
kubectl apply -f k8s/secrets-secret.yml
3132
kubectl apply -f k8s/secret-challenge-deployment.yml

.github/workflows/minikube-vault-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
- name: Start minikube
2323
uses: medyagh/setup-minikube@master
2424
with:
25-
minikube-version: 1.28.0
25+
minikube-version: 1.29.0
2626
driver: docker
27-
kubernetes-version: v1.23.12
27+
kubernetes-version: v1.25.6
2828
- name: Setup helm
2929
uses: azure/[email protected]
3030
id: install

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2626
hs_err_pid*
2727

28-
.DS_STORE
28+
.DS_Store
2929
target
3030

3131
.vscode
@@ -43,8 +43,7 @@ root_token
4343
# Terraform
4444
kubeconfig_wrongsecrets-exercise-cluster
4545
.terraform
46-
.terraform.lock.hcl
47-
.terraform*
46+
.terraform
4847
terraform.tfstate*
4948
aws/terraform.tfstate.*
5049
aws/terraform.tfstate.backup
@@ -66,6 +65,8 @@ azure/k8s/pod-id.yml
6665
# Challenge 17
6766
.github/scripts/thirdkey.txt
6867

68+
yourkey.txt
69+
6970
# Node JS
7071
js/node/
7172
js/node_modules/

README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,40 @@ Can you solve all the 27 challenges?
1616

1717
<a href="https://github.com/vshymanskyy/StandWithUkraine/blob/main/README.md"><img src="https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-no-action.svg" /></a>
1818

19+
20+
## Table of contents
21+
- [Support](#support)
22+
- [Basic docker exercises](#basic-docker-exercises)
23+
- [Running these on Heroku](#running-these-on-heroku)
24+
- [Deploying the app under your own heroku account](#deploying-the-app-under-your-own-heroku-account)
25+
- [Running on Fly.io](#running-on-flyio)
26+
- [Basic K8s exercise](#basic-k8s-exercise)
27+
- [Minikube based](#minikube-based)
28+
- [k8s based](#k8s-based)
29+
- [Okteto based](#okteto-based)
30+
- [Vault exercises with minikube](#vault-exercises-with-minikube)
31+
- [Cloud Challenges](#cloud-challenges)
32+
- [Running WrongSecrets in AWS](#running-wrongsecrets-in-aws)
33+
- [Running WrongSecrets in GCP](#running-wrongsecrets-in-gcp)
34+
- [Running WrongSecrets in Azure](#running-wrongsecrets-in-azure)
35+
- [Running Challenge15 in your own cloud only](#running-challenge15-in-your-own-cloud-only)
36+
- [Do you want to play without guidance?](#do-you-want-to-play-without-guidance)
37+
- [Special thanks & Contributors](#special-thanks--contributors)
38+
- [Sponsorships](#sponsorships)
39+
- [Help Wanted](#help-wanted)
40+
- [Use OWASP WrongSecrets as a secret detection benchmark](#use-owasp-wrongsecrets-as-a-secret-detection-benchmark)
41+
- [CTF](#ctf)
42+
- [CTFD Support](#ctfd-support)
43+
- [FBCTF Support](#fbctf-support--experimental--)
44+
- [Notes on development](#notes-on-development)
45+
- [Dependency management](#dependency-management)
46+
- [Get the project started in IntelliJ IDEA](#get-the-project-started-in-intellij-idea)
47+
- [Automatic reload during development](#automatic-reload-during-development)
48+
- [How to add a Challenge](#how-to-add-a-challenge)
49+
- [Local testing](#local-testing)
50+
- [Want to play, but are not allowed to install the tools?](#want-to-play-but-are-not-allowed-to-install-the-tools)
51+
- [Further reading on secrets management](#further-reading-on-secrets-management)
52+
1953
## Support
2054

2155
Need support? Contact us
@@ -212,6 +246,7 @@ Top contributors:
212246
- [Marcin Nowak @MarcinNowak-codes](https://github.com/MarcinNowak-codes)
213247
- [Tibor Hercz @tiborhercz](https://github.com/tiborhercz)
214248
- [Chris Elbring Jr. @neatzsche](https://github.com/neatzsche)
249+
- [Puneeth Y @puneeth072003](https://github.com/puneeth072003)
215250
- [Filip Chyla @fchyla](https://github.com/fchyla)
216251
- [Dmitry Litosh @Dlitosh](https://github.com/Dlitosh)
217252
- [Josh Grossman @tghosth](https://github.com/tghosth)
@@ -283,7 +318,7 @@ We have 3 ways of playing CTFs:
283318
Want to use CTFD to play a CTF based on the free Heroku wrongsecrets-ctf instance together with CTFD? You can!
284319

285320
NOTE: CTFD support now works based on the [Juiceshop CTF CLI](https://github.com/juice-shop/juice-shop-ctf).
286-
NOTE-II: [https://wrongsecrets-ctf.herokuapp.com](https://wrongsecrets-ctf.herokuapp.com) is based on a free heroku instance, which takes time to warm up.
321+
NOTE-II: [https://wrongsecrets-ctf.herokuapp.com](https://wrongsecrets-ctf.herokuapp.com) (temporary down based on lack of oss credits) is based on a free heroku instance, which takes time to warm up.
287322
Initial creation of the zip file for CTFD requires you to visit [https://wrongsecrets-ctf.herokuapp.com/api/Challenges](https://wrongsecrets-ctf.herokuapp.com/api/Challenges) once before executing the steps below.
288323

289324
Follow the following steps:
@@ -313,16 +348,16 @@ For development on local machine use the `local` profile `./mvnw spring-boot:run
313348
If you want to test against vault without K8s: start vault locally with
314349

315350
```shell
316-
export VAULT_ADDR='http://127.0.0.1:8200'
351+
export SPRING_CLOUD_VAULT_URI='http://127.0.0.1:8200'
317352
export VAULT_API_ADDR='http://127.0.0.1:8200'
318353
vault server -dev
319354
```
320355

321356
and in your next terminal, do (with the token from the previous commands):
322357

323358
```shell
324-
export VAULT_ADDR='http://127.0.0.1:8200'
325-
export VAULT_TOKEN='<TOKENHERE>'
359+
export SPRING_CLOUD_VAULT_URI='http://127.0.0.1:8200'
360+
export SPRING_CLOUD_VAULT_TOKEN='<TOKENHERE>'
326361
vault token create -id="00000000-0000-0000-0000-000000000000" -policy="root"
327362
vault kv put secret/secret-challenge vaultpassword.password="$(openssl rand -base64 16)"
328363
```
@@ -359,6 +394,8 @@ Requirements: make sure you have the following tools installed: [Docker](https:/
359394
7. Now go to the run configuration of the app and make sure you have the active profile `without-vault`. This is done by setting the VM options arguments to `-Dserver.port=8080 -Dspring.profiles.active=local,without-vault`. Set `K8S_ENV=docker` as environment argument.
360395
8. Repeat step 6: run the app again, you should have a properly running application which is visitable in your browser at http://localhost:8080.
361396

397+
**Pictorial Guide** on how to get the project started in IntelliJ IDEA is available at [*Contributing.md*](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md#how-to-get-started-with-the-project-in-intellij-idea).
398+
362399
Feel free to edit and propose changes via pull requests. Be sure to follow our guidance in the [documentation](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md) to get your work accepted.
363400

364401
Please note that we officially only support Linux and MacOS for development. If you want to develop using a Windows machine, use WSL2 or a virtual machine running Linux. We did include Windows detection & a bunch of `exe` files for a first experiment, but are looking for active maintainers of them. Want to make sure it runs on Windows? Create PRs ;-).
@@ -385,6 +422,8 @@ Follow the steps below on adding a challenge:
385422
4. Don't forget to add `@Order` annotation to your challenge ;-).
386423
5. Review the [CONTRIBUTING guide](CONTRIBUTING.md) for setting up your contributing environment and writing good commit messages.
387424

425+
For more details please refer [*Contributing.md*](https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md#how-to-add-a-challenge).
426+
388427
If you want to move existing cloud challenges to another cloud: extend Challenge classes in the `org.owasp.wrongsecrets.challenges.cloud` package and make sure you add the required Terraform in a folder with the separate cloud identified. Make sure that the environment is added to `org.owasp.wrongsecrets.RuntimeEnvironment`.
389428
Collaborate with the others at the project to get your container running so you can test at the cloud account.
390429

aws/.terraform.lock.hcl

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

aws/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ The documentation below is auto-generated to give insight on what's created via
111111

112112
| Name | Version |
113113
|------|---------|
114-
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.56.0 |
115-
| <a name="provider_http"></a> [http](#provider\_http) | ~> 3.2.1 |
116-
| <a name="provider_random"></a> [random](#provider\_random) | ~> 3.4.3 |
114+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.56.0 |
115+
| <a name="provider_http"></a> [http](#provider\_http) | 3.2.1 |
116+
| <a name="provider_random"></a> [random](#provider\_random) | 3.4.3 |
117117

118118
## Modules
119119

@@ -154,7 +154,7 @@ The documentation below is auto-generated to give insight on what's created via
154154
| Name | Description | Type | Default | Required |
155155
|------|-------------|------|---------|:--------:|
156156
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | The EKS cluster name | `string` | `"wrongsecrets-exercise-cluster"` | no |
157-
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.23"` | no |
157+
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | The EKS cluster version to use | `string` | `"1.25"` | no |
158158
| <a name="input_region"></a> [region](#input\_region) | The AWS region to use | `string` | `"eu-west-1"` | no |
159159

160160
## Outputs

aws/k8s-vault-aws-start.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ AWS_REGION="eu-west-1"
1212
echo "This is a script to bootstrap the configuration. You need to have installed: helm, kubectl, jq, vault, grep, cat, sed, and awscli, and is only tested on mac, Debian and Ubuntu"
1313
echo "This script is based on the steps defined in https://learn.hashicorp.com/tutorials/vault/kubernetes-minikube. Vault is awesome!"
1414

15+
echo "Setting up workspace PSA to restricted for default"
16+
kubectl apply -f ../k8s/workspace-psa.yml
17+
1518
kubectl get configmaps | grep 'secrets-file' &>/dev/null
1619
if [ $? == 0 ]; then
1720
echo "secrets config is already installed"

0 commit comments

Comments
 (0)