Least privilege depends on what a person or automation can actually do. In GitLab, reviewing a project's direct members gives only part of the picture: parent membership, invited groups, identity-provider synchronization, and other credentials can also grant access. A modest role in one place doesn't cancel a broader grant elsewhere.
Trace the access a person receives
GitLab retains the permissions of a user's highest role across membership paths. Someone who is a Developer in a project and a Maintainer in its parent group still has Maintainer permissions in the project. Removing the direct project membership doesn't remove the inherited access.
Place membership at the smallest group or project that covers the work. Grant membership in a parent group when the person needs the same access to every project below it. A grant to a narrower subgroup is easier to justify when only that team's projects are relevant. Keep Owner and Maintainer access focused on responsibilities that need those permissions; a person's seniority doesn't by itself explain a need for broader access.
Use the Members page and membership APIs to follow the source of access. Include invited groups and membership supplied through SAML or LDAP, and account for administrators who can act beyond ordinary project membership. Check whether the access granted through each path is still needed for the person's work.
Understand what a group invitation limits
Inviting a group makes it easier to give a set of people access without maintaining the same individual list in several places. Each person receives the lower of their role in the invited group and the invitation's maximum role. That maximum limits the invitation; it doesn't cap access obtained through another membership.
For example, inviting a group with a maximum role of Reporter doesn't reduce an existing Maintainer role inherited from the project's parent. To reduce that person's access, change the broader grant at its source.
Group sharing also has eligibility rules. Inviting a group to a project gives access to its direct, inherited, and shared members. Inviting it to another group gives access only to its direct members. Membership in a subgroup of the invited group doesn't itself grant access through either invitation. Follow the actual membership path, particularly when sharing is nested, so access reaches the intended collaborators.
Specialized and custom roles need closer inspection. Planner and Security Manager roles aren't simply steps in the usual sequence of cumulative roles. Custom roles add selected permissions to a base role.1 When comparing custom roles for group sharing, GitLab compares their base roles; if the bases match, the user retains the custom role from the original group. Check the specific sensitive actions the person can perform as well as the displayed role name.
Give automation a purpose and an owner
An integration should have access that fits the resources and operations it uses. Prefer a project or group access token over a person's token where that token type is available and fits the task. A token's role and scopes both affect what it can do. Narrowing one while leaving the other broad may still grant more access than intended.
Review service accounts, deploy keys, and deploy tokens alongside human membership. Someone needs to know what uses each credential, what will fail when it's revoked or expires, and how to replace it. Store secrets in an appropriate secret store; keep the ownership and rotation instructions where maintainers can find them.
Keep access aligned as responsibilities change
Joining, changing teams, leaving, and collaborating temporarily all change the access a person needs. Identity synchronization can handle part of that work, but a separately invited group or direct grant may remain. Check the result of a role change or offboarding across the paths that applied to that person.
Temporary elevated and emergency access needs a usable removal path. Agree who can approve it, how it ends, and how its use will be reviewed. Test the emergency procedure before an incident so the team can act without improvising permanent privileges.
Smaller grants create more membership to maintain. Reusing groups that represent a real set of collaborators can reduce that effort, provided the sharing remains understandable. A structure that only one administrator can explain is difficult to review or safely hand over.
Further Reading
Notes
-
Custom roles are available in Ultimate. They add selected permissions to a base role. Reviewing direct and inherited access can reveal unnecessary permissions on any tier. ↩
- Access reviews that follow how people work explains how to trace grants, narrow them around responsibilities, and maintain human and automation access.
- Check roles and individual permissions helps you choose the access needed for specific work.
- Understand sharing and invitation limits explains which members receive access through each type of group invitation.
- Inspect inherited and invited group membership with the API provides ways to examine membership beyond direct grants.
- Review authentication and authorization practices covers token handling, access reviews, and account security.