Group assignment to projects gives different end result based on how assignment was done:
- If a group rule is created and access is granted to a project - access can also be removed in group rule settings, projects can have an AD group assigned as a member.
If a group rule is created for AD group and same AD group needs additional permissions configured (let's say deny access to pipelines) - AD group has to be added as a member to a DevOps group (In this case DevOps group does not have a group rule). Then, there are 3 possibilities:
assign project to group rule (as in scenario 1), then DevOps group would not be used and would only act as permission group
DevOps group can be added to project from project settings.
AD group can be added to project from project settings.
In last two cases - AD group rule has an inherited assignment to that project and it cannot be removed from group rule settings.
A group rule can be created for the DevOps group, and that DevOps group can have AD group as a member. There is a same problem that if this group is added to a project from project settings - access cannot be revoked in group rule settings. It's a bit better than option 2 because you have a group and a group rule for the same group, but then access level management is done not on AD group level but on DevOps group level. 4.There can be a case there AD group has a group rule and belongs to a DevOps group that has a group rule as well, but I guess that shouldn't be a case in real life setup
How should access to projects be managed? Should all access be managed from organization level using groups/user assignment? Or should it be managed in project level by adding members? From the description above, I can see that having a hybrid of both can result in a mess and a lot of confusion when some access can be revoked in org User settings and some cannot. What is the recommended practice here?
In project settings user has access to DevOps groups and all AD groups (AFAK based on AD permissions) when adding a member to a team. Is it possible to control that from DevOps part? So that user could only add DevOps groups, or AD groups that have Group rule created for them? It might be related to the question above, but what is the recommended practice here?
====== Adding a scenario to illustrate the my questions
Let's take this scenario: AD groups "Devs" and "QA" need to be granted access to DevOps and projects P1 and P2.
- P1 proj admin can go into proj settings -> teams and add AD Group "QA" directly to project. Since QA is not part of the org yet, I would argue that this action should be not allowed. Is it possible to prevent admins from doing that? Any arguments why it should be allowed?
- Global admin (GA) adds Group rule to add AD group "Devs" to DevOps. DevOps Group is not created for this rule so AD group has to be added to a new or existing DevOps group. Let's say a new Group "DevOps-Devs" is created and AD group is added as a member to it. Now P2 owner wants to add developers to a project. He/she can add both AD "Devs" and "DevOps-Devs" in project settings. I would guess that DevOps group should be used, is that right? (again how can adding AD group be prevented?)
- GA creates a DevOps group called DevOps-QA. He then adds a group rule for that group. AD group "QA" is then added as a member to DevOps-QA. Which method (2 or 3) is preferred or recommended for creating group rules? Then instead of adding members to project through proj settings, a project access is assigned to DevOps-QA group in Group rules settings -> Manage group rule
Additionally, I would argue that user/ad group access to projects should be mainly managed in Organization settings. This is not the case if 1 and 2 options are used. If option 3 is used, access can be added or revoked from group in "manage group rule" settings, however it was mentioned that group rules are mainly used for licensing (and they have to be created in a first place), so now it looks that it's not the best place to manage access. Not having an opinion on this and allowing users use their preferred way can lead to more confusion future organization management. What approach can you recommend?