Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chainguard Enforce configuration #49

Merged
merged 1 commit into from
Sep 9, 2022
Merged

Add Chainguard Enforce configuration #49

merged 1 commit into from
Sep 9, 2022

Conversation

JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Sep 7, 2022

Chainguard Enforce is a GitHub app that verifies container signatures.
It's able to verify signatures using Sigstore's keyless signing as well
as GPG keys. This is already set up and working in the audit event
library
.

The provided configuration will verify that folks are using sigstore's
keyless signatures on their commits, and will also accept GitHub API's
GPG keys to have apps like renovate have valid signatures.

To set up keyless signatures, use gitsign [1]. If on mac, you may
install it as follows:

brew install sigstore/tap/gitsign

And set it up in this repository only:

cd /path/to/this/repository
git config --local commit.gpgsign true  # Sign all commits
git config --local tag.gpgsign true  # Sign all tags
git config --local gpg.x509.program gitsign  # Use gitsign for signing
git config --local gpg.format x509  # gitsign expects x509 args

This shouldn't be set for all repositories as it will add references to
the repositories and branches o a public transparency log, which you
don't want in a private or internal GitHub repository.

[1] https://github.com/sigstore/gitsign

Signed-off-by: Juan Antonio Osorio juan.osoriorobles@eu.equinix.com

@JAORMX JAORMX requested a review from a team as a code owner September 7, 2022 10:45
Chainguard Enforce is a GitHub app that verifies container signatures.
It's able to verify signatures using Sigstore's keyless signing as well
as GPG keys. This is already set up and working in the [audit event
library](https://github.com/metal-toolbox/auditevent).

The provided configuration will verify that folks are using sigstore's
keyless signatures on their commits, and will also accept GitHub API's
GPG keys to have apps like renovate have valid signatures.

To set up keyless signatures, use gitsign [1]. If on mac, you may
install it as follows:

```bash
brew install sigstore/tap/gitsign
```

And set it up in this repository only:

```bash
cd /path/to/this/repository
git config --local commit.gpgsign true  # Sign all commits
git config --local tag.gpgsign true  # Sign all tags
git config --local gpg.x509.program gitsign  # Use gitsign for signing
git config --local gpg.format x509  # gitsign expects x509 args
```

This shouldn't be set for all repositories as it will add references to
the repositories and branches o a public transparency log, which you
don't want in a private or internal GitHub repository.

[1] https://github.com/sigstore/gitsign

Signed-off-by: Juan Antonio Osorio <juan.osoriorobles@eu.equinix.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Merging #49 (005cf72) into main (82aa63d) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #49   +/-   ##
=======================================
  Coverage   73.81%   73.81%           
=======================================
  Files          10       10           
  Lines         550      550           
=======================================
  Hits          406      406           
  Misses        115      115           
  Partials       29       29           
Flag Coverage Δ
unittests 73.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@matoszz
Copy link
Collaborator

matoszz commented Sep 8, 2022

@JAORMX does that mean that by enabling this, we're restricting the repo to only signed commits from sigstore's keyless signatures ?

@JAORMX
Copy link
Collaborator Author

JAORMX commented Sep 8, 2022

@matoszz kinda. This configuration will accept keyless signatures that are verified via the public sigstore instance AND GitHub API's GPG signature which makes bots like Renovate work. However, Enforce is currently not strictly enforcing. Meaning, folks will still be able to merge work even if it doesn't pass the code commit checks. This is on purpose to start rolling this out and get folks' feedback. The only thing that will happen right now is that they'll get an ugly red cross in CI saying that commit verification has failed.

@adammohammed
Copy link
Contributor

adammohammed commented Sep 8, 2022

The 'unverified' UI element that shows up is not the most intuitive thing. Is there a way to get GitHub to trust the sigstore issuer?

@JAORMX
Copy link
Collaborator Author

JAORMX commented Sep 9, 2022

@adammohammed not at the moment. This is a GitHub limitation that is actually being worked on by the GitHub team, but there is no estimate on when they'll get it sorted.

@JAORMX JAORMX merged commit 5700086 into main Sep 9, 2022
@JAORMX JAORMX deleted the chainguard-enforce branch September 9, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants