Skip to content

fix(cli): verify SHA-256 of downloaded release assets - #109

Merged
rodriguecyber merged 1 commit into
Open-Source-Kigali:developfrom
AshSgDe29071999:fix/22-verify-release-checksums
Aug 17, 2026
Merged

fix(cli): verify SHA-256 of downloaded release assets#109
rodriguecyber merged 1 commit into
Open-Source-Kigali:developfrom
AshSgDe29071999:fix/22-verify-release-checksums

Conversation

@AshSgDe29071999

Copy link
Copy Markdown
Contributor

Summary

The CLI downloads a binary and installs it as root with no check that the bytes match what was published. TLS only covers transit.

Changes

  • scripts/build-release.sh writes sha256sum docksight-* > checksums.txt
  • scripts/publish-release.sh requires checksums.txt among expected assets
  • release.Client.VerifyDownloaded fetches checksums.txt, hashes the file, aborts on mismatch
  • Missing checksums.txt (pre-this-change releases) is a warning, not a hard failure
  • Download now compares written bytes to Asset.Size and deletes a truncated file
  • Platform installer and agent installer both verify before selfinstall.Install

Test plan

  • go test ./cmd/internal/release/ ./cmd/internal/installer/ ./cmd/internal/agent/install/

Fixes #22

Publish checksums.txt with each release. Compare the downloaded file
before installing to /usr/local/bin. Missing checksums on older
releases is a warning, not a hard failure. Truncated downloads that
do not match Asset.Size are rejected.

Fixes Open-Source-Kigali#22
@rodriguecyber
rodriguecyber merged commit 5983190 into Open-Source-Kigali:develop Aug 17, 2026
1 check passed
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.

Downloaded release files are never verified

2 participants