Skip to content

git: add signature verification to CacheKey and ResolveMetadata - #6300

Merged
tonistiigi merged 5 commits into
moby:masterfrom
tonistiigi:git-signature-verification
Nov 1, 2025
Merged

tonistiigi merged 5 commits into
moby:masterfrom
tonistiigi:git-signature-verification

Conversation

@tonistiigi

Copy link
Copy Markdown
Member

depends on #6298

I'll probably move the helper utilities to a separate helper repository as they don't need to be buildkit specific. That would also contain the sigstore parts for image verification that we would need to share with moby.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
tonistiigi force-pushed the git-signature-verification branch from 9a7d02a to 81a7983 Compare October 22, 2025 17:12
@tonistiigi
tonistiigi marked this pull request as ready for review October 22, 2025 18:47
Key-Usage: cert
Name-Real: __NAME_REAL__
Name-Email: __NAME_EMAIL__
Expire-Date: 0

@crazy-max crazy-max Oct 24, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was wondering if it would not be easier to have static keys/conf mounted instead of generating them like: https://github.com/crazy-max/ghaction-import-gpg/tree/master/__tests__/fixtures

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key generation is small step of this. The main part is that we need to import these keys into the gpg keychain state in $BUILDKIT_TEST_SIGN_FIXTURES/.gpghome and then create gitconfig with signing wrappers for each user. If we do that anyway, then we would just need to replace the generation command with a command that imports a static private key (pre-prepared for a specific user) to the keychain(probably getting flagged by security scanners for committing private keys to git). So it is really simpler to just generate a new one each time we build the test-integration environment.

@crazy-max crazy-max left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some users have GPG signing-only subkeys and seems go-crypto armor package handles it. Don't think we need extra test for this as we are just doing verification, just fyi.

@crazy-max

Copy link
Copy Markdown
Member

I'll probably move the helper utilities to a separate helper repository as they don't need to be buildkit specific. That would also contain the sigstore parts for image verification that we would need to share with moby.

Yes agreed

@tonistiigi
tonistiigi merged commit a251581 into moby:master Nov 1, 2025
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants