wrongsecrets icon indicating copy to clipboard operation
wrongsecrets copied to clipboard

Sealed Secret in Kubernetes Challenge

Open Shubham-Patel07 opened this issue 1 year ago • 8 comments

What kind of changes does this PR include?

  • [ ] Fixes or refactors
  • [x] A new challenge
  • [ ] Additional documentation
  • [ ] Something else

Relation

Fixes part of https://github.com/OWASP/wrongsecrets/issues/858

Description

Added new challenge Related to Bitnami Sealed Secrets

Checklist:

  • [x] All the contributions made are solely the work of me and my co-authors
  • [ ] I tested the changes in this PR (if applicable)
  • [ ] I added unit tests to ensure my change works (when change in Java or on front-end code)
  • [ ] I added UI tests to ensure my UI changes work (when change in the overall UI, not needed if just adding a challenge)
  • [ ] The PR passes pre-commit hooks and automated tests

Shubham-Patel07 avatar Jun 21 '24 16:06 Shubham-Patel07

@commjoen Please Guide me further in which File i need to mention ACTUAL_ANSWER_CHALLENGE48 variable What are the further things i need to figure out

Shubham-Patel07 avatar Jun 21 '24 16:06 Shubham-Patel07

Great start! let's go to the next steps!

  1. would you please write the challenge texts common tests and add a challenge configuration as in https://github.com/OWASP/wrongsecrets/blob/master/CONTRIBUTING.md#how-to-add-a-challenge. ?
  2. the SEALED_SECRET_ANSWER needs to be the env-var in https://github.com/OWASP/wrongsecrets/pull/1452/files#diff-3295830e52e2c56ac68ea925b7cc6ec7892a1b4f8401c27ff14345ef4a0129a2R9 so it will override the application.properties value.
  3. last but not least: can you extend the end2end tests in https://github.com/OWASP/wrongsecrets/tree/master/src/test/K8s-tests/cypress/e2e please? it needs to check whether your challenge shows the default value you gave it here in application.properties, or actually shows the data you defined in the sealed secret (so the test only needs to check that the appliction.properties value is not present in /spoil/ for your challenge.

commjoen avatar Jun 21 '24 16:06 commjoen

So i did what you said sir @commjoen , but still the challenge is not visible when i run using k8s-vault-minikubw-start.sh What else i need to figure out

Shubham-Patel07 avatar Jun 22 '24 10:06 Shubham-Patel07

We will have to build a new container to show it in k8s. I can do that tomorrow. If you run it locally: is the challenge then visible?

commjoen avatar Jun 22 '24 10:06 commjoen

Hi @commjoen I abruptly faced this error and not able to troubleshoot it

image

I even tried to run mvn clean install and got this error

image

these occurred so abruptly, even without changing anything

Shubham-Patel07 avatar Jun 22 '24 16:06 Shubham-Patel07

Hi @commjoen

I abruptly faced this error and not able to troubleshoot it

image

I even tried to run mvn clean install and got this error

image

these occurred so abruptly, even without changing anything

It looks like you have the wrong JDK version: can you upgrade to the latest please?🙏

commjoen avatar Jun 22 '24 16:06 commjoen

Hi @commjoen I abruptly faced this error and not able to troubleshoot it image I even tried to run mvn clean install and got this error image these occurred so abruptly, even without changing anything

It looks like you have the wrong JDK version: can you upgrade to the latest please?🙏

image

im using latest openJDK 22 version

Shubham-Patel07 avatar Jun 22 '24 16:06 Shubham-Patel07

The javacode is fixed, now all we need is the correct override of the env var SEALED_SECRET_ANSWER by means of the sealed secret. Alternatively we can make the javacode load a file injected by the controler (CC @bendehaan). Once this is done there are a few items left, let's enumerate them here:

  • [x] get sealed secret exposed in java (See above)
  • [ ] review all the texts
  • [x] create e2e tests for this challenge in https://github.com/OWASP/wrongsecrets/tree/master/src/test/K8s-tests/cypress/e2e
  • [ ] create unit test for the challenge
  • [x] update k8s definitions for the cloud providers and test them over there.\
  • [x] update k8s instructions to load the cluster without vault

commjoen avatar Jun 25 '24 07:06 commjoen