1. Resources
  2. Detection rules
  3. Group Invited to a Group or Project in GitLab

Group Invited to a Group or Project in GitLab detection rules

An attacker with the Owner role invites a group they control to a GitLab group or project. Every member of the invited group gains access at once, and later members arrive without any event on the shared resource.

Platform
GitLab
Severity
Medium
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
The Owner role on the project or group that is shared, membership of the invited group and a hierarchy that allows the invitation.
Impact
Every member of the invited group gains access up to the chosen maximum role, and later members arrive without an event on the shared resource.
Response
Remove the invited group, which ends the access of all its members, and review what they did in the shared projects.
Mitigation
Prevent inviting groups outside the top-level group and its subgroups, and invite groups with the lowest maximum role that works.
Audit events
group_share_with_group_link_createdgroup_share_with_group_link_updatedproject_group_link_createdproject_group_link_updatedprevent_sharing_groups_outside_hierarchy_updatedgroup_shared_with_group_lock_updated

How the attack works

GitLab lets an Owner share a project or a group with another group by invitation. When a group is invited to a project, its direct and inherited members get access to the project. When a group is invited to another group, its direct members get access to that group. The person who invites chooses a maximum role, and each member keeps the lower of that maximum and the role they hold in the invited group. GitLab itself warns that sharing a project with another group increases the number of users who can invite yet more members, and that each group is an additional source of access permissions that is difficult to control.

For an attacker who has taken over an Owner, this is a quiet way to grant access. One invitation covers every account in the invited group, and from then on membership is decided inside the invited group: an account added there next month reaches the shared project without a member event on the project itself. GitLab records the invitation as group_share_with_group_link_created for a group and project_group_link_created for a project, changes to an existing link as group_share_with_group_link_updated and project_group_link_updated, and changes to the two settings that restrict sharing as prevent_sharing_groups_outside_hierarchy_updated and group_shared_with_group_lock_updated.

What an attacker needs

  • The Owner role on the project or on the group that is shared. Since GitLab 18.0 group invites are limited to Owners.
  • Membership of the group that is invited.
  • A hierarchy that allows the invitation. A top-level group can prevent its subgroups and projects from inviting groups outside its hierarchy, and a group can prevent its projects from being shared with other groups.
  • Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON.

Impact

All members of the invited group receive access to the project, or to the group and everything below it, up to the maximum role that was chosen, which can be Owner. The access does not show as individual members being added, the name of a private invited group is masked for users who are not members of it, and whoever manages the invited group controls who gets in from then on.

Detection rules

GitLab Group Invited to Another Group

Detects a group being invited to another group (group_share_with_group_link_created) and the access settings of such an invitation being updated (group_share_with_group_link_updated). The direct members of the invited group get access to the shared group and to everything below it, up to the maximum role chosen at the invitation. Members who join the invited group later get the same access with no further event on the shared group. Only an Owner of the shared group can send the invitation. The event type reference lists both events without their fields, so the rule does not see the invited group or the maximum role. Read both on the Groups tab of the Members page.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab Group Invited to Another Group
id: 8abbf1b0-297f-412b-ad6a-33bf05625699
status: experimental
description: >-
  Detects a group being invited to another group
  (group_share_with_group_link_created) and the access settings of such an
  invitation being updated (group_share_with_group_link_updated). The
  direct members of the invited group get access to the shared group and
  to everything below it, up to the maximum role chosen at the
  invitation. Members who join the invited group later get the same
  access with no further event on the shared group. Only an Owner of the
  shared group can send the invitation. The event type reference lists
  both events without their fields, so the rule does not see the invited
  group or the maximum role. Read both on the Groups tab of the Members
  page.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/project/members/sharing_projects_groups/
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - group_share_with_group_link_created
      - group_share_with_group_link_updated
  condition: selection
falsepositives:
  - Organizations that keep users in one set of groups and share those groups into the groups that hold projects, which GitLab describes as a way to manage many users. Confirm the invited group and its maximum role with the Owner.
  - To limit the rule to top-level groups, add a filter that excludes entity_path values containing a slash.
level: medium

False positives

  • Organizations that keep users in one set of groups and share those groups into the groups that hold projects, which GitLab describes as a way to manage many users. Confirm the invited group and its maximum role with the Owner.
  • To limit the rule to top-level groups, add a filter that excludes entity_path values containing a slash.

