Skip to content

Commit

Permalink
Merge pull request #83 from commjoen/css
Browse files Browse the repository at this point in the history
Get the link highlighitng for #40
  • Loading branch information
commjoen authored Nov 26, 2021
2 parents 9e9f0dc + 47498a4 commit 337dd50
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Locale;

@Controller
@Slf4j
@RequiredArgsConstructor
Expand All @@ -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";
}
}
28 changes: 19 additions & 9 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,37 @@
<div class="container">
<div class="container-fluid text-sm p-5 bg-light">
<h1 class="display-2">Welcome</h1>
<p class="lead">Welcome to OWASP WrongSecrets. With this app, we hope you will re-evaluate your secrets management
<p class="lead">Welcome to OWASP WrongSecrets. With this app, we hope you will re-evaluate your secrets
management
strategy</p>
<hr class="my-4">
<p>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).</p>
<p>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).</p>

</div>
<div class="row">
<div class="col-12 col-md-9 mt-3">
<p>
<!-- TODO: th:classappend="${isAdmin} ? 'adminclass' : userclass'"-->
<a href="challenge/1">Challenge 1 (requires Docker)</a><br/>
<a href="challenge/2">Challenge 2 (requires Docker)</a><br/>
<a href="challenge/3">Challenge 3 (requires Docker)</a><br/>
<a href="challenge/4">Challenge 4 (requires Docker)</a><br/>
<a href="challenge/5">Challenge 5 (requires K8s/Minikube)</a><br/>
<a href="challenge/6">Challenge 6 (requires K8s/minikube)</a><br/>
<a href="challenge/7">Challenge 7 (requires k8s/minikube with Vault)</a><br/>
<a href="challenge/5" th:class="${k8s == null} ? 'disabled' : ''">Challenge 5 (requires
K8s/Minikube)</a><br/>
<a href="challenge/6" th:class="${k8s == null} ? 'disabled' : ''">Challenge 6 (requires
K8s/minikube)</a><br/>
<a href="challenge/7" th:class="${vault == null} ? 'disabled' : ''">Challenge 7 (requires k8s/minikube
with Vault)</a><br/>
<a href="challenge/8">Challenge 8 (requires Docker)</a><br/>
<a href="challenge/9">Challenge 9 (requires AWS or GCP)</a><br/>
<a href="challenge/10">Challenge 10 (requires AWS or GCP)</a><br/>
<a href="challenge/11">Challenge 11 (requires AWS or GCP-WIP)</a><br/>
<a href="challenge/9" th:class="${cloud == null} ? 'disabled' : ''">Challenge
9 (requires AWS or GCP)</a><br/>
<a href="challenge/10" th:class="${cloud == null} ? 'disabled' : ''">Challenge
10 (requires AWS or GCP)</a><br/>
<a href="challenge/11" th:class="${cloud == null} ? 'disabled' : ''">Challenge
11 (requires AWS or GCP-WIP)</a><br/>
</p>
<p>Don't want to wait for Vault? here is <a href="spoil-7">the secret :(</a>.</p>
<p th:text="'You are currently running on the following environment: '+${environment}"></p>
Expand Down

0 comments on commit 337dd50

Please sign in to comment.