Re:Dockerfile Security Best Practices
by Propaganda_ on Wednesday October 14, 2020 @06:29PM
(#24782458)
If the services can't be modified to load their config directly from env vars, write the config to an off-root scratch volume (e.g. mounted to /tmp/) and have them load from that. The root volume should be mounted read-only either way to prevent modification of your services should something get RCE.
If you control the services, make them read from user-writable files instead of root ones. (Ideally you could skip the middleman and just read from env vars directly!)
If you don't control the services, maybe in the Dockerfile you could write a dummy config file and chmod it?
Re:Dockerfile Security Best Practices
by CGamesPlay on Wednesday October 14, 2020 @08:26PM
(#24783402)
[deleted] this idea doesn't work on attempting
My current strategy is to let the container entrypoint start as root, but then I have a wrapper program installed that drops privileges before it exec()s the actual service. It works, but is there a better / more accepted way of doing this?