GitLab Group Invited to a Project

Detects a group being invited to a project (project_group_link_created) and an existing project group link being updated (project_group_link_updated). The direct and inherited members of the invited group get access to the project, each with the lower of their role in the group and the maximum role chosen at the invitation. GitLab warns that sharing a project with another group increases the number of users who can invite yet more members to it. The Owner role on the project is needed. Teams share projects with groups as part of normal work, and the event type reference lists both events without their fields, so this is a low-level signal. It matters on projects that deploy or hold sensitive code.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab Group Invited to a Project
id: 734d78fb-8f56-4d25-88ae-e93ba1ada947
status: experimental
description: >-
  Detects a group being invited to a project (project_group_link_created)
  and an existing project group link being updated
  (project_group_link_updated). The direct and inherited members of the
  invited group get access to the project, each with the lower of their
  role in the group and the maximum role chosen at the invitation. GitLab
  warns that sharing a project with another group increases the number of
  users who can invite yet more members to it. The Owner role on the
  project is needed. Teams share projects with groups as part of normal
  work, and the event type reference lists both events without their
  fields, so this is a low-level signal. It matters on projects that
  deploy or hold sensitive code.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/project/members/sharing_projects_groups/
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - project_group_link_created
      - project_group_link_updated
  condition: selection
falsepositives:
  - Teams that give a neighbouring team access to one project. Keep the rule for the projects that deploy to production, and confirm the invited group and its maximum role with the project Owner.
level: low

False positives

  • Teams that give a neighbouring team access to one project. Keep the rule for the projects that deploy to production, and confirm the invited group and its maximum role with the project Owner.

GitLab Group Sharing Restriction Setting Changed

Detects a change to two group settings that restrict sharing, both audited from GitLab 17.4. The first is the top-level group setting under which members cannot invite groups outside of the group and its subgroups (prevent_sharing_groups_outside_hierarchy_updated). The second is the setting that GitLab describes as whether the group can be shared with other groups (group_shared_with_group_lock_updated), which by its name corresponds to the option that prevents the projects of a group from being shared with other groups. Switching either one off reopens invitations that the organization had blocked, and is a likely first step before a foreign group is invited. The event type reference does not document the field that holds the old and the new value, so the rule matches on the event type and fires in both directions.

LevelLowStatusExperimentalLog sourceGitLab audit events
title: GitLab Group Sharing Restriction Setting Changed
id: f04415bb-cdd6-4584-9d93-a5cb4e82a2fb
status: experimental
description: >-
  Detects a change to two group settings that restrict sharing, both
  audited from GitLab 17.4. The first is the top-level group setting under
  which members cannot invite groups outside of the group and its
  subgroups (prevent_sharing_groups_outside_hierarchy_updated). The
  second is the setting that GitLab describes as whether the group can be
  shared with other groups (group_shared_with_group_lock_updated), which
  by its name corresponds to the option that prevents the projects of a
  group from being shared with other groups. Switching either one off reopens invitations
  that the organization had blocked, and is a likely first step before a
  foreign group is invited. The event type reference does not document
  the field that holds the old and the new value, so the rule matches on
  the event type and fires in both directions.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/project/members/sharing_projects_groups/
  - https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.003
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - prevent_sharing_groups_outside_hierarchy_updated
      - group_shared_with_group_lock_updated
  condition: selection
falsepositives:
  - A group Owner who switches a restriction on writes the same events. Read the details of the event, or the Permissions and group features section of the group settings, for the value now in force.
  - A planned exception for a partner group. It should match a change request and be reversed when the collaboration ends.
level: low

False positives

  • A group Owner who switches a restriction on writes the same events. Read the details of the event, or the Permissions and group features section of the group settings, for the value now in force.
  • A planned exception for a partner group. It should match a change request and be reversed when the collaboration ends.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Members added to a group after it was invited to a sensitive group or project

Detection hypothesisJoins two logsNeeds your own lists

After an invitation, access to the shared resource is granted by adding accounts to the invited group. Those additions are recorded on the invited group and look unrelated to the project they open. Following the invited groups shows access that grows without any change on the resource itself.

  1. Keep a list of the groups that are invited to your sensitive groups and projects, built from group_share_with_group_link_created and project_group_link_created events and from the Groups tab of the Members page.
  2. Watch for member_created and member_updated events whose entity_type is Group and whose entity_path is one of the invited groups.
  3. Alert on each new member, and name the resources that group is invited to and the maximum role of the invitation.

Eventsgroup_share_with_group_link_createdproject_group_link_createdmember_createdmember_updated

LimitsThe member events exist only where your audit event stream covers the invited group. A group in another top-level group is outside a stream that is set up for your own top-level group. GitLab does not document which field of the invitation event names the invited group, so the list may have to be kept from the Members page.

Group from outside your hierarchy invited

Detection hypothesisNeeds your own lists

An invitation between two groups of the same top-level group is ordinary team structure. An invited group that sits under a different top-level group, or under a personal namespace, hands the decision about who has access to someone outside the organization's own hierarchy.

  1. Take group_share_with_group_link_created and project_group_link_created events and read the top-level group of the shared resource from the first segment of entity_path.
  2. Find the path of the invited group. The schema has target_details and target_id for the target of an event, and the Groups tab of the Members page shows the group.
  3. Alert when the invited group is not under the same top-level group and is not on your list of approved partner groups.

Eventsgroup_share_with_group_link_createdproject_group_link_created

LimitsGitLab does not document where these two event types carry the path of the invited group, so check one event of your own before you automate the comparison. Where the top-level group already prevents invitations outside its hierarchy, this case cannot occur and the setting event is the one to watch.

Triage

  • Identify who invited (author_name, author_id, ip_address) and what was shared (entity_path, with entity_type telling a group from a project).
  • Find the invited group and its maximum role. Read target_details and the details object of the event, then open the Groups tab of the Members page of the project or group.
  • Check whether the invited group belongs to your own hierarchy, who its Owners are and who its members are. A group under a personal or foreign top-level group needs an explanation.
  • For an updated link, compare the maximum role and the expiration date with the earlier state.
  • For a changed sharing setting, read the value now in force in the Permissions and group features section of the group settings, because the events are written in both directions.
  • Look for other changes by the same author, such as new Owners, access tokens or changed protected branches.

Response

Once the attack is confirmed:

  1. Remove the invited group from the project or group, which ends the access of all its members at once.
  2. Review what the members of the invited group did in the shared projects while the invitation existed, such as clones, pushes, merges and changed settings.
  3. Rotate the credentials stored in the repositories and CI/CD variables that the invited group could read with its role.
  4. Secure the Owner account that sent the invitation, including its password, second factor and tokens.
  5. Enable the settings that restrict sharing, and check the other groups and projects of the hierarchy for invitations by the same account.

Mitigation

  • Turn on the top-level group setting that prevents inviting groups outside the group and its subgroups.
  • Where projects should not be shared at all, enable the group setting that prevents projects from being shared with other groups.
  • Invite groups with the lowest maximum role that works, as GitLab recommends, and avoid Maintainer and Owner.
  • Review the Groups tab of the Members page of top-level groups and sensitive projects on a schedule, and remove invitations that are no longer needed.
  • Alert on every group invited to a top-level group, and on groups invited to projects that deploy.

Frequently asked questions

Which members of an invited group get access?

It depends on what is shared. For a project, GitLab gives access to the direct and inherited members of the invited group, and to members of other groups that are shared with it, but not to members of its subgroups. For a group, only the direct members of the invited group get access. Each member keeps the lower of the maximum role chosen at the invitation and their role in the invited group.

Why is there no event when someone joins the invited group later?

There is one, but not on the shared resource. A new member is recorded as `member_created` on the invited group. A stream or a rule that watches only the shared project or its top-level group does not see it when the invited group lives in another hierarchy. That is why the invitation itself is the event to review, and why the detection logic on this page follows the invited group afterwards.

Can invitations to groups outside the organization be blocked?

Yes, for a top-level group. GitLab has a setting under which members cannot invite groups outside of the group and its subgroups, and a separate group setting under which projects cannot be shared with other groups. When the second one is enabled, groups that were already added to a project lose access. Changes to both settings have their own audit event types.

Has this been reported in a real attack?

No public incident report describes group invitations in GitLab at the audit event level. The page is built on GitLab's documentation of sharing, including its own warning that each invited group is an additional source of access permissions.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.