Currently, if LDAP group sync is configured and a group has LDAP group links, no group member (including owners) can override membership. No users can be added, no roles can be changed.
Gotcha 1: If an owner member disabled group links temporarily, they can add a non-LDAP user at any role. Then, re-add the LDAP group link. LDAP user roles and memberships will be managed as usual. However, the non-LDAP user will remain a member of the group.
Gotcha 2: An owner member can remove the LDAP group link and not re-add it. Then, owner members can add, remove or update member permissions at will.
Why we're discussing this
gitlab-org/gitlab-ee#343 plans to introduce LDAP overrides (which was a pre-8.0 feature). This has been a heated topic. We changed the behavior in 8.0 at the request of many vocal users. Now, we've seen the opposite effect - users that relied on this behavior prior to 8.0 want the overrides back.
What we realize based on the current situation outlined above is that it's really not all that restricted. The two gotchas show two ways in which group Owners can still manage membership manually. We will introduce the override feature as planned in gitlab-org/gitlab-ee#343 because it does not substantially change the security model, but now we must decide what we will do (if anything) to change further restrict the model. We can optionally ship any change that comes out of this issue in connection with gitlab-org/gitlab-ee#343 so things are more secure.
Requirements
Restrict group owners from managing LDAP group links
Restrict group owners from managing LDAP member overrides
Options
Do nothing. GitLab administrators who want to totally restrict group membership to LDAP can make themselves the sole owner(s) of every group. Then, only they can enact overrides or remove/change LDAP group links.
Don't add a global config option but create a rake task to demote all owners and make GitLab administrators owners. (This is a less direct way to implement item 3).
Add a global configuration option to only allow GitLab administrators to be owners of groups. This will not be retroactive so we will also have to create a Rake task or similar to demote all current group owners to masters and add GitLab administrators as group owners.
SSOT: Add a global configuration option to restrict group owners from managing LDAP group links. This will also prevent group owners from enacting any overrides. Only GitLab administrators would be allowed to override an LDAP membership.
Specification
We'll proceed with option 4: Add a global configuration option to restrict group owners from managing LDAP group links and LDAP member overrides.
Add a setting in admin/application_settings between “Enabled Git access protocols” and the “Account and Limit Settings” section:
# LDAP group settings[ ] Allow group owners to manage LDAP-related group settingsIf checked, group owners can manage LDAP group links and LDAP members overrides (question-icon)
The question mark icon should have a tooltip “Read documentation” and link to the documentation regarding LDAP group links and permission overrides: here or here
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
@dblessing on thinking about it, let's make this a blocker so we never ship something that will burn anyone. Let me know if you need any help in managing it.
Hi @dblessing I have started working on this issue. I had a few questions around it.
How do we plan to expose this configuration? is it a just flag that can be enabled/disabled (i.e. Checkbox) which says Prevent changing group owner ? or any other form of input?
Where do we plan to show this option? I can think of new group page (/admin/groups/new) and group settings page (/groups/<group_name>/edit)
Let me know if I understood this issue correctly, I'm also following !822 (merged).
@kushalpandya The option should be something like 'Restrict group owners to administrators' (or '... global administrators'). I believe we decided it should be a global configuration ('admin/settings'?) rather than a group-level setting.
@dblessing@kushalpandya I was thinking about adding the setting in admin/application_settings between “Enabled Git access protocols” and the “Account and Limit Settings” section, as follows:
@pedroms Thanks for the mockup, and especially the config text! though I added this config under Account and Limit Settings in my WIP. I'll update it though!
@kushalpandya No problem, I'm glad it helps. I also thought about placing it under Account and Limit Settings but that section looks very specific to a user account in GitLab.
@pedroms@kushalpandya AFAIK, we do not want to make this setting explicitly about LDAP group links. It should be about restricting group owners to global admins, thereby restricting LDAP group link management.
@pedroms I don't know who added SSOT, but it wasn't me. I see no comments mentioning that this was the decision, either. Last we left off, we had agreed on option 3.
Maybe someone in this thread can shed some light on how we ended up with this mystery SSOT?
@JobV@jacobvosmaer-gitlab Do you still think the global option to restrict group owners to global admins is preferred over a specific LDAP-related configuration?
@dblessing I had discussion around this issue with @jschatz1 and based on comments, SSOT for option 3 was put, is it yet to be concluded which option to go with?
Add a global configuration option to only allow GitLab administrators to be owners of groups.
Which does not match the SSOT. Maybe there was confusion when typing the SSOT?
Pedro Moreira da Silvachanged title from Add configuration option to restrict overriding LDAP permissions? to Add global configuration option to restrict group owners to admins
changed title from Add configuration option to restrict overriding LDAP permissions? to Add global configuration option to restrict group owners to admins
@dblessing@kushalpandya@jschatz1 I was reviewing the issue description and restricting group owners to admins seems to be the same as restricting group creation/edition to admins. If the purpose of this issue is to restrict the management of LDAP group links and LDAP user permissions, I think this is approach is too restrictive. This would mean that only admins could create groups or edit them, which goes beyond LDAP group links. Am I missing something here?
@dblessing Yes, you're right, I think a master user can do that. My point with the previous comment was to understand how option 3 caters to the issue purpose better than option 4. What are your thoughts?
I prefer option 3 because it does not change what 'group owner' or 'ldap group sync' means.
This is also more generic, which prevents us from getting in to a situation where we're basically implementing custom roles. Let's start with this and if it's too restrictive or some other issues comes up we can re-visit.
@dblessing@jacobvosmaer-gitlab do we have field for this option added in application_settings.rb (and also probably in application_settings_controller.rb) which can be used for form submission on saving?
This will not be retroactive so we will also have to create a Rake task or similar to demote all current group owners to masters and add GitLab administrators as group owners.
@dblessing@pedroms I think that we should add a note warning users that we will demote all current group owners to masters when this feature is turned on. Which GitLab administrators we should pick up as group owner when we have more than one?
Or if this is the only issue tracking both frontend and backend changes, I'd rather prefer to have it assigned to someone who is working on pending backend part of it (and remove ~Frontend label meanwhile).
Don't allow non-admins to be added as group members with owner access (in GroupMember.add_user and GroupMember.add_users_to_group)
Don't allow non-admins to have their group member access changed to owner (in the controller and the API
Clarify this in the UI, in the "Add user" form and elsewhere, and show errors when someone tries to give a non-admin owner access.
Personally, I would prefer option 4 which just affects the LdapGroupLinks page and API, and could be implemented easily by checking a new :admin_ldap_group_links ability, without touching all member management.
I don't think it "change[s] what 'group owner' or 'ldap group sync' means.", it just specifies that admins and admins alone are in charge of setting up the integration between GitLab and LDAP.
@kushalpandya I'll unassign you while this waits for backend work. The frontend will be very minor anyway—backend devs should be capable of adding a single option to a form :)
@DouweM Even though option 3 is marked as the SSOT, I agree with you on option 4. It's simpler to implement, understand and impacts just what this issue was initially intended for: LDAP group links. Besides, @dbalexandre raised a good point about option 3:
Which GitLab administrators we should pick up as group owner when we have more than one?
@DouweM@kushalpandyaadmin_ldap_group_links doesn't quite cover it - it's also about restricting member overrides. @regisF Can you weigh in here?
I also dislike this very specific configuration because we're wandering in to the custom roles realm and instead of implementing true custom roles we're sidestepping and bolting on a feature in a weird location. This contributes to splintered ways to affect roles in various configuration. This is also sort of true for option 3 but at least it's at a way less granular level.
@DouweM they're restricted to masters. But some orgs want to make sure no
one but admins can manage an override, or delete/add ldap group links. Both
scenarios are covered by the option 3, but not by option 4.
adding a global configuration to only allow administrators to be owners of groups will change master to be custom and change depending on the context, which might be misleading.
this setting goes beyond LDAP, which is the main topic here.
Have you received demand for the need to restrict the management of groups to admins?
What I like with solution 4, without knowing the needs of the customers, is that it's restricted to LDAP specifically and can explained that way, under a specific LDAP section in the Admin interface.
@regisF The ultimate requirements are what I mentioned before:
Restrict management of LDAP group links
Restrict management of LDAP member overrides
The solution to this issue needs to address both things. I have some philosophical opinions on whether option 3 or option 4 are best, but at the end the above two things must be addressed. However we can move to that solution most quickly, let's do it.
@regisF@DouweM@dblessing Let's make a decision so that we can ship this in %8.17 and don't impact customers negatively. #343 (closed) was shipped in %8.15 and as @JobV said about this issue: “let's make this a blocker so we never ship something that will burn anyone”.
Even though you are all more experienced than me on this, I'd say option 4 addresses this issue better than other options.
@regisF Is there something different you would name the configuration for option 4? To me, if the configuration is Allow group owners to manage LDAP group links it would be surprising if it also restricted the ability to override membership levels. Perhaps `Allow group owners to manage LDAP-related group settings' or something similar so it's more inclusive.
I would definitely recommend this is off by default for new and existing setups.
@dblessing what about (imagine this being a UI element):
- [ ] Allow group owners to manage LDAP-related group settings If checked, group owners will be able to manage LDAP group links and LDAP members overrides. Read the documentation to know more.
@pedroms that depends whether we'll have documentation for this feature or not.
I think we will have a bit of documentation, right? If we do, the question mark is misleading because you expect a bubble, not the ability to click on it and direct the person to the documentation.
Using the question mark icon to link to the documentation/help/information is a common pattern used throughout GitLab. It is used specifically on that settings page on numerous occasions. Have you seen it being used in a different way?
@DouweM I'm cutting it to the wire here for next release , but support would like to request this for prioritization. I believe you are the right person to ask. If not, please tag them!
@mikegreiling We usually don't assign developers directly to issues, except for really urgent/big ones. This issue will hopefully get picked up by one of them as it rises to the top of the prioritized issue list, but as you can see there is still a lot of other stuff in there.