Description
This control ensures that only commits signed with a verified GPG, SSH, or S/MIME signature can be pushed or merged into the repository's default branch. GitHub marks such commits as Verified, confirming the identity of the commit author.
Rationale
Requiring signed commits provides assurance that commits were created by the person they claim to be from and have not been tampered with. This reduces the risk of impersonation, unauthorized code injection, and supply chain attacks, and provides a reliable audit trail of who authored each change.
Impact
Commits without a verified signature are rejected on the default branch.
All contributors must configure commit signing (GPG, SSH, or S/MIME) and add their signing keys to their GitHub accounts.
Contributors who push unsigned commits must rebase to sign them and push again.
Improves integrity, non-repudiation, and auditability of code changes.
Default Value
Disabled by default. Repository administrators must explicitly enable signed commits in a ruleset or classic branch protection rule.
Remediation
Branch protection can be configured using rulesets, classic branch protection rules, or both. Complete the section that matches the repository's configuration. The control is met if either configuration enforces the requirement.
Rulesets
Test Plan
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Rules → Rulesets.
Verify that an active branch ruleset targets the default branch and that Require signed commits is enabled.
Create a pull request against the default branch that contains an unsigned commit and attempt to merge it. Expected result: the merge is blocked and GitHub indicates that commits must have verified signatures.
Replace the unsigned commit with a signed commit, confirm that it shows a Verified badge, and attempt to merge again. Expected result: the merge is allowed (subject to any other rules in place).
If no active ruleset targets the default branch or Require signed commits is not enabled, follow the Implementation Steps below to remediate the issue and repeat the test.
Implementation Steps
Ensure that contributors have configured commit signing and added their signing keys to their GitHub accounts.
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Rules → Rulesets.
Click New ruleset and select New branch ruleset, or edit an existing branch ruleset.
Enter a name for the ruleset.
Under Enforcement status, select Active.
Under Target branches, click Add target and select Include default branch.
In the Rules section, enable Require signed commits.
Click Create (or Save changes for an existing ruleset) to apply the ruleset.
Backout Plan
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Rules → Rulesets.
Edit the applicable branch ruleset.
Disable Require signed commits.
Click Save changes.
Verify that unsigned commits can be merged according to the updated configuration.
Classic Branch Protection Rule
Test Plan
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Branches.
Under Branch protection rules, verify that a rule matches the default branch (e.g., main).
Click Edit next to the rule and verify that Require signed commits is selected.
Create a pull request against the default branch that contains an unsigned commit and attempt to merge it. Expected result: the merge is blocked and GitHub indicates that commits must have verified signatures.
If no matching rule exists or Require signed commits is not selected, follow the Implementation Steps below to remediate the issue and repeat the test.
Implementation Steps
Ensure that contributors have configured commit signing and added their signing keys to their GitHub accounts.
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Branches.
Next to Branch protection rules, click Add classic branch protection rule, or click Edit next to an existing rule.
In Branch name pattern, enter the name of the default branch (e.g., main).
Select Require signed commits.
Click Create (or Save changes for an existing rule) to apply the rule.
Backout Plan
Sign in to GitHub with administrative access to the repository.
Navigate to the target repository.
Select Settings.
Under Code and automation, select Branches.
Click Edit next to the applicable branch protection rule.
Clear Require signed commits.
Click Save changes.
Verify that unsigned commits can be merged according to the updated configuration.