-
Notifications
You must be signed in to change notification settings - Fork 100
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
USER root
vs USER 1000
#506
Comments
We're still debating this one as well- realistically it doesn't much matter in most environments today, as by default (to properly work under all container runtimes we support) we have to set permissions on things like IIUC, the original default in the runner images that most EEs are based on was set to something non-root to comply with some vague security guidelines that are mostly meaningless in today's real-world environments. Maybe @shanemcd or someone else has more thoughts? |
The reason awx-ee sets USER to 1000 is to work out-of-the-box on k8s clusters with security policies that force pods to run as a non-root user. This might be a good enough reason to do this in ansible-builder by default, as I think anyone trying to use EEs in hardened k8s clusters will run into this. |
Right, but they don't typically ever run as the container default user in any k8s config I've seen (no matter if it's root or not)- without manual container/pod config to the contrary, they end up running as a completely ephemeral UID with primary GID 0, hence all the custom 🤷♂️ |
This is true for OCP and some other security-minded distributions. But unless something has changed recently, by default Kubernetes will let you run pods under whatever UID is configured in the image itself. |
Bleh, I thought they'd changed the default to I'm actually less swayed by the k8s argument (since there are so many variables involved, the use of any default is likely to fail for some common use case and require manual intervention)... I do feel like "interactive mucking about should probably (by default) behave similarly to a typical deployment" is a good ideal to strive for though. So we should probably just add an |
* Added options.user setting * Updated documentation with an example * Added unit tests Fixes: ansible#506 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Allow to set user value for the container image * Added options.user setting * Updated documentation with an example * Added unit tests Fixes: #506 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Updated indentation Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * review comments Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Fix integration tests Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> --------- Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
When using ansible-builder, including v3, the user is set as root in the container.
When I looked at the config for the Execution Environment for AWX, I see they add a step at the end to set
USER 1000
which changes behavior inside of the containerhttps://github.com/ansible/awx-ee/blob/devel/execution-environment.yml
Is there a reason that ansible-builder runs as root and awx-ee runs as 1000? Is one more secure than the other or more "correct"? I would have expected similar behavior from both.
The text was updated successfully, but these errors were encountered: