-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Story
We actually have 3 verification levels possible which each have different use cases and tradeoffs. I have taken to calling this the "anchor" status. The signature will be valid, but the anchor status will tell you at what security level it is anchored to the current tree we are validating it in.
Commit-id signing alone can not suit all use cases, so it is useful to sign all three types of anchors, and then leave it to the end client verifier to assert the trust level based on what security assumptions are true.
Trust Anchor levels
commit
- Signature valid against the commit hash of the ref we are verifying
- Signature invalid after squashing
- Signature invalid after changing commit messages
- Signature invalid after rebasing
- Signature invalid if changeset is moved to a new location in this repo or another repo
tree
- Signature valid against tree hash of the ref we are verifying
- Signature valid after squashing
- Signature valid after changing commit messages
- Signature invalid after rebasing
- Signature invalid if changeset is moved to a new location in this repo or another repo
patch
- Signature valid against patch id hash of the changeset we are verifying
- Signature valid after squashing
- Signature valid after changing commit messages
- Signature valid after rebasing
- Signature valid if changeset is moved to a new location in this repo or another repo
Use Cases
Small team willing to allow only one "ready to merge" changeset at a time
Use "commit" level anchoring and truck on. It is the default and you need
special flags to verify any other way.
Above small team that also wants to be able to squash and amend comments
Consider "tree" level anchoring which offers greater flexibility.
Understand the tradeoff here is that a bad actor can squash all commits into
one and change the commit message to offensive ascii art, but can't actually
change the code.
An organization with many in-flight diffs and reviews merging out of order
Consider "patch" level anchoring for authors/reviewers.
Understand that this can only certify that a given changeset was authored and
reviewed in isolation.
You -must- pair this with a CI system or maintainer(s) that will do one of:
- Do only signed merge commits to master branch
- Sign trusted HEADs/tag with "commit" or "tree" level anchoring post-merge
If you fail to do one of the latter steps to prevent history mutation you are
knowingly creating a security hole and are a terrible person.