feat: validate content hash for specified versions#548
Closed
matttrach wants to merge 2 commits into
Closed
Conversation
Signed-off-by: matttrach <matt.trachier@suse.com>
Signed-off-by: matttrach <matt.trachier@suse.com>
Member
|
hi! thanks for the PR instead of having the checksums here as well, we should probably use the checksums file from the release and verify its signature to make sure it has not been tampered with. 🤔 |
Member
|
could also check attestations I think |
Member
|
done in #550 - thanks for bringing this up! |
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.
Main Goal
Our org heavily uses GoReleaser in our CI, and due to recent supply chain attacks we are proactively working to improve our security posture. As part of this process we need every downloaded binary to be verified against a known checksum of the file. This is to prevent a poisoned binary from entering our release process.
This change facilitates validating the GoReleaser binary against a known checksum hard coded into this repository.
I have backfilled all checksums from version 0.182.0 forward to give us a starting point. From here we can add the checksum for each new GoReleaser binary as it is released. I have included a script to make this easier.
Solving for Latest
Some users may not have the strict requirements we have, so I have short-circuited the validation when a version isn't pinned. This prevents failures for users who run on latest before the checksum for the latest GoReleaser release has been added here.
I have added tests to validate the functionality and verify that the short circuit is working properly.
I believe that anyone pinning the version of GoReleaser is more than likely concerned with validating the checksum as well.
Extra
I also ran
npx depcheckand resolved any errors it found to remove unnecessary dependencies.I added an exponential backoff with a max of 30sec to the GitHub calls to better handle API latency.