Ensure only signed commits are accepted

Framework Reference: A.8.25 (Secure Development Life Cycle) Integration: GitHub – Branch Protection

Why this matters

Signed commits verify the identity of the contributor and ensure that code changes originate from a trusted source.
Unsigned or unverified commits can be spoofed, making it difficult to trace accountability or detect unauthorized modifications.

Requiring signed commits helps to:

  • Guarantee commit authenticity and author integrity
  • Prevent unauthorized or tampered code from entering production
  • Maintain an auditable and trusted commit history

Without this enforcement, malicious actors could impersonate valid contributors or inject unverified changes into critical branches.


What this check does

This check verifies that protected branches (especially the default branch) have the “Require signed commits” option enabled in their branch protection rule.
When active, GitHub will reject any commits that are not signed and verified with a GPG or SSH signature.


How to fix it

From the GitHub Web Console

  1. Go to your repository on GitHub.
  2. Navigate to Settings → Branches.
  3. Under Branch protection rules, click Add rule or edit the existing rule for the default branch (e.g., main).
  4. Scroll to Require signed commits and check the box.
  5. Click Save changes.

From this point forward, commits that are not signed and verified will be rejected when pushed or merged into the protected branch.


Exceptions

  • Only commits signed with verified GPG or SSH keys are accepted. Users must add and verify their signing keys in their GitHub account settings.
  • Admins can bypass this requirement unless “Include administrators” is also enabled in the branch protection rule.
  • Unsigned merge commits created via the web interface will also be rejected.

Further Resources

Was this article helpful?