stop running as root in container #870
Replies: 2 comments 1 reply
-
Where did you see that? By default it runs as unit:root, that is the user unit and as part of the root group. netbox-docker/docker-compose.yml Line 11 in 3f1e45f If you are talking about running the image standalone, it will run the ENTRYPOINT as whatever user you instruct it to run as.
Ignoring the initial faulty assumption, I believe the reason that the default group is root, is to ease the use of host mounts.
nginx is not used. Nginx unit is used as an application server, but it doesn't run as root. It also doesn't run on port 80. Where did that assumption come from? https://github.com/netbox-community/netbox-docker/blob/release/docker/nginx-unit.json#L3
It already binds to port 8080 inside the container.
It's getting redundant, but it is running as a normal user.
While true in some cases, there are ways to run root in docker containers without the security implications. Docker Rootless, podman (rootless by default), user namespaces etc. Do you have any concrete changes you want to suggest that are not possible to manage with a docker-override? |
Beta Was this translation helpful? Give feedback.
-
Hi @kkthxbye-code , thanks for your quick reply. So about root, if you run docker run without specifying any user you will get it running as root. ➜ docker run -it docker.io/netboxcommunity/netbox:latest id
uid=0(root) gid=0(root) groups=0(root) My plan is to run netbox in kubernetes and yes you can define a specific user but the risk is of course that people don't. Since the entrypoint script is obliviously maid to run with the user I think Line 87 in 3f1e45f I'm happy to create the PR. I understand that I could do my own docker override but then I would have to manage my own image and that is far from ideal. I tried to find how to build the Dockerfile but was unable to do so since I have to define the FROM argument.
|
Beta Was this translation helpful? Give feedback.
-
Hi
I'm new to the netbox community but I have gotten a request to run it for a customer.
I took a quick look around and I notice that the container is running as root. Is there any reason behind this?
Is it due to that you are running nginx on port 80?
If so would it be interesting for the community to move to port 8080?
Is there any other obvious blocker why we cant run as a normal user?
Running as root in a container system is really really dangerous.
Depending on requirements me or a colleague might be able to help out with this if it's a feature that you would like.
Beta Was this translation helpful? Give feedback.
All reactions