Skip to content

Commit

Permalink
Run insecureinc as www-data
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-ion committed Mar 17, 2024
1 parent ae1d553 commit 0e9b22e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion insecureinc/Dockerfile.insecureinc
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ RUN rm -rf /var/lib/apt/lists/* && \
RUN rm -rf /usr/local/tomcat/webapps/ROOT
# Copying insecure-inc-1.0.war from the build_image phase, rest everyting from last phase is discarded
COPY --from=build_image /insecureinc/target/insecure-inc-1.0.war /usr/local/tomcat/webapps/ROOT.war
EXPOSE 8080
COPY start-insecureinc.sh /usr/local/tomcat/start-insecureinc.sh
RUN chmod +x /usr/local/tomcat/start-insecureinc.sh
RUN chown -R www-data:www-data /usr/local/tomcat/logs
RUN chown -R www-data:www-data /usr/local/tomcat/webapps
RUN chown -R www-data:www-data /usr/local/tomcat/work

EXPOSE 8080
ENTRYPOINT ["/bin/bash","-c","/usr/local/tomcat/start-insecureinc.sh" ]
2 changes: 2 additions & 0 deletions insecureinc/start-insecureinc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export JAVA_OPTS="-DCHALLENGE_MASTER_SALT=$CHALLENGE_MASTER_SALT"
su - www-data -s /bin/bash -c '/usr/local/tomcat/bin/catalina.sh run' -w JAVA_HOME,JAVA_OPTS

0 comments on commit 0e9b22e

Please sign in to comment.