-
Notifications
You must be signed in to change notification settings - Fork 19
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
Run xcache as user instead of root #84
base: master
Are you sure you want to change the base?
Conversation
Even in containers, it's best practice to execute code as a user rather than as root whenever possible. In addition, some multi-tenant Kubernetes systems (Red Hat OpenShift / OKD) have a default security policy that executes containers with an ephemeral UID with GID 0. This change (along with substituting go-crond for crond in the base software image) should enable running as any user with GID 0.
Wouldn't this break multiuser? I will ask around if that's an issue. |
RUN groupadd -o -g 0 xrootd | ||
RUN useradd -o -u 10940 -g 0 -s /bin/sh xrootd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for? Does OKD not like groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, OKD runs containers with an ephemeral UID and GID 0.
#FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-$BASE_YUM_REPO AS xcache | ||
FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-bh AS xcache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-$BASE_YUM_REPO AS xcache | |
FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-bh AS xcache | |
FROM opensciencegrid/software-base:$BASE_OSG_SERIES-el7-$BASE_YUM_REPO AS xcache |
looks like a leftover from testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind, just saw your line about go-crond.
I don't want to get it working on OKD only to break it on vanilla Kubernetes. I created a new branch, |
Even in containers, it's best practice to execute code as a user rather than as root whenever possible. In addition,
some multi-tenant Kubernetes systems (Red Hat OpenShift / OKD) have a default security policy that executes
containers with an ephemeral UID with GID 0. This change (along with substituting go-crond for crond in the base
software image) should enable running as any user with GID 0.