Skip to content

feat(docker): introduce Java 26 dev/build container and build-secret challenge - #2650

Open
sandeshkuldharme1 wants to merge 5 commits into
OWASP:masterfrom
sandeshkuldharme1:feat/jdk22-build-container
Open

feat(docker): introduce Java 26 dev/build container and build-secret challenge#2650
sandeshkuldharme1 wants to merge 5 commits into
OWASP:masterfrom
sandeshkuldharme1:feat/jdk22-build-container

Conversation

@sandeshkuldharme1

Copy link
Copy Markdown

This PR introduces a standardized JDK 22 development/build container bundling wrongsecrets-binaries, and adds a new challenge demonstrating secret leakage in build container layers and intermediate stages.

Motivation

  • Environment Parity: Standardizes the build environment using JDK 22 and wrongsecrets-binaries, preventing local JDK version mismatches across contributor machines.
  • Security Education: Illustrates risks of passing sensitive credentials via ARG or intermediate build layers in multi-stage Docker builds.

Proposed Changes

  • Dev Container: Added .devcontainer/devcontainer.json configured with JDK 22 and docker-in-docker.
  • New Challenge: Created ChallengeBuildContainer.java under Docker challenges.
  • Unit Tests: Added unit tests in ChallengeBuildContainerTest.java.
  • Educational Content: Added challenge_build_container.html with remediation guidance.

Testing Done

  • Unit tests passed with ./mvnw clean test
  • Container image built and verified locally

Checklist

  • My code follows the project's style guidelines.
  • I have performed a self-review of my code.
  • I have added unit tests.

Comment thread .devcontainer/devcontainer.json Outdated
@@ -0,0 +1,18 @@
{
"name": "OWASP WrongSecrets Dev Container (JDK 22)",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this java26?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to Java 26 (eclipse-temurin:26-jdk-jammy)! Thanks for the review.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add node js26 as well please?

]
}
},
"remoteUser": "root"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sandeshkuldharme1 ! I think we are missing a few components voor a devcontainer yet. Can you add those please?

@sandeshkuldharme1 sandeshkuldharme1 changed the title feat(docker): introduce JDK 22 build container and challenge feat(docker): introduce Java 26 dev/build container and build-secret challenge Sep 7, 2026
@sandeshkuldharme1

Copy link
Copy Markdown
Author

Hi @commjoen, I've updated the devcontainer to Java 26 (eclipse-temurin:26-jdk-jammy), added the missing components (forwarded ports, docker-in-docker, Maven postCreate setup), and fixed the UTF-8 BOM encoding issue. Thanks!

@commjoen

commjoen commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

just to make sure: how can we now use the devcontainer to build the app completely :) ?

@sandeshkuldharme1

Copy link
Copy Markdown
Author

Hi @commjoen,

Here is how you can use the Dev Container to build and run the entire application completely:

1. Open in Dev Container

  • In VS Code: Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) $\rightarrow$ select "Dev Containers: Reopen in Container" (or click the green prompt in the bottom-left corner).
  • In GitHub Codespaces: Select Code $\rightarrow$ Codespaces $\rightarrow$ Create codespace on this branch.

(The container will automatically set up Java, Docker-in-Docker, forwarded ports, and run the Maven setup).

2. Build the Complete App

Inside the integrated Dev Container terminal, run:

./mvnw clean install

@commjoen

commjoen commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Hi @commjoen,

Here is how you can use the Dev Container to build and run the entire application completely:

1. Open in Dev Container

  • In VS Code: Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)

    select "Dev Containers: Reopen in Container" (or click the green prompt in the bottom-left corner).
  • In GitHub Codespaces: Select Code

    Codespaces

    Create codespace on this branch.

(The container will automatically set up Java, Docker-in-Docker, forwarded ports, and run the Maven setup).

2. Build the Complete App

Inside the integrated Dev Container terminal, run:

./mvnw clean install

Can you add this to the contributing.md please?


/** Challenge for finding secrets leaked in build container layers. */
@Component
public class ChallengeBuildContainer extends Challenge {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a few more components are missing for a challenge. Can you please have a look at the other challenges to make it complete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants