-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Feature Request] Run process as non-root. #403
Comments
Try this configuration file, it does not require the /var/run/docker.sock file, which means no high permissions are required, but docker itself requires root. https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface I think the following knowledge needs to be reserved before using this image: docker, docker network, docker compose, zookeeper, kafka, network operating system.
|
My interpretation of the question is that this is regarding the Kafka process inside the container, not the privileges of the docker command. |
This is not necessary unless there is a vulnerability in the Linux Kernel namespaces that causes the program inside the container to control the external program. If you are concerned, please check it out: https://docs.docker.com/engine/security/security/ But not allowing the |
@barrer thanks for the input. As i'm sure you are aware, Kafka is a non-trivial piece of infrastructure to run in a production environment - it is expected that the operator understands the environment, the configuration mechanisms and risks associated with them. As documented in the FAQ, mounting the socket is not required. This image purely provides a wrapper around the Kafka binary, it is the responsibility of the operator to configure it in an appropriate way for their use-case and environment. The reason this has not been actioned, is that the operator can use the |
@sscaling in kubernetes for example when setting the
which is:
with the perms of:
|
If I may chime in here, I think it is in general a good practice to have a fixed non-root user inside the container and always run with that, and also to set permissions accordingly. The only difficulty is then to also use this with persistent data, i.e. the permissions have to be right. Would a PR be welcome? |
@sdressler you saw this theme? confluentinc/cp-helm-charts#173 And bitnami version of kafka? |
@Asgoret I did, but I don't get the point, I'm afraid. I wanted to use Kafka on Rancher and they actually have the bitnami version but it does not spin up completely, hence I looked for alternatives and came here. Don't mind running as root much, but wanted to offer help. |
@sdressler Oh) I tried to help with non-root start. If you already do this it's great) |
@Asgoret please go ahead, I won't have time in near future ;-) |
I managed to do accomplish this as follows.
Next, I extended the dockerfile like this:
Kafka now runs as PID 1 under the kafka user. |
Is there any news with this? I've hit the same wall. using |
I would argue that it allows you to share the same base images, thus saving on storage costs of the servers running Docker. @Lukkie That is a nice extension, but that entrypoint is going to run at every start of the container, so why not chown and adduser within the Dockerfile? |
same issue |
edit: (original title) Ability to set/map externally visible uid?
Hello,
I'd like to ask for some advice, help or maybe even file this as a request for enhancement. Currently the docker container creates files and runs as root. We'd like to run it as a non-privileged user, if it's possible.
Thank you!
The text was updated successfully, but these errors were encountered: