[Feature request] Require signed commits from maintainers/collaborators #69706
Unanswered
pnacht
asked this question in
Code Security
Replies: 2 comments 3 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Branch protections and rulesets don't apply to branches on forks of their repository, meaning external contributors won't need to follow any rules such as signing commits on their fork. And as well, if I'm not mistaken (I've never seen a "require signed commits" protection in action so I'm not sure), when you merge the pull request, it will probably create a signed merge commit, whether the commits in the downstream branch (the PR) were signed or not, and doesn't include signatures from the commits that were part of the merge commit. This signed commit can then pass the rule, so I think branch protections should already cover your requested use case. Does that solve it? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Product Feedback
Body
There is a branch protection rule (and equivalent repository rule) to require that all commits be cryptographically signed.
This setting is a tough sell for projects that accept external contributions, since basically nobody signs commits. So a project would have to educate approximately every single contributor how to set up commit signing.
Also, the benefit of signed commits for external contributors is questionable: you (the maintainer) don't know who this person is, so you probably shouldn't trust them regardless of whether they sign their commits.
The only case where it would help is if the project has a highly-engaged and trusted external contributor. An attacker could hijack this user's account to send a malicious PR. If that contributor is forced to sign their commits, it may be possible to detect that the PR is fraudulent. But this is something of an edge case.
However, ensuring maintainers/collaborators sign their commits is much more valuable. These are people that are explicitly trusted: "guaranteeing" that "their" commits are actually theirs is self-evidently useful.
I'd therefore love to see a feature requiring that a repository's maintainers/collaborators must sign all their commits. This could either be a branch protection rule (or equivalent repository rule) or a repository/organization-wide configuration.
All reactions