Skip to content

Commit

Permalink
Fix for secret path mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
commjoen committed Feb 2, 2025
1 parent 724228e commit ca088a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN mkdir -p /app
# Use a separate RUN command for --mount
RUN --mount=type=secret,id=mysecret \
export SECRET_VALUE=$(cat /run/secrets/mysecret) && \
echo $SECRET_VALUE >> /app/secret.txt
echo $SECRET_VALUE >> /var/run/secrets2/secret.txt

COPY --chown=wrongsecrets .github/scripts/ /var/tmp/helpers
COPY --chown=wrongsecrets .github/scripts/.bash_history /home/wrongsecrets/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.owasp</groupId>
<artifactId>wrongsecrets</artifactId>
<version>1.10.2-SNAPSHOT</version>
<version>local-test-SNAPSHOT</version>

<name>OWASP WrongSecrets</name>
<description>Examples with how to not use secrets</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Challenge52 extends FixedAnswerChallenge {
private static final Logger log = LoggerFactory.getLogger(Challenge52.class);
private final String dockerMountsecret;

public Challenge52(@Value("$challengedockermtsecret") String dockerMountsecret) {
public Challenge52(@Value("${chalenge_docker_mount_secret}") String dockerMountsecret) {
this.dockerMountsecret = dockerMountsecret;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ management.endpoint.health.probes.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
management.endpoints.web.exposure.include=auditevents,info,health
challengedockermtsecret=/app
chalenge_docker_mount_secret=/var/run/secrets2
#---
spring.config.activate.on-profile=kubernetes-vault
wrongsecretvalue=wrongsecret
Expand Down

0 comments on commit ca088a2

Please sign in to comment.