benrubson commented on a change in pull request #469: GUACAMOLE-890: Security: 
Allow image to run as non-root user
URL: https://github.com/apache/guacamole-client/pull/469#discussion_r373101606
 
 

 ##########
 File path: Dockerfile
 ##########
 @@ -56,6 +56,14 @@ WORKDIR /opt/guacamole
 # Copy artifacts from builder image into this image
 COPY --from=builder /opt/guacamole/ .
 
+# Turn on the Remote IP Valve
+RUN sed -i 's+^\(      </Host>\)+        <Valve 
className="org.apache.catalina.valves.RemoteIpValve" />\n\1+' 
/usr/local/tomcat/conf/server.xml
+
+# Allow image to run as non-root user
+RUN sed -i 's/unpackWARs="true"/unpackWARs="false"/' 
/usr/local/tomcat/conf/server.xml
+RUN chmod 777 /usr/local/tomcat/temp
 
 Review comment:
   Thank you @mike-jumper for your great review.
   I think you talk here about the temp directory permissions.
   I though rather strange that, by default, `temp` directory was not 
world-writable.
   For sure, being non-writable by non-root user prevents the non-unpacked app 
to start.
   We could workaround this by setting the runtime `CATALINA_TMPDIR` env var to 
another writable dir, `/tmp` for instance. Let me then know if you think we 
could get rid of this chmod command.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to