-
Notifications
You must be signed in to change notification settings - Fork 103
Issue 6181 - RFE - Allow system to manage uid/gid at startup #6182
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
Conversation
Bug Description: We have a user who wishes to implement a non-standard configuration in which the running gid is not the primary gid of the uid that the server runs as. Currently this trips up most of our setup tools. Rather than support dropping to an alternate gid in the server, it is simpler to allow systemd to pre-configure our user and group at start up. This needs a small number of changes. Fix Description: - dscreate needs to correctly setup file ownships for dse.ldif and friends rather than relying on the server having root access and changing the perms itself - Our unit file needs to enable the CAP_NET_BIND privilege so that the service can bind to ports lower than 1024 without being root - The server needs to not attempt to change it's uid/gid if we are already running as that user/gid. fixes: 389ds#6181 Author: William Brown <william@blackhats.net.au> Review by: ???
9d55ba3 to
520016f
Compare
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.
LGTM, but I'd like someone else form the team to review this as well.
|
Looks mostly good. The documentation is a bit frightful: It is hard to fully understand the impact of such a change and I wonder if it could not lead to some security issue On the other side, we also run with nearly full privilege when using root user but |
We could use =!, but we can't use =. The reason is that if we add a User/Group line, then that applies to execstartpre and execstart with =. That would break both the execstartpre scripts as both require root (systemd ask pass literally requires root, and so does selinux to change things). So =! might work (because it ignores the user/group parts) but it also might not because of the other permission bounds we set in the script. But = will break.
Yes, this prevents the need to setuid at all because we start as the isolated user in the first place. |
|
Thank you for the explanation, it makes me realize that it was only the preexec script that sets the selinux and file acl permissions that requires increased permissions and not ns-slapd as I initially thought. |
|
Just a remark that does not impact the code: |
|
No, better to be paranoid and to ask the questions. So thank you for asking them :) Yeah, it's such a problem - we have asked upstream systemd to fix this since I think 2016 ... they simply don't care. :( |
|
By the way, we would like this in 2.2 for SUSE since that's what we currently have on our LTS - are there any objections if I backport this? We're currently waiting on some customer feedback, so once I have that I'll do it. In the process, should I backport to other versions too? Or is this something that initially we should leave just as a SUSE patch. I think given it's not enabled by default it's a low risk to change. |
|
Let's first fix test failures before backporting, currently all tests are red, they fail with See https://github.com/389ds/389-ds-base/actions/runs/9376433608 |
Bug Description: We have a user who wishes to implement a non-standard configuration in which the running gid is not the primary gid of the uid that the server runs as. Currently this trips up most of our setup tools.
Rather than support dropping to an alternate gid in the server, it is simpler to allow systemd to pre-configure our user and group at start up. This needs a small number of changes.
Fix Description:
fixes: #6181
Author: William Brown william@blackhats.net.au
Review by: ???