-
Notifications
You must be signed in to change notification settings - Fork 427
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
Copy ssl cert/key/cafile and configure permissions on startup #59
Comments
It just needs to be readable by the |
@yosifkit That isn't so simple when the certificates are passed into the container as a volume. Since the permissions are set on the host system without any knowledge of the container. I think it would be simpler to handle this in the entrypoint script wouldn't it? |
might be related to #66 ? |
Sorry for the delay here -- I'm honestly not sure how we can even help here. If RabbitMQ can't read the files passed to it, our entrypoint script likely won't be able to either. It isn't run with any higher privileges than RabbitMQ itself is. It's also possible the refactoring in #94 might've helped here. Can anyone verify that this is still an issue, and perhaps provide a very short set of commands to run to easily replicate it if so? |
I'm having the same (or a similar) problem. I'm using a SAN certificate, which means I'm using a single certificate for multiple (sub) domains that resolve to the same IP address. Hence, the certificate I'm using is not exclusively for RabbitMQ, lives on the host filesystem and is owned by root. Having it being owned by anything other than root wouldn't make sense in this scenario I think. I mounted the directory with the certs as a read-only volume to the RabbitMQ container. In the entrypoint, after the I understand why RabbitMQ is run as a non-root user, but maybe it would be an idea to make a copy of the certificates before decreasing the privileges in the entrypoint script. Copying them to a container volume and making them readable by the Thoughts about this scenario? |
RabbitMQ itself assumes that certificate management happens at deployment/provisioning time and that the certificates are readable by the node (sorry if this insults someone's intelligence). So what @EdeMeijer suggests makes sense. I'm not an expert on how certificate/key pairs are managed in Docker images, however. |
@EdeMeijer I suggest that you file a new issues since you have a specific use case and solution proposal ;) |
I went with a different approach that worked for me and arguably is cleaner than copying around sensitive data into containers.
Because the container now starts with a uid other than 0, it doesn't The drawback here of course is that this solution requires some more configuration on the host machine, which I like to keep to a minimum in a containerized environment. Probably a better solution, since I'm using Docker Swarm, is to use the 'secrets' feature, but I'll have to look into that. |
Given that OP's issue appears to be around permissions (and is resolved), I'm going to close. Hopefully the discussion here serves as a useful reference for folks having the same issue in the future. 👍 |
If the cert/key/cafiles are passed into the docker container as volumes with 0400 permissions owned by the root user in the host system then rabbitmq segfaults.
This is unexpected.
The entrypoint script should copy these files and apply the correct permissions that rabbitmq expects.
Currently I have to work around this by setting the permissions to 0777 on the host machine. This is dangerous =/
The text was updated successfully, but these errors were encountered: