fix: use sigstore/pkg/fulcioroots to lessen deps#746
Merged
laurentsimon merged 3 commits intoslsa-framework:mainfrom Mar 27, 2024
Merged
Conversation
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Contributor
Author
kpk47
approved these changes
Mar 21, 2024
Contributor
|
Thanks. Let's wait for the slsa-verfiier release and merge this. After that we can cut releases more often :) |
laurentsimon
approved these changes
Mar 22, 2024
Contributor
|
Can you rebase? I've enabled auto-merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We've long had the problem that slsa-verifier has too many dependencies.
This PR replaces
"github.com/sigstore/cosign/v2/cmd/cosign/cli/fulcio"with"github.com/sigstore/sigstore/pkg/fulcioroots",removing lot's of unneeded transitive dependencies like
"github.com/aws/aws-sdk-go-v2"and"github.com/Azure/go-autorest/autorest"from ourgo.mod.Investigation
At deps.dep, we can see that the indirect dependencies of
aws/aws-sdk-go-v2come fromcosign/cosign.That's a good start, but this gives us only module-wide dependencies, not package-level dependencies. We can instead use
go mod why <pkg>to get the package-level dependency chain.Now we know that it's our
ghapackage that imports a fulcio package, which imports an aws package.Looking at our
ghapackage we can see that the required methods from fulcio areGet()andGetIntermediates(). Looking at the source codes, we see that"github.com/sigstore/cosign/v2/cmd/cosign/cli/fulcio"'s implementation of these methods is the same as"github.com/sigstore/sigstore/pkg/fulcioroots"'s implementation. So we chose the latter's implementation, which happens to require fewer module-level dependencies.Testing
Future Work
The sigstore-go library is meant to be a more long-term solution, for replacing much of the sigstore-related functionality that slsa-verifier implements directly.