From dc3af6d21ff315b9bd930d87e5292ba8b0e58336 Mon Sep 17 00:00:00 2001 From: Jeroen Willemsen Date: Fri, 26 Nov 2021 10:12:58 +0100 Subject: [PATCH 1/2] Get the link highlighitng for #40 --- .../challenges/IndexController.java | 13 +++++++++ src/main/resources/templates/index.html | 28 +++++++++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java b/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java index e6feaa3c9..aa2b4a817 100644 --- a/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java +++ b/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java @@ -7,6 +7,8 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; +import java.util.Locale; + @Controller @Slf4j @RequiredArgsConstructor @@ -22,6 +24,17 @@ public class IndexController { public String index(Model model) { model.addAttribute("version", version); model.addAttribute("environment", k8sEnvironment); + if(k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + model.addAttribute("cloud", "enabled"); + } + if(k8sEnvironment.toLowerCase(Locale.ROOT).contains("vault")|| k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + model.addAttribute("vault", "enabled"); + } + if(k8sEnvironment.toLowerCase(Locale.ROOT).contains("k8s")|| k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + model.addAttribute("k8s", "enabled"); + } + + return "index"; } } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 947463283..8e3f16a6c 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -53,27 +53,37 @@

Welcome

-

Welcome to OWASP WrongSecrets. With this app, we hope you will re-evaluate your secrets management +

Welcome to OWASP WrongSecrets. With this app, we hope you will re-evaluate your secrets + management strategy


-

For each of the challenges below: try to find the secret! Enter it in the `Answer to solution` box and score points! - Note that some of the challenges require this app to run on additional infrastructure (see in the links below).

+

For each of the challenges below: try to find the secret! Enter it in the `Answer to solution` box and score + points! + Note that some of the challenges require this app to run on additional infrastructure (see in the links + below).

+ Challenge 1 (requires Docker)
Challenge 2 (requires Docker)
Challenge 3 (requires Docker)
Challenge 4 (requires Docker)
- Challenge 5 (requires K8s/Minikube)
- Challenge 6 (requires K8s/minikube)
- Challenge 7 (requires k8s/minikube with Vault)
+ Challenge 5 (requires + K8s/Minikube)
+ Challenge 6 (requires + K8s/minikube)
+ Challenge 7 (requires k8s/minikube + with Vault)
Challenge 8 (requires Docker)
- Challenge 9 (requires AWS or GCP)
- Challenge 10 (requires AWS or GCP)
- Challenge 11 (requires AWS or GCP-WIP)
+ Challenge + 9 (requires AWS or GCP)
+ Challenge + 10 (requires AWS or GCP)
+ Challenge + 11 (requires AWS or GCP-WIP)

Don't want to wait for Vault? here is the secret :(.

From 2eaf18c0e9b8525b39813d3b8bcc7976dc88e54b Mon Sep 17 00:00:00 2001 From: Jeroen Willemsen Date: Fri, 26 Nov 2021 10:15:04 +0100 Subject: [PATCH 2/2] fix checkstyle --- .../org/owasp/wrongsecrets/challenges/IndexController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java b/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java index aa2b4a817..065acc1e9 100644 --- a/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java +++ b/src/main/java/org/owasp/wrongsecrets/challenges/IndexController.java @@ -24,13 +24,13 @@ public class IndexController { public String index(Model model) { model.addAttribute("version", version); model.addAttribute("environment", k8sEnvironment); - if(k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + if (k8sEnvironment == "gcp" || k8sEnvironment == "aws") { model.addAttribute("cloud", "enabled"); } - if(k8sEnvironment.toLowerCase(Locale.ROOT).contains("vault")|| k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + if (k8sEnvironment.toLowerCase(Locale.ROOT).contains("vault") || k8sEnvironment == "gcp" || k8sEnvironment == "aws") { model.addAttribute("vault", "enabled"); } - if(k8sEnvironment.toLowerCase(Locale.ROOT).contains("k8s")|| k8sEnvironment== "gcp"|| k8sEnvironment== "aws"){ + if (k8sEnvironment.toLowerCase(Locale.ROOT).contains("k8s") || k8sEnvironment == "gcp" || k8sEnvironment == "aws") { model.addAttribute("k8s", "enabled"); }