diff --git a/.github/scripts/.bash_history b/.github/scripts/.bash_history index 9e71b145ca..5d9da2c52e 100644 --- a/.github/scripts/.bash_history +++ b/.github/scripts/.bash_history @@ -347,7 +347,7 @@ rm -rf jdk-18_linux-x64_bin.deb git rebase -i main git rebase -i master git stash -export tempPassword="tJ+u+3d6BlYkT0uT1KrdPqkmuimjC3LmtOm0BukRVyE=" +export tempPassword="pHfQ8y4y0esyeomcsed/RvNhAQFDB9ZoCnyB8UlNQJ8=" mvn run tempPassword k6 npx k6 diff --git a/.github/workflows/minikube-k8s-test.yml b/.github/workflows/minikube-k8s-test.yml index ce141db098..662ce9235f 100644 --- a/.github/workflows/minikube-k8s-test.yml +++ b/.github/workflows/minikube-k8s-test.yml @@ -24,7 +24,7 @@ jobs: - name: Start minikube uses: medyagh/setup-minikube@master with: - minikube-version: 1.31.2 + minikube-version: 1.33.1 driver: docker kubernetes-version: v1.28.1 - name: test script diff --git a/.github/workflows/minikube-vault-test.yml b/.github/workflows/minikube-vault-test.yml index 15071a7ddf..0d9391cf0b 100644 --- a/.github/workflows/minikube-vault-test.yml +++ b/.github/workflows/minikube-vault-test.yml @@ -25,7 +25,7 @@ jobs: - name: Start minikube uses: medyagh/setup-minikube@master with: - minikube-version: 1.31.2 + minikube-version: 1.33.1 driver: docker kubernetes-version: v1.28.1 - name: Setup helm @@ -45,7 +45,7 @@ jobs: - name: Start minikube uses: medyagh/setup-minikube@master with: - minikube-version: 1.31.2 + minikube-version: 1.33.1 driver: docker kubernetes-version: v1.28.1 - name: Setup helm @@ -54,7 +54,6 @@ jobs: - name: test script run: | ./k8s-vault-minkube-start.sh && sleep 5 && curl http://localhost:8080/spoil/challenge-7 - - name: Run Tests run: | cd src/test/K8s-tests diff --git a/README.md b/README.md index 80169f5f05..e66fac05a9 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,8 @@ export SPRING_CLOUD_VAULT_URI='http://127.0.0.1:8200' export SPRING_CLOUD_VAULT_TOKEN='' vault token create -id="00000000-0000-0000-0000-000000000000" -policy="root" vault kv put secret/secret-challenge vaultpassword.password="$(openssl rand -base64 16)" +vault kv put secret/injected vaultinjected.value="$(openssl rand -base64 16)" +vault kv put secret/codified challenge47secret.value="debugvalue" ``` Now use the `local-vault` profile to do your development. diff --git a/aws/k8s/secret-challenge-vault-deployment.yml b/aws/k8s/secret-challenge-vault-deployment.yml index 6435aebc56..8fe31dab99 100644 --- a/aws/k8s/secret-challenge-vault-deployment.yml +++ b/aws/k8s/secret-challenge-vault-deployment.yml @@ -19,7 +19,24 @@ spec: type: RollingUpdate template: metadata: - creationTimestamp: "2020-10-28T20:21:04Z" + annotations: + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/tls-skip-verify: "true" + vault.hashicorp.com/namespace: "default" + vault.hashicorp.com/log-level: debug + vault.hashicorp.com/agent-inject-secret-challenge46: "secret/data/injected" + vault.hashicorp.com/agent-inject-template-challenge46: | + {{ with secret "/secret/data/injected" }} + {{ range $k, $v := .Data.data }} + {{ printf "echo %s=%s" $k $v }} + {{ end }} + {{ end }} + vault.hashicorp.com/agent-inject-secret-challenge47: "secret/data/codified" + vault.hashicorp.com/agent-inject-template-challenge47: | + {{ with secret "secret/data/codified" }} + export challenge47secret="isthiswhatweneed?" + {{ end }} + vault.hashicorp.com/role: "secret-challenge" labels: app: secret-challenge name: secret-challenge @@ -41,9 +58,11 @@ spec: volumeAttributes: secretProviderClass: "wrongsecrets-aws-secretsmanager" containers: - - image: jeroenwillemsen/wrongsecrets:1.8.5-k8s-vault + - image: jeroenwillemsen/wrongsecrets:1.8.6A4-k8s-vault imagePullPolicy: IfNotPresent name: secret-challenge + command: [ "/bin/sh" ] + args: [ "-c", "source /vault/secrets/challenge46 && source /vault/secrets/challenge47 && java -jar -Dspring.profiles.active=kubernetes-vault -Dspringdoc.swagger-ui.enabled=true -Dspringdoc.api-docs.enabled=true -D /application.jar" ] securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true diff --git a/azure/k8s/secret-challenge-vault-deployment.yml.tpl b/azure/k8s/secret-challenge-vault-deployment.yml.tpl index 8c1ea3169d..3719d2eb6d 100644 --- a/azure/k8s/secret-challenge-vault-deployment.yml.tpl +++ b/azure/k8s/secret-challenge-vault-deployment.yml.tpl @@ -1,6 +1,24 @@ apiVersion: apps/v1 kind: Deployment metadata: + annotations: + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/tls-skip-verify: "true" + vault.hashicorp.com/namespace: "default" + vault.hashicorp.com/log-level: debug + vault.hashicorp.com/agent-inject-secret-challenge46: "secret/data/injected" + vault.hashicorp.com/agent-inject-template-challenge46: | + {{ with secret "/secret/data/injected" }} + {{ range $k, $v := .Data.data }} + {{ printf "echo %s=%s" $k $v }} + {{ end }} + {{ end }} + vault.hashicorp.com/agent-inject-secret-challenge47: "secret/data/codified" + vault.hashicorp.com/agent-inject-template-challenge47: | + {{ with secret "secret/data/codified" }} + export challenge47secret="isthiswhatweneed?" + {{ end }} + vault.hashicorp.com/role: "secret-challenge" labels: app: secret-challenge aadpodidbinding: wrongsecrets-pod-id @@ -44,6 +62,8 @@ spec: - image: jeroenwillemsen/wrongsecrets:4-k8s-vault imagePullPolicy: IfNotPresent name: secret-challenge + command: ["/bin/sh"] + args: ["-c", "source /vault/secrets/challenge46 && source /vault/secrets/challenge47 && java -jar -Dspring.profiles.active=kubernetes-vault -Dspringdoc.swagger-ui.enabled=true -Dspringdoc.api-docs.enabled=true -D /application.jar"] securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true diff --git a/gcp/k8s/secret-challenge-vault-deployment.yml.tpl b/gcp/k8s/secret-challenge-vault-deployment.yml.tpl index a2311f6d9b..90658713f3 100644 --- a/gcp/k8s/secret-challenge-vault-deployment.yml.tpl +++ b/gcp/k8s/secret-challenge-vault-deployment.yml.tpl @@ -19,7 +19,24 @@ spec: type: RollingUpdate template: metadata: - creationTimestamp: "2020-10-28T20:21:04Z" + annotations: + vault.hashicorp.com/agent-inject: "true" + vault.hashicorp.com/tls-skip-verify: "true" + vault.hashicorp.com/namespace: "default" + vault.hashicorp.com/log-level: debug + vault.hashicorp.com/agent-inject-secret-challenge46: "secret/data/injected" + vault.hashicorp.com/agent-inject-template-challenge46: | + {{ with secret "/secret/data/injected" }} + {{ range $k, $v := .Data.data }} + {{ printf "echo %s=%s" $k $v }} + {{ end }} + {{ end }} + vault.hashicorp.com/agent-inject-secret-challenge47: "secret/data/codified" + vault.hashicorp.com/agent-inject-template-challenge47: | + {{ with secret "secret/data/codified" }} + export challenge47secret="isthiswhatweneed?" + {{ end }} + vault.hashicorp.com/role: "secret-challenge" labels: app: secret-challenge name: secret-challenge @@ -39,9 +56,11 @@ spec: volumeAttributes: secretProviderClass: "wrongsecrets-gcp-secretsmanager" containers: - - image: jeroenwillemsen/wrongsecrets:1.8.5-k8s-vault + - image: jeroenwillemsen/wrongsecrets:1.8.6A4-k8s-vault imagePullPolicy: IfNotPresent name: secret-challenge + command: ["/bin/sh"] + args: ["-c", "source /vault/secrets/challenge46 && source /vault/secrets/challenge47 && java -jar -Dspring.profiles.active=kubernetes-vault -Dspringdoc.swagger-ui.enabled=true -Dspringdoc.api-docs.enabled=true -D /application.jar"] ports: - containerPort: 8080 protocol: TCP diff --git a/js/index.js b/js/index.js index 872ce6d91a..70629c3b04 100644 --- a/js/index.js +++ b/js/index.js @@ -1,5 +1,5 @@ // eslint-disable-next-line no-unused-vars function secret() { - var password = "/6BjgXY=" + 9 + "2MsE" + 6 + "Ybg=" + 2 + "u1VG" + 7; + var password = "0MHz79A=" + 9 + "FCx5" + 6 + "KSI=" + 2 + "Sg/9" + 7; return password; } diff --git a/k8s-vault-minkube-start.sh b/k8s-vault-minkube-start.sh index 11786f9327..d6c6423ee8 100755 --- a/k8s-vault-minkube-start.sh +++ b/k8s-vault-minkube-start.sh @@ -84,6 +84,9 @@ kubectl exec vault-0 -n vault -- vault kv put secret/secret-challenge vaultpassw echo "Putting a challenge key in" kubectl exec vault-0 -n vault -- vault kv put secret/injected vaultinjected.value="$(openssl rand -base64 16)" +echo "Putting a challenge key in" +kubectl exec vault-0 -n vault -- vault kv put secret/codified challenge47secret.value="debugvalue" + echo "Putting a subkey issue in" kubectl exec vault-0 -n vault -- vault kv put secret/wrongsecret aaaauser."$(openssl rand -base64 8)"="$(openssl rand -base64 16)" @@ -121,6 +124,9 @@ path "secret/data/application" { path "secret/data/injected" { capabilities = ["read"] } +path "secret/data/codified" { + capabilities = ["read"] +} EOF' kubectl exec vault-0 -n vault -- /bin/sh -c 'vault policy write standard_sre - <org.owasp wrongsecrets - 1.8.5-SNAPSHOT + 1.8.6A4-SNAPSHOT OWASP WrongSecrets Examples with how to not use secrets @@ -51,7 +51,7 @@ 5.11.0 8.0.3 2.0.3 - 9.0.10 + 9.2.0 4.9.0 3.11.2 5.1.2 @@ -161,6 +161,7 @@ org.testcontainers testcontainers + 1.19.8 test @@ -343,7 +344,7 @@ com.github.spotbugs spotbugs - 4.8.4 + 4.8.5 diff --git a/scripts/install-vault.sh b/scripts/install-vault.sh index c290a0aa37..ccab34ff4c 100644 --- a/scripts/install-vault.sh +++ b/scripts/install-vault.sh @@ -52,6 +52,9 @@ kubectl exec vault-0 -n vault -- vault kv put secret/secret-challenge vaultpassw echo "Putting a challenge key in" kubectl exec vault-0 -n vault -- vault kv put secret/injected vaultinjected.value="$(openssl rand -base64 16)" +echo "Putting a challenge key in" +kubectl exec vault-0 -n vault -- vault kv put secret/codified challenge47secret.value="debugvalue" + echo "Putting a subkey issue in" kubectl exec vault-0 -n vault -- vault kv put secret/wrongsecret aaaauser."$(openssl rand -base64 8)"="$(openssl rand -base64 16)" @@ -87,6 +90,9 @@ path "secret/data/application" { path "secret/data/injected" { capabilities = ["read"] } +path "secret/data/codified" { + capabilities = ["read"] +} EOF' kubectl exec vault-0 -n vault -- /bin/sh -c 'vault policy write standard_sre - <(Apache License, Version 2.0) Apache Commons Collections (commons-collections:commons-collections:3.2.2 - http://commons.apache.org/collections/)
  • (The Apache Software License, Version 2.0) Commons Digester (commons-digester:commons-digester:2.1 - http://commons.apache.org/digester/)
  • (Apache-2.0) Apache Commons IO (commons-io:commons-io:2.14.0 - https://commons.apache.org/proper/commons-io/)
  • -
  • (The Apache Software License, Version 2.0) Apache Commons Logging (commons-logging:commons-logging:1.2 - http://commons.apache.org/proper/commons-logging/)
  • -
  • (Apache License, Version 2.0) Apache Commons Validator (commons-validator:commons-validator:1.7 - http://commons.apache.org/proper/commons-validator/)
  • +
  • (Apache-2.0) Apache Commons Logging (commons-logging:commons-logging:1.3.0 - https://commons.apache.org/proper/commons-logging/)
  • +
  • (Apache-2.0) Apache Commons Validator (commons-validator:commons-validator:1.8.0 - http://commons.apache.org/proper/commons-validator/)
  • (The Apache License, Version 2.0) jcs3-slf4j (io.github.jeremylong:jcs3-slf4j:1.0.5 - https://github.com/jeremylong/jcs3-slf4j/)
  • -
  • (The Apache License, Version 2.0) open-vulnerability-clients (io.github.jeremylong:open-vulnerability-clients:5.1.1 - https://github.com/jeremylong/vuln-tools/)
  • +
  • (The Apache License, Version 2.0) open-vulnerability-clients (io.github.jeremylong:open-vulnerability-clients:6.0.1 - https://github.com/jeremylong/vuln-tools/)
  • (Apache 2.0) io.grpc:grpc-alts (io.grpc:grpc-alts:1.62.2 - https://github.com/grpc/grpc-java)
  • (Apache 2.0) io.grpc:grpc-api (io.grpc:grpc-api:1.62.2 - https://github.com/grpc/grpc-java)
  • (Apache 2.0) io.grpc:grpc-auth (io.grpc:grpc-auth:1.62.2 - https://github.com/grpc/grpc-java)
  • @@ -213,7 +213,7 @@
  • (Apache-2.0) Apache Commons JCS :: Core (org.apache.commons:commons-jcs3-core:3.2 - http://commons.apache.org/proper/commons-jcs/commons-jcs3-core/)
  • (Apache-2.0) Apache Commons Lang (org.apache.commons:commons-lang3:3.13.0 - https://commons.apache.org/proper/commons-lang/)
  • (Apache-2.0) Apache Commons Pool (org.apache.commons:commons-pool2:2.12.0 - https://commons.apache.org/proper/commons-pool/)
  • -
  • (Apache-2.0) Apache Commons Text (org.apache.commons:commons-text:1.11.0 - https://commons.apache.org/proper/commons-text)
  • +
  • (Apache-2.0) Apache Commons Text (org.apache.commons:commons-text:1.12.0 - https://commons.apache.org/proper/commons-text)
  • (The Apache Software License, Version 2.0) Apache Groovy (org.apache.groovy:groovy:4.0.21 - https://groovy-lang.org)
  • (Apache License, Version 2.0) Apache HttpClient (org.apache.httpcomponents:httpclient:4.5.14 - http://hc.apache.org/httpcomponents-client-ga)
  • (Apache License, Version 2.0) Apache HttpCore (org.apache.httpcomponents:httpcore:4.4.16 - http://hc.apache.org/httpcomponents-core-ga)
  • @@ -222,14 +222,14 @@
  • (Apache License, Version 2.0) Apache HttpComponents Core HTTP/2 (org.apache.httpcomponents.core5:httpcore5-h2:5.2.4 - https://hc.apache.org/httpcomponents-core-5.2.x/5.2.4/httpcore5-h2/)
  • (Apache-2.0) Apache Log4j API (org.apache.logging.log4j:log4j-api:2.21.1 - https://logging.apache.org/log4j/2.x/log4j/log4j-api/)
  • (Apache-2.0) Apache Log4j to SLF4J Adapter (org.apache.logging.log4j:log4j-to-slf4j:2.21.1 - https://logging.apache.org/log4j/2.x/log4j/log4j-to-slf4j/)
  • -
  • (Apache License, Version 2.0) Lucene Common Analyzers (org.apache.lucene:lucene-analyzers-common:8.11.2 - https://lucene.apache.org/lucene-parent/lucene-analyzers-common)
  • -
  • (Apache License, Version 2.0) Lucene Core (org.apache.lucene:lucene-core:8.11.2 - https://lucene.apache.org/lucene-parent/lucene-core)
  • -
  • (Apache License, Version 2.0) Lucene Queries (org.apache.lucene:lucene-queries:8.11.2 - https://lucene.apache.org/lucene-parent/lucene-queries)
  • -
  • (Apache License, Version 2.0) Lucene QueryParsers (org.apache.lucene:lucene-queryparser:8.11.2 - https://lucene.apache.org/lucene-parent/lucene-queryparser)
  • -
  • (Apache License, Version 2.0) Lucene Sandbox (org.apache.lucene:lucene-sandbox:8.11.2 - https://lucene.apache.org/lucene-parent/lucene-sandbox)
  • +
  • (Apache License, Version 2.0) Lucene Common Analyzers (org.apache.lucene:lucene-analyzers-common:8.11.3 - https://lucene.apache.org/lucene-parent/lucene-analyzers-common)
  • +
  • (Apache License, Version 2.0) Lucene Core (org.apache.lucene:lucene-core:8.11.3 - https://lucene.apache.org/lucene-parent/lucene-core)
  • +
  • (Apache License, Version 2.0) Lucene Queries (org.apache.lucene:lucene-queries:8.11.3 - https://lucene.apache.org/lucene-parent/lucene-queries)
  • +
  • (Apache License, Version 2.0) Lucene QueryParsers (org.apache.lucene:lucene-queryparser:8.11.3 - https://lucene.apache.org/lucene-parent/lucene-queryparser)
  • +
  • (Apache License, Version 2.0) Lucene Sandbox (org.apache.lucene:lucene-sandbox:8.11.3 - https://lucene.apache.org/lucene-parent/lucene-sandbox)
  • (The Apache Software License, Version 2.0) Maven Aether Provider (org.apache.maven:maven-aether-provider:3.0 - http://maven.apache.org/maven-aether-provider/)
  • -
  • (Apache-2.0) Maven 4 API Meta annotations (org.apache.maven:maven-api-meta:4.0.0-alpha-7 - https://maven.apache.org/ref/4.0.0-alpha-7/api/maven-api-meta/)
  • -
  • (Apache-2.0) Maven 4 API XML (org.apache.maven:maven-api-xml:4.0.0-alpha-7 - https://maven.apache.org/ref/4.0.0-alpha-7/api/maven-api-xml/)
  • +
  • (Apache-2.0) Maven 4 API :: Meta annotations (org.apache.maven:maven-api-meta:4.0.0-alpha-9 - https://maven.apache.org/ref/4.0.0-alpha-9/api/maven-api-meta/)
  • +
  • (Apache-2.0) Maven 4 API :: XML (org.apache.maven:maven-api-xml:4.0.0-alpha-9 - https://maven.apache.org/ref/4.0.0-alpha-9/api/maven-api-xml/)
  • (The Apache Software License, Version 2.0) Maven Artifact (org.apache.maven:maven-artifact:3.0 - http://maven.apache.org/maven-artifact/)
  • (The Apache Software License, Version 2.0) Maven Core (org.apache.maven:maven-core:3.0 - http://maven.apache.org/maven-core/)
  • (The Apache Software License, Version 2.0) Maven Model (org.apache.maven:maven-model:3.0 - http://maven.apache.org/maven-model/)
  • @@ -238,7 +238,7 @@
  • (The Apache Software License, Version 2.0) Maven Repository Metadata Model (org.apache.maven:maven-repository-metadata:3.0 - http://maven.apache.org/maven-repository-metadata/)
  • (The Apache Software License, Version 2.0) Maven Settings (org.apache.maven:maven-settings:3.0 - http://maven.apache.org/maven-settings/)
  • (The Apache Software License, Version 2.0) Maven Settings Builder (org.apache.maven:maven-settings-builder:3.0 - http://maven.apache.org/maven-settings-builder/)
  • -
  • (Apache-2.0) Implementation of Maven API XML (org.apache.maven:maven-xml-impl:4.0.0-alpha-7 - https://maven.apache.org/ref/4.0.0-alpha-7/maven-xml-impl/)
  • +
  • (Apache-2.0) Implementation of Maven API XML (org.apache.maven:maven-xml-impl:4.0.0-alpha-9 - https://maven.apache.org/ref/4.0.0-alpha-9/maven-xml-impl/)
  • (Apache License, Version 2.0) Doxia :: Logging API (org.apache.maven.doxia:doxia-logging-api:1.11.1 - https://maven.apache.org/doxia/doxia/doxia-logging-api/)
  • (Apache License, Version 2.0) Doxia :: Sink API (org.apache.maven.doxia:doxia-sink-api:1.11.1 - https://maven.apache.org/doxia/doxia/doxia-sink-api/)
  • (Apache License, Version 2.0) Apache Maven Reporting API (org.apache.maven.reporting:maven-reporting-api:3.1.1 - https://maven.apache.org/shared/maven-reporting-api/)
  • @@ -264,8 +264,8 @@
  • (The Apache Software License, Version 2.0) Plexus Classworlds (org.codehaus.plexus:plexus-classworlds:2.2.3 - http://plexus.codehaus.org/plexus-classworlds/)
  • (Apache License, Version 2.0) Plexus :: Component Annotations (org.codehaus.plexus:plexus-component-annotations:2.0.0 - http://codehaus-plexus.github.io/plexus-containers/plexus-component-annotations/)
  • (The Apache Software License, Version 2.0) Plexus Interpolation API (org.codehaus.plexus:plexus-interpolation:1.14 - http://plexus.codehaus.org/plexus-components/plexus-interpolation)
  • -
  • (Apache License, Version 2.0) Plexus Common Utilities (org.codehaus.plexus:plexus-utils:4.0.0 - https://codehaus-plexus.github.io/plexus-pom/plexus-utils/)
  • -
  • (Apache License, Version 2.0) Plexus XML Utilities (org.codehaus.plexus:plexus-xml:4.0.2 - https://codehaus-plexus.github.io/plexus-xml/)
  • +
  • (Apache License, Version 2.0) Plexus Common Utilities (org.codehaus.plexus:plexus-utils:4.0.1 - https://codehaus-plexus.github.io/plexus-utils/)
  • +
  • (Apache License, Version 2.0) Plexus XML Utilities (org.codehaus.plexus:plexus-xml:4.0.3 - https://codehaus-plexus.github.io/plexus-xml/)
  • (The BSD License) Stax2 API (org.codehaus.woodstox:stax2-api:4.2.1 - http://github.com/FasterXML/stax2-api)
  • (Apache 2) org.conscrypt:conscrypt-openjdk-uber (org.conscrypt:conscrypt-openjdk-uber:2.5.2 - https://conscrypt.org/)
  • (Apache-2.0) CycloneDX Core (Java) (org.cyclonedx:cyclonedx-core-java:8.0.3 - https://github.com/CycloneDX/cyclonedx-core-java)
  • @@ -283,12 +283,12 @@
  • (EPL) Dirgra (org.jruby:dirgra:0.3 - https://github.com/jruby/dirgra)
  • (EPL-2.0) (GPL-2.0) (LGPL-2.1) JRuby Main Maven Artifact (org.jruby:jruby:9.4.6.0 - https://github.com/jruby/jruby/jruby-artifacts/jruby)
  • (EPL-2.0) (GPL-2.0) (LGPL-2.1) JRuby Base (org.jruby:jruby-base:9.4.6.0 - https://github.com/jruby/jruby/jruby-base)
  • -
  • (EPL-2.0) (GPL-2.0) (LGPL-2.1) JRuby Complete (org.jruby:jruby-complete:9.4.6.0 - https://github.com/jruby/jruby/jruby-artifacts/jruby-complete)
  • +
  • (EPL-2.0) (GPL-2.0) (LGPL-2.1) JRuby Complete (org.jruby:jruby-complete:9.4.7.0 - https://github.com/jruby/jruby/jruby-artifacts/jruby-complete)
  • (EPL-2.0) (GPL-2.0) (LGPL-2.1) JRuby Lib Setup (org.jruby:jruby-stdlib:9.4.6.0 - https://github.com/jruby/jruby/jruby-stdlib)
  • (BSD) JZlib (org.jruby:jzlib:1.1.5 - http://www.jcraft.com/jzlib/)
  • (MIT License) JCodings (org.jruby.jcodings:jcodings:1.0.58 - http://nexus.sonatype.org/oss-repository-hosting.html/jcodings)
  • (MIT License) Joni (org.jruby.joni:joni:2.2.1 - http://nexus.sonatype.org/oss-repository-hosting.html/joni)
  • -
  • (The MIT License) jsoup Java HTML Parser (org.jsoup:jsoup:1.16.2 - https://jsoup.org/)
  • +
  • (The MIT License) jsoup Java HTML Parser (org.jsoup:jsoup:1.17.2 - https://jsoup.org/)
  • (Public Domain, per Creative Commons CC0) LatencyUtils (org.latencyutils:LatencyUtils:2.0.3 - http://latencyutils.github.io/LatencyUtils/)
  • (Apache License, Version 2.0) KeePassJava2 :: All (org.linguafranca.pwdb:KeePassJava2:2.2.1 - https://github.com/jorabin/KeePassJava2/KeePassJava2)
  • (Apache License, Version 2.0) KeePassJava2 :: DOM (org.linguafranca.pwdb:KeePassJava2-dom:2.2.1 - https://github.com/jorabin/KeePassJava2/KeePassJava2-dom)
  • @@ -302,12 +302,12 @@
  • (BSD-3-Clause) asm-commons (org.ow2.asm:asm-commons:9.2 - http://asm.ow2.io/)
  • (BSD-3-Clause) asm-tree (org.ow2.asm:asm-tree:9.2 - http://asm.ow2.io/)
  • (BSD-3-Clause) asm-util (org.ow2.asm:asm-util:9.2 - http://asm.ow2.io/)
  • -
  • (The Apache Software License, Version 2.0) Dependency-Check Core (org.owasp:dependency-check-core:9.0.10 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-core)
  • -
  • (The Apache Software License, Version 2.0) Dependency-Check Maven Plugin (org.owasp:dependency-check-maven:9.0.10 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-maven)
  • -
  • (The Apache Software License, Version 2.0) Dependency-Check Utils (org.owasp:dependency-check-utils:9.0.10 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-utils)
  • +
  • (The Apache Software License, Version 2.0) Dependency-Check Core (org.owasp:dependency-check-core:9.2.0 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-core)
  • +
  • (The Apache Software License, Version 2.0) Dependency-Check Maven Plugin (org.owasp:dependency-check-maven:9.2.0 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-maven)
  • +
  • (The Apache Software License, Version 2.0) Dependency-Check Utils (org.owasp:dependency-check-utils:9.2.0 - https://github.com/jeremylong/DependencyCheck.git/dependency-check-utils)
  • (The MIT License) Project Lombok (org.projectlombok:lombok:1.18.32 - https://projectlombok.org)
  • (MIT-0) reactive-streams (org.reactivestreams:reactive-streams:1.0.4 - http://www.reactive-streams.org/)
  • -
  • (The MIT License) semver4j (org.semver4j:semver4j:5.2.2 - https://github.com/semver4j/semver4j)
  • +
  • (The MIT License) semver4j (org.semver4j:semver4j:5.3.0 - https://github.com/semver4j/semver4j)
  • (Apache License, Version 2.0) JCL 1.2 implemented over SLF4J (org.slf4j:jcl-over-slf4j:2.0.13 - http://www.slf4j.org)
  • (MIT License) JUL to SLF4J bridge (org.slf4j:jul-to-slf4j:2.0.13 - http://www.slf4j.org)
  • (MIT License) SLF4J API Module (org.slf4j:slf4j-api:2.0.13 - http://www.slf4j.org)
  • @@ -370,33 +370,33 @@
  • (BSD 2-Clause) github-buttons (org.webjars.npm:github-buttons:2.14.1 - https://www.webjars.org)
  • (Common Public 1.0) pecoff4j (org.whitesource:pecoff4j:0.0.2.1 - https://github.com/whitesource/pecoff4j-maven)
  • (Apache License, Version 2.0) SnakeYAML (org.yaml:snakeyaml:2.2 - https://bitbucket.org/snakeyaml/snakeyaml)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Annotations (software.amazon.awssdk:annotations:2.25.40 - https://aws.amazon.com/sdkforjava/core/annotations)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Clients :: Apache (software.amazon.awssdk:apache-client:2.25.40 - https://aws.amazon.com/sdkforjava/http-clients/apache-client)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Auth (software.amazon.awssdk:auth:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: AWS Core (software.amazon.awssdk:aws-core:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: AWS Json Protocol (software.amazon.awssdk:aws-json-protocol:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: AWS Query Protocol (software.amazon.awssdk:aws-query-protocol:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Checksums (software.amazon.awssdk:checksums:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Checksums SPI (software.amazon.awssdk:checksums-spi:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Endpoints SPI (software.amazon.awssdk:endpoints-spi:2.25.40 - https://aws.amazon.com/sdkforjava/core/endpoints-spi)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth (software.amazon.awssdk:http-auth:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth AWS (software.amazon.awssdk:http-auth-aws:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth SPI (software.amazon.awssdk:http-auth-spi:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Client Interface (software.amazon.awssdk:http-client-spi:2.25.40 - https://aws.amazon.com/sdkforjava/http-client-spi)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Identity SPI (software.amazon.awssdk:identity-spi:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: Json Utils (software.amazon.awssdk:json-utils:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Metrics SPI (software.amazon.awssdk:metrics-spi:2.25.40 - https://aws.amazon.com/sdkforjava/core/metrics-spi)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Clients :: Netty Non-Blocking I/O (software.amazon.awssdk:netty-nio-client:2.25.40 - https://aws.amazon.com/sdkforjava/http-clients/netty-nio-client)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Profiles (software.amazon.awssdk:profiles:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: Protocol Core (software.amazon.awssdk:protocol-core:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Regions (software.amazon.awssdk:regions:2.25.40 - https://aws.amazon.com/sdkforjava/core/regions)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: SDK Core (software.amazon.awssdk:sdk-core:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Services :: AWS Simple Systems Management (SSM) (software.amazon.awssdk:ssm:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Services :: AWS STS (software.amazon.awssdk:sts:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Third Party :: Jackson-core (software.amazon.awssdk:third-party-jackson-core:2.25.40 - https://aws.amazon.com/sdkforjava)
  • -
  • (Apache License, Version 2.0) AWS Java SDK :: Utilities (software.amazon.awssdk:utils:2.25.40 - https://aws.amazon.com/sdkforjava/utils)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Annotations (software.amazon.awssdk:annotations:2.25.42 - https://aws.amazon.com/sdkforjava/core/annotations)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Clients :: Apache (software.amazon.awssdk:apache-client:2.25.42 - https://aws.amazon.com/sdkforjava/http-clients/apache-client)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Auth (software.amazon.awssdk:auth:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: AWS Core (software.amazon.awssdk:aws-core:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: AWS Json Protocol (software.amazon.awssdk:aws-json-protocol:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: AWS Query Protocol (software.amazon.awssdk:aws-query-protocol:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Checksums (software.amazon.awssdk:checksums:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Checksums SPI (software.amazon.awssdk:checksums-spi:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Endpoints SPI (software.amazon.awssdk:endpoints-spi:2.25.42 - https://aws.amazon.com/sdkforjava/core/endpoints-spi)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth (software.amazon.awssdk:http-auth:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth AWS (software.amazon.awssdk:http-auth-aws:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Auth SPI (software.amazon.awssdk:http-auth-spi:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Client Interface (software.amazon.awssdk:http-client-spi:2.25.42 - https://aws.amazon.com/sdkforjava/http-client-spi)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Identity SPI (software.amazon.awssdk:identity-spi:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: Json Utils (software.amazon.awssdk:json-utils:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Metrics SPI (software.amazon.awssdk:metrics-spi:2.25.42 - https://aws.amazon.com/sdkforjava/core/metrics-spi)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: HTTP Clients :: Netty Non-Blocking I/O (software.amazon.awssdk:netty-nio-client:2.25.42 - https://aws.amazon.com/sdkforjava/http-clients/netty-nio-client)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Profiles (software.amazon.awssdk:profiles:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Core :: Protocols :: Protocol Core (software.amazon.awssdk:protocol-core:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Regions (software.amazon.awssdk:regions:2.25.42 - https://aws.amazon.com/sdkforjava/core/regions)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: SDK Core (software.amazon.awssdk:sdk-core:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Services :: AWS Simple Systems Management (SSM) (software.amazon.awssdk:ssm:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Services :: AWS STS (software.amazon.awssdk:sts:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Third Party :: Jackson-core (software.amazon.awssdk:third-party-jackson-core:2.25.42 - https://aws.amazon.com/sdkforjava)
  • +
  • (Apache License, Version 2.0) AWS Java SDK :: Utilities (software.amazon.awssdk:utils:2.25.42 - https://aws.amazon.com/sdkforjava/utils)
  • (Apache License, Version 2.0) AWS Event Stream (software.amazon.eventstream:eventstream:1.0.1 - https://github.com/awslabs/aws-eventstream-java)
  • -
  • (Apache-2.0) CPE Parser (us.springett:cpe-parser:2.0.3 - https://github.com/stevespringett/CPE-Parser)
  • +
  • (Apache-2.0) CPE Parser (us.springett:cpe-parser:2.1.0 - https://github.com/stevespringett/CPE-Parser)
  • diff --git a/src/main/resources/wrong-secrets-configuration.yaml b/src/main/resources/wrong-secrets-configuration.yaml index 5a14335680..5c399cf652 100644 --- a/src/main/resources/wrong-secrets-configuration.yaml +++ b/src/main/resources/wrong-secrets-configuration.yaml @@ -752,3 +752,17 @@ configurations: ctf: enabled: true missing_environment: "explanations/missing_vault.adoc" + + - name: Challenge 47 + short-name: "challenge-47" + sources: + - class-name: "org.owasp.wrongsecrets.challenges.kubernetes.Challenge47" + explanation: "explanations/challenge47.adoc" + hint: "explanations/challenge47_hint.adoc" + reason: "explanations/challenge47_reason.adoc" + environments: [ *k8s_vault, *gcp, *aws, *azure ] + difficulty: *normal + category: *vault + ctf: + enabled: true + missing_environment: "explanations/missing_vault.adoc" diff --git a/src/test/K8s-tests/cypress/e2e/Challenge47Test.cy.js b/src/test/K8s-tests/cypress/e2e/Challenge47Test.cy.js new file mode 100644 index 0000000000..cb7c5ecf49 --- /dev/null +++ b/src/test/K8s-tests/cypress/e2e/Challenge47Test.cy.js @@ -0,0 +1,28 @@ +describe('Challenge47 Tests', () => { + it('Submitting a Correct Answer', () => { + // Visit the spoiler page and extract the spoiler + cy.visit('/spoil/challenge-47') + cy.get('[data-cy=spoiler-answer]').invoke('text').then(spoilerAnswer => { + // Asserting that the spoiler is not a default value + expect(spoilerAnswer.trim()).to.not.equal('if_you_see_this_please_use_K8S_and_Vault') + expect(spoilerAnswer.trim()).to.not.be.empty + + // Visit the challenge page and submit the spoiler as the answer + cy.visit('/challenge/challenge-47') + cy.get('#answerfield').type(spoilerAnswer.trim()) + cy.get('[data-cy=submit-textbox-btn]').click() + cy.get('[data-cy=success-alert]').should('contain', 'correct') + }) + }) + + it('Submitting an Incorrect Answer', () => { + cy.visit('/challenge/challenge-47') + + // Use a known incorrect answer + cy.get('#answerfield').type('definitely_wrong_answer') + cy.get('[data-cy=submit-textbox-btn]').click() + + // Check for incorrect alert + cy.get('[data-cy=incorrect-alert]').should('contain', 'incorrect') + }) +}) diff --git a/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/Challenge47Test.java b/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/Challenge47Test.java new file mode 100644 index 0000000000..c7acc79e50 --- /dev/null +++ b/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/Challenge47Test.java @@ -0,0 +1,21 @@ +package org.owasp.wrongsecrets.challenges.kubernetes; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; + +public class Challenge47Test { + + @Test + void spoilerShouldGiveAnswer() { + var challenge = new Challenge47("answer"); + assertThat(challenge.spoiler().solution()).isEqualTo("answer"); + assertThat(challenge.answerCorrect(challenge.spoiler().solution())).isTrue(); + } + + @Test + void incorrectAnswerShouldNotSolveChallenge() { + var challenge = new Challenge47("answer"); + assertThat(challenge.answerCorrect("wrong answer")).isFalse(); + } +} diff --git a/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/ChallengesControllerWithPresetKubernetesValuesTest.java b/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/ChallengesControllerWithPresetKubernetesValuesTest.java index d79e2bb556..a86bccfe6c 100644 --- a/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/ChallengesControllerWithPresetKubernetesValuesTest.java +++ b/src/test/java/org/owasp/wrongsecrets/challenges/kubernetes/ChallengesControllerWithPresetKubernetesValuesTest.java @@ -57,7 +57,8 @@ void shouldNotShowDisabledChallengeAnywhere() throws Exception { || shortname.contains("11") || shortname.contains("44") || shortname.contains("45") - || shortname.contains("46")) { + || shortname.contains("46") + || shortname.contains("47")) { continue; } mvc.perform(get("/challenge/%s".formatted(challenge.name().shortName())))