Keyless Git signing using Sigstore
Keyless Git signing with Sigstore!
This is heavily inspired by , but uses keyless Sigstore to sign Git commits with your own GitHub / OIDC identity.
Using Homebrew:
brew install gitsignUsing Go:
go install github.com/sigstore/gitsign@latestSingle Repository:
cd /path/to/my/repository
git config --local gpg.x509.program gitsign # Use gitsign for signing
git config --local gpg.format x509 # gitsign expects x509 args
# Warning: Setting this will make git commit/tag reliant on internet.
# Alternatively, don't use these settings and add the -S flag instead.
git config --local commit.gpgsign true # Sign all commits
git config --local tag.gpgsign true # Sign all tags
All respositories:
git config --global gpg.x509.program gitsign # Use gitsign for signing
git config --global gpg.format x509 # gitsign expects x509 args
# Warning: Setting this will make git commit/tag reliant on internet.
# Alternatively, don't use these settings and add the -S flag instead.
git config --global commit.gpgsign true # Sign all commits
git config --global tag.gpgsign true # Sign all tagsTo learn more about these options, see
git-config.
Gitsign can be configured with a standard git-config file. For example, to set the Fulcio option for a single repo:
$ git config --local gitsign.fulcio https://fulcio.example.comThe following config options are supported:
| Option | Default | Description |
|---|---|---|
| fulcio | https://fulcio.sigstore.dev | Address of Fulcio server |
| logPath | Path to log status output. Helpful for debugging when no TTY is available in the environment. | |
| clientID | sigstore | OIDC client ID for application |
| issuer | https://oauth2.sigstore.dev/auth | OIDC provider to be used to issue ID token |
| matchCommitter | false | If true, verify that the committer matches certificate user identity. See docs/committer-verification.md for more details. |
| redirectURL | OIDC Redirect URL | |
| rekor | https://rekor.sigstore.dev | Address of Rekor server |
| connectorID | Optional Connector ID to auto-select to pre-select auth flow to use. For the public sigstore instance, valid values are: |
https://github.com/login/oauthhttps://accounts.google.comhttps://login.microsoftonline.com |
| tokenProvider | | Optional OIDC token provider to use to fetch tokens. If not set, any available providers are used. valid values are:interactivedevice (OAuth 2.0 device flow — for headless / remote-SSH workflows)spiffegoogle-workload-identitygoogle-impersonationgithub-actionsfilesystembuildkite-agent |
| timestampServerURL | | Address of timestamping authority. If set, a trusted timestamp will be included in the signature. |
| timestampCertChain | | Path to PEM encoded certificate chain for RFC3161 Timestamp Authority verification. |
| autoclose | true | If true, autoclose the browser window after autocloseTimeout. In order for autoclose to work you must also set connectorID. |
| autocloseTimeout | 6 | If autoclose is true, this is how long to wait until the window is closed. |
| enableSigstoreGo | true | If true (the default), use the sigstore-go libraries for signing and verification via the CMS↔bundle compatibility layer, for both online and offline Rekor modes. Set to false to fall back to the legacy CMS + Rekor path. The on-disk signature format is unchanged. See docs/bundle-cms.md for more details. |
| rekorVersion | 1 | (Experimental) Rekor API version to upload signatures to. One of [1, 2] (default: 1).
1 - the legacy Rekor v1 REST API.
2 - the Rekor v2 / rekor-tiles API. Can only be set when the sigstore-go signing path is enabled (enableSigstoreGo=true, the default). |
| urlOpener | | Optional command used to open the OIDC login URL during the interactive auth flow. If unset, the platform default browser is used. The command is split using shell-style word splitting (quote arguments containing spaces) and each token is rendered as a Go text/template with the login URL available as {{.URL}} (e.g. firefox --new-tab {{.URL}}). No shell is invoked, so shell metacharacters are inert. See docs/url-opener.md for examples, including opening a specific Chrome profile. || Environment Variable | Sigstore
Prefix | Default | Description | | ---------------------------- | ------------------ | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | GITSIGN_CREDENTIAL_CACHE | | | Optional path to gitsign-credential-cache socket. | | GITSIGN_CONNECTOR_ID | ✅ | | Optional Connector ID to auto-select to pre-select auth flow to use. For the public sigstore instance, valid values are:
https://github.com/login/oauthhttps://accounts.google.comhttps://login.microsoftonline.com |
| GITSIGN_TOKEN_PROVIDER | ✅ | | Optional OIDC token provider to use to fetch tokens. If not set, any available providers are used. valid values are:interactivedevice (OAuth 2.0 device flow — for headless / remote-SSH workflows)spiffegoogle-workload-identitygoogle-impersonationgithub-actionsfilesystembuildkite-agent |
| GITSIGN_FULCIO_URL | ✅ | https://fulcio.sigstore.dev | Address of Fulcio server |
| GITSIGN_LOG | ❌ | | Path to log status output. Helpful for debugging when no TTY is available in the environment. |
| GITSIGN_OIDC_CLIENT_ID | ✅ | sigstore | OIDC client ID for applicationNo open issues yet, or sync has not completed.