-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it necessary to run it as root? #52
Comments
All what runs as root should supervisor and master processes since #48 has been merged (processes are started as root, but setuid to unprivileged users). The PHP could be probably started as not privileged user directly, I will give it a try. The nginx has to start as root for binding port 80. The discussion on used port has been in #18, so feel free to continue there if you have something to add to it. |
Thanks for the explanation and putting efforts into this. Thanks |
Now even PHP FPM master process is run as nobody (#53). You mean chown to root:root? I thought that's implicit in Docker, but I might be wrong... |
Here: https://github.com/phpmyadmin/docker/blob/master/Dockerfile
|
Issue #52 Signed-off-by: Michal Čihař <[email protected]>
All future phpMyAdmin tarballs will be root:root, see phpmyadmin/phpmyadmin#12560, but it's probably still good idea to change it like this. |
Greetings,
I just needed phpmyadmin for one of our projects and I looked into the image and I don't understand a couple of concepts here.
1.) Why does anything in this image run as root (tried both latest and 4.6.4-1 from docker hub and although they are different both run php processes as root).
2.) Let's presume this is changed and the processes in the container are ran as UID 1000, in that case why is the /www/ directory writable by user 1000.
I think running web applications as root even in a docker container is very insecure as it highly increases the attack surface despite not being as bad as running them on the host.
Also it is I think a common best practice in web operation to make sure that an application is not able to write it's own code.
I don't think there is any need in the docker world to run things on privileged ports like 80 so I don't think that should prevent the process to be ran as a non root user that is not able to write anything except what it needs to.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: