Description:
This check verifies that commits pushed or merged into the default branch are required to be cryptographically signed. Commit signatures help verify commit authenticity and ensure code changes come from trusted contributors.
Note: This check requires a GitLab Premium or Ultimate plan. The setting it evaluates depends on a paid feature that isn’t available on the Free plan.On the Free plan, the setting doesn’t appear in the GitLab UI or API, so it can’t be configured. The check will show as Failed or Not applicable, regardless of how the rest of the group or project is set up.
Rationale:
Unsigned commits make it difficult to verify contributors' identities and the integrity of code changes. Requiring signed commits strengthens software supply chain security by ensuring that commits can be traced to authenticated users and have not been tampered with after creation.
Impact:
Require contributors to configure GPG, SSH, or X.509 commit signing.
Prevent unsigned commits from being pushed or merged.
Increase administrative effort during initial setup.
Improve traceability, accountability, and code integrity.
Default Value:
By default, GitLab does not enforce signed commits on protected branches or the default branch. Default setting: Reject unsigned commits: Disabled.
Pre-Requisites:
Maintainer or Owner access to the project
An existing GitLab project
Test Plan:
Sign in to GitLab at https://gitlab.com.
Navigate to the target project.
Select Settings → Repository.
Locate the Push Rules section.
Review the configured push rules.
Verify that commit signature verification is enforced.
Confirm that unsigned commits are rejected when pushed to the default branch.
Implementation Steps:
Sign in to GitLab at https://gitlab.com.
Navigate to the target project.
Select Settings → Repository.
Expand the Push Rules section.
Enable the option to reject unsigned commits (if available in your GitLab edition).
Save the configuration.
Backout Plan:
Sign in to GitLab at https://gitlab.com.
Navigate to the target project.
Select Settings → Repository.
Expand the Push Rules section.
Disable the commit signature enforcement rule.
Save the changes.
Reference:
https://docs.gitlab.com/ee/user/project/repository/push_rules.html
https://docs.gitlab.com/ee/user/project/repository/signed_commits/
https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/