Description:

This check verifies that a GitLab project has protected tags configured, restricting who can create or delete Git tags. Tags are commonly used to mark releases (e.g., v1.0.0), and without protection, any user with sufficient repository access could create, overwrite, or delete a release tag, undermining the integrity and traceability of the project's release history.


Rationale:

Release tags are often treated as immutable markers representing a specific, shipped version of the software. If tags are not protected, a malicious or careless user could delete a tag to erase evidence of a release, or recreate a tag pointing to a different commit, effectively substituting a different version of the code under the same release name. Protecting tags ensures that only trusted, authorized roles can perform these actions, preserving the integrity of the release process.


Impact:

  • Prevent unauthorized users from creating new tags matching the protected pattern.

  • Prevent unauthorized users from deleting existing protected tags.

  • Require a trusted role (e.g., Maintainer or Owner) to create or manage release tags going forward.

  • Improve the reliability and auditability of the project's release history.


Default Value:

Disabled By default, GitLab projects do not have any protected tag patterns configured. Tags are unrestricted until an administrator explicitly protects them. Default setting: No entries in protected_tags


Pre-Requisites:

  • Maintainer or Owner access to the project

  • An existing GitLab project


Test Plan:

  1. Sign in to GitLab at https://gitlab.com.

  2. Navigate to the target project.

  3. Select Settings → Repository.

  4. Locate the Protected Tags section.

  5. Verify that at least one tag name or pattern (e.g., v*) is listed as protected.


Implementation Steps:

  1. Sign in to GitLab at https://gitlab.com.

  2. Navigate to the target project.

  3. Select Settings → Repository.

         

  1. Expand the Protected Tags section and create a tag.

  1. Enter a tag name or wildcard pattern (e.g., v* to protect all version tags).

  1. Set "Allowed to create" to the appropriate minimum role (typically Maintainer or higher).

  2. Click Protect.

Backout Plan:

  1. Sign in to GitLab at https://gitlab.com.

  2. Navigate to Settings → Repository.

  3. Expand the Protected Tags section.

  4. Locate the protected tag pattern that was added.

  5. Click Unprotect to remove the restriction, if this was applied as part of remediation and needs to be reverted.

  6. Confirm that release and tagging operations function as expected after the rollback.


Reference: