{"id":27165019,"url":"https://github.com/mocdaniel/signed-commits-case-study","last_synced_at":"2026-01-21T03:31:53.430Z","repository":{"id":182352329,"uuid":"668358567","full_name":"mocdaniel/signed-commits-case-study","owner":"mocdaniel","description":"A short discussion of different commit-signing methods and how they are interpreted by GitHub","archived":false,"fork":false,"pushed_at":"2023-07-19T16:25:13.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T02:51:13.368Z","etag":null,"topics":["docs","how-to"],"latest_commit_sha":null,"homepage":"https://dbodky.me","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mocdaniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-19T16:03:36.000Z","updated_at":"2023-10-25T07:48:31.000Z","dependencies_parsed_at":"2023-07-19T17:49:15.824Z","dependency_job_id":null,"html_url":"https://github.com/mocdaniel/signed-commits-case-study","commit_stats":null,"previous_names":["mocdaniel/signed-commits-case-study"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mocdaniel/signed-commits-case-study","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fsigned-commits-case-study","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fsigned-commits-case-study/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fsigned-commits-case-study/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fsigned-commits-case-study/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mocdaniel","download_url":"https://codeload.github.com/mocdaniel/signed-commits-case-study/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mocdaniel%2Fsigned-commits-case-study/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28624506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T02:47:06.670Z","status":"ssl_error","status_checked_at":"2026-01-21T02:45:44.886Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docs","how-to"],"created_at":"2025-04-09T02:50:48.770Z","updated_at":"2026-01-21T03:31:53.407Z","avatar_url":"https://github.com/mocdaniel.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Signed Commits - a case study\n\nSigning commits drastically hardens your repository against attempts to commit malicious code, e.g. via commit spoofing. Commit signing in addition to some features of GitHub, such as [Vigilant mode](https://docs.github.com/en/authentication/managing-commit-signature-verification/displaying-verification-statuses-for-all-of-your-commits), can help you make sure to only accept verified commits by contributors you know and trust. \n\nThis repository attempts to serve as a demo of the \"look 'n feel\" of commit signing on GitHub, and the different possibilities to do so.\n\nWe will look at three ways to sign commits - using `GPG` keys, `SSH` keys, and `gitsign` - and what the results look like on GitHub.\n\n## Using GPG keys\n\n### 1. Commit - signed by a valid user\n\nThe first commit is an authentic one:\n\n- it was drafted by the **repository's owner** (`mocdaniel`) from his **verified email address** (`dbodky@gmail.com`)\n- it has been signed by a GPG key which has been **linked** to the author's account.\n\nYou can have a look at the **commit history** of a repository at all times by navigating to the `Commits` tab in the top of the repo, or [following this link](https://github.com/mocdaniel/signed-commits-case-study/commits/main).\n\n### 2. Commit - signed with a non-verified GPG key\n\nThe second commit is a bit weird:\n\n- it seems to originate from `mocdaniel`\n- **but** the GPG key is `unverified`?\n\nMaybe the user just messed up his key management, or he forgot to **upload his public gpg signing key** for this key. Maybe it's a quite intricate attempt of getting malicious code in - in general it's better do decline commits like this or have a proper second look!\n\nYou can do so by cloning the repository and looking at the history via `git log --show-signature`, btw:\n\n```console\ngit log --show-signature\ncommit 1bc84ab1f6b65e55e9dfec883fbe65c494d689d5 (HEAD -\u003e main)\ngpg: Signature made Wed 19 Jul 2023 06:07:01 PM CEST\ngpg:                using EDDSA key 5530A1A2EF240BCE0AE9185EF478C71B38B9AD9E\ngpg: Good signature from \"Daniel Bodky \u003cdaniel.bodky@netways.de\u003e\" [ultimate]\nAuthor: Daniel Bodky \u003cdbodky@gmail.com\u003e\nDate:   Wed Jul 19 18:07:01 2023 +0200\n\n    Second commit\n\ncommit 60b9d6a151cd08a21f134bb941cb4dbfc9cf395a\ngpg: Signature made Wed 19 Jul 2023 06:05:13 PM CEST\ngpg:                using EDDSA key 738DC9BC3F567CB282E5B29C9E12D1B1F1A84FA8\ngpg: Good signature from \"Daniel Bodky \u003cdbodky@gmail.com\u003e\" [ultimate]\nAuthor: Daniel Bodky \u003cdbodky@gmail.com\u003e\nDate:   Wed Jul 19 18:05:13 2023 +0200\n\n    First commit\n```\n### 3. Commit - Who's cloudnativeclutter?!\n\nThe third commit is *definitely* weird:\n\n- it shows **cloudnativeclutter** (my blog's GitHub user) as author\n- again, the commit is `unverified`, this time because I got **vigilant mode** configured for this account\n\nSpoofing commits is as easy as changing the `user.email` and `author.email` field of your git config, thus changing the email address **GitHub** sees upon committing. Since GitHub is a **collaborative coding platform**, it will try to resolve this email address and display the author's information - totally fooling everyone who doesn't look twice!\n\n\n## Using SSH keys\n\n### 4. Commit - signed with a verified SSH key\n\nThe fourth commit is very similar to the first one:\n\n- it comes from the repository's owner\n- it is `verified`\n\nThe only difference is a tiny detail: Instead of a **GPG Key ID** we see a **SSH Key Fingerprint** when clicking on the `verified` badge now.\n\n### 5. Commit - signed with an unverified SSH key\n\nLet's go ahead and sign our fifth commit with a non-verified SSH key, similar to commit 2:\n\n- the author is correct\n- ...but the signature isn't\n\nOnce again, GitHub warns uns that it couldn't verify whether the stated author actually *is* the author, due to the signature not being verified. That's good!\n\n### 6. Commit - We've been blessed by Octocat!\n\nThe sixth commit seems off again. Octocat has contributed to this humble guide?\n\n- this time, it's worse - Octocat doesn't seem to use commit signatures!\n- the commit seems authentic, and without a `(un)verified` badge, it's hard to tell who wrote this commit.\n\nThis is a perfect example of how easy it is to spoof arbitrary identities on GitHub for malicious purposes.\n\n## Using `gitsign`\n\nThe third method I want to show is `gitsign`, a way to do keyless commit signing! If you don't feel like fiddling with  GPG or SSH keys, this might be for you. More information about gitsign as a tool can be found on [the project's repository](https://github.com/sigstore/gitsign).\n\n`gitsign` signs your commits using your very own **GitHub** or **OIDC** entity. All you need to do is to configure your local repository (or global settings). Once configured, upon (to be signed) commit, a browser window will opeb, and you will have to confirm your identity with the configured OIDC service provider - currently, GitHub, Microsoft, and Google are supported.\n\n### 7. A valid signed commit using gitsign\n\nWhat's that? The heading says it's supposed to be a **valid** commit signature, yet GitHub displays it as `unverified`? This has a reason - `gitsign` takes a different approach to signing commits than the previous methods by using **short-lived** certificates and a signature database called `Rekor` which persists signatures and can be queried in the future to validate existing signatures.\n\nWhile this is not optimal for GitHub's UI, having a remote authority guaranteeing the authenticity of a signature can be helpful for checks in pipelines, scheduled checks, and audits, as the checking entity doesn't need to know whether a used SSH/GPG key is actually valid in the context of the identity used for the commit.\n\nNonetheless, the sigstore team is working together with GitHub to eventually be able to display a shiny `verified` badge on your commit histories, too!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocdaniel%2Fsigned-commits-case-study","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmocdaniel%2Fsigned-commits-case-study","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocdaniel%2Fsigned-commits-case-study/lists"}