doc/administration/settings/visibility_and_access_controls.md
{{< details >}}
{{< /details >}}
Administrators of GitLab instances can enforce specific controls on branches, projects, snippets, groups, and more. For example, you can define:
Prerequisites:
To access the visibility and access control options:
You can add project creation protections to your instance. These protections define which roles can add projects to a group on the instance.
When you configure the Default minimum role required to create projects setting, you set the default for new groups. Existing groups retain their current permissions.
Prerequisites:
[!note] If you select Administrators and Admin Mode is enabled, administrators must enter Admin Mode to create new projects.
{{< details >}}
{{< /details >}}
Prerequisites:
To restrict project deletion to only administrators:
To disable the restriction:
{{< history >}}
{{< /history >}}
Deletion protection prevents accidental deletion of groups and projects on your instance.
Groups and projects remain restorable during the retention period you define. By default,
the retention period is 30 days, but you can change it to a value between 1 and 90 days.
Prerequisites:
To configure deletion protection for groups and projects:
1 and 90 days.To override the delay, and permanently delete a project marked for removal:
To set the default visibility levels for new projects:
Prerequisites:
To set the default visibility levels for new snippets:
Prerequisites:
Internal visibility setting keep this setting. To learn more
about this change, see issue 12388.To set the default visibility levels for new groups:
Prerequisites:
For more details on group visibility, see group visibility.
{{< history >}}
prevent_visibility_restriction. Disabled by default.prevent_visibility_restriction enabled by default in GitLab 16.4.prevent_visibility_restriction removed in GitLab 16.7.{{< /history >}}
When restricting visibility levels, consider how these restrictions interact with permissions for subgroups and projects that inherit their visibility from the item you're changing.
This setting does not apply to projects created under a personal namespace. There is a feature request to extend this functionality to enterprise users.
To restrict visibility levels for groups, projects, snippets, and selected pages:
Prerequisites:
[!note] You cannot restrict a visibility level that is set as the default for new projects or groups. Conversely, you cannot set a restricted visibility level as the default for new projects or groups.
With GitLab access restrictions, you can select the protocols users can use to communicate with GitLab. Disabling an access protocol does not block port access to the server itself. The ports used for the protocol, SSH or HTTP(S), are still accessible. The GitLab restrictions apply at the application level.
GitLab allows Git actions only for the protocols you select:
To specify the enabled Git access protocols for all projects on your instance:
Prerequisites:
[!warning] GitLab allows the HTTP(S) protocol for Git clone or fetch requests performed with GitLab CI/CD job tokens. This happens even if you select Only SSH, because GitLab Runner and CI/CD jobs require this setting.
{{< details >}}
{{< /details >}}
You can customize project Git clone URLs for HTTP(S), which affects the clone panel shown to users on a project's page. For example, if:
https://example.com, then project clone URLs are like
https://example.com/foo/bar.git.https://git.example.com/gitlab/foo/bar.git instead,
you can set this setting to https://git.example.com/gitlab/.To specify a custom Git clone URL for HTTP(S) in gitlab.rb, set a new value for
gitlab_rails['gitlab_ssh_host']. To specify a new value from the GitLab UI:
Prerequisites:
These options specify the permitted types and lengths for SSH keys.
To specify a restriction for each key type:
GitLab enables project mirroring by default. If you disable it, both pull mirroring and push mirroring no longer work in every repository. They can only be re-enabled by an administrator user on a per-project basis.
To allow project maintainers on your instance to configure mirroring per project:
Prerequisites:
Administrators can combine IP address ranges with IP restrictions per group. Globally-allowed IP addresses enable aspects of the GitLab installation to work properly, even when groups set their own IP address restrictions.
For example, if the GitLab Pages daemon runs on the 10.0.0.0/24 range, globally allow that range.
GitLab Pages can still fetch artifacts from pipelines, even if IP address restrictions for the group don't
include the 10.0.0.0/24 range.
To add a IP address range to the allowlist for a group:
Prerequisites:
{{< history >}}
{{< /history >}}
Administrators can prevent non-administrators from inviting users to all groups or projects on the instance. When you configure this setting, only administrators can invite users to groups or projects on the instance.
[!note] Features such as sharing or migrations can still allow access to these groups and projects.
Prerequisites:
To prevent invitations:
{{< details >}}
{{< /details >}}
{{< history >}}
usage_billing_dev. Enabled by default.usage_billing_dev removed in GitLab 18.10.{{< /history >}}
Prerequisites:
To turn on the display of user data on the GitLab Credits dashboard: