Skip to content
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

Support for arbitrary user #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fsteccanella
Copy link

By default, OpenShift Container Platform runs containers using an arbitrarily assigned user ID. This provides additional security against processes escaping the container due to a container engine vulnerability and thereby achieving escalated permissions on the host node.

For an image to support running as an arbitrary user, directories and files that may be written to by processes in the image should be owned by the root group and be read/writable by that group. Files to be executed should also have group execute permissions.

Because the container user is always a member of the root group, the container user can read and write these files. The root group does not have any special permissions (unlike the root user) so there are no security concerns with this arrangement.

(https://docs.redhat.com/en/documentation/openshift_container_platform/3.10/html/creating_images/creating-images-guidelines#openshift-specific-guidelines)

This pull request adds support for running Caddy as an arbitrary user:

chgrp -R 0 /config && chmod -R g=u /config;
chgrp -R 0 /data && chmod -R g=u /data;
chgrp -R 0 /etc/caddy && chmod -R g=u /etc/caddy;
chgrp -R 0 /usr/share/caddy && chmod -R g=u /usr/share/caddy;
chgrp -R 0 /usr/bin/caddy && chmod -R g=u /usr/bin/caddy;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant