1. Resources
  2. Detection rules
  3. GitLab Project or Group Made Public

GitLab Project or Group Made Public detection rules

A private or internal GitLab project or group is switched to public. Its source code, history and whatever credentials were ever committed can then be cloned by anyone, without signing in.

Platform
GitLab
Severity
High
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, or an access token with the api scope that carries it, and for a project in a group a parent group that is already public.
Impact
Source code, internal documentation and every credential committed anywhere in the history are disclosed, and copies made while the project was public cannot be recalled.
Response
Return the project or group to its previous visibility level, and take the Owner role from the acting account or revoke the access token that carried it.
Mitigation
Keep top-level groups that hold internal code private, because projects and subgroups cannot be more visible than their parent group.
Audit events
project_visibility_level_updatedgroup_visibility_level_updated

How the attack works

Every GitLab project and group is private, internal or public. For a public project, any user, including unauthenticated users, can clone the project. Changing the visibility level of a project or a group needs the Owner role, and a project can never be more visible than its parent group, so a private group keeps everything below it private.

An attacker who holds an Owner account, or an access token that carries the role, can switch a project to public and collect the content from the public side instead of cloning it from a suspicious address, or publish internal code to put pressure on the victim. GitLab records the change as project_visibility_level_updated for a project and group_visibility_level_updated for a group, with the old and new level in details.from and details.to.

What an attacker needs

  • The Owner role on the project or group, or an access token with the api scope that carries it. For a project in a group, the parent group must already be public.
  • On GitLab Self-Managed and GitLab Dedicated, the Public visibility level must not be restricted by an administrator.
  • Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON.

Impact

Disclosure of source code, internal documentation and every credential committed anywhere in the history, which can lead to compromise of the cloud accounts, registries and services those credentials belong to. Copies made while the project was public cannot be recalled.

Detection rules

GitLab Project or Group Visibility Changed to Public

Detects a GitLab project or group being switched to public visibility (audit event types project_visibility_level_updated and group_visibility_level_updated where the new level is Public). The details object has no fixed schema; the from and to keys were checked against the GitLab source, which writes the level name through its translation function, so on an instance used in another interface language the value can be translated. Validate it on your version.

LevelHighStatusExperimentalLog sourceGitLab audit events
title: GitLab Project or Group Visibility Changed to Public
id: 7cfd09aa-636b-42e1-8e4f-92175ccf5bb8
status: experimental
description: >-
  Detects a GitLab project or group being switched to public visibility (audit
  event types project_visibility_level_updated and
  group_visibility_level_updated where the new level is Public). The details
  object has no fixed schema; the from and to keys were checked against the
  GitLab source, which writes the level name through its translation function,
  so on an instance used in another interface language the value can be
  translated. Validate it on your version.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/user/public_access/
  - https://attack.mitre.org/techniques/T1537/
author: Forestall
date: 2026-11-11
tags:
  - attack.exfiltration
  - attack.t1537
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - project_visibility_level_updated
      - group_visibility_level_updated
    details.to: Public
  condition: selection
falsepositives:
  - Planned open sourcing of a project. Confirm the release was approved and that the history was checked for secrets first.
level: high

False positives

  • Planned open sourcing of a project. Confirm the release was approved and that the history was checked for secrets first.

Triage

  • Read entity_path for the project or group, details.from for the previous level and the actor in author_name and ip_address.
  • If unexpected, set the visibility back at once, then look for forks and clones made while it was public.
  • Treat every secret in the repository's history as exposed, rotate it and review its use since the change.
  • Review what else the actor did in the same session, such as new members, access tokens or deploy keys.

Response

Once the attack is confirmed:

  1. Return the project or group to the level in details.from. A group cannot be set to private while a project or subgroup in it is public, so lower those first and check each for a visibility change by the same actor.
  2. Take the Owner role from the acting account, or revoke the access token that carried the role, until the change is explained, and reset the account's credentials.
  3. Record how long the content was public and which forks were made in that time, and decide with the code owners and legal counsel whether customers or partners must be told. Copies made in that period cannot be recalled.
  4. After the secrets found in the history are rotated, confirm in the cloud accounts, registries and services they belong to that the old values are rejected.
  5. Check the other projects and groups the actor owns for the same change, and watch for another project_visibility_level_updated or group_visibility_level_updated event.

Mitigation

  • Keep top-level groups that hold internal code private, because projects and subgroups cannot be more visible than their parent group.
  • On GitLab Self-Managed and GitLab Dedicated, restrict the Public visibility level in the Admin area if nothing should be published from the instance.
  • Keep the Owner role small and avoid access tokens that carry it.
  • Keep secrets out of repositories with secret push protection, and rotate anything that was ever committed.
  • Alert on every change to public and review it within minutes.

Frequently asked questions

Is switching the project back to private enough?

No. While the project was public, any user, including unauthenticated users, could clone it, and copies made in that time cannot be recalled. Treat the source code as disclosed and every credential ever committed to its history as exposed. Rotate those credentials and review their use since the change.

Does the rule fire when a private project is made internal?

No. The rule matches only a new level of Public. For an internal project any authenticated user, including users with the Guest role, can clone the project, while external users cannot. On an instance with many accounts that is still a wide audience, so consider a second rule for that level.

Why might the rule stay silent on an instance that uses another interface language?

The rule compares `details.to` with the text Public. GitLab writes the level name through its translation function, so on an instance used in another interface language the value can be translated and the rule does not match. Validate the value on your version before you rely on the rule.

Can a project be made public while its group stays private?

No. A project can never be more visible than its parent group, so a private group keeps everything below it private. A group switched to public therefore deserves the same attention as a project, because it is the step that allows the projects below it to be published.

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.