[DEVSVCS-5278] Harden cre update#510
Conversation
…n in update process - Updated getAssetName function to return architecture name along with asset and platform. - Added signature download and verification for Linux before installing the binary. - Updated documentation to reflect the new signature verification process for releases.
45dade9 to
ab205cc
Compare
cre update
…ll package - Removed embedded public key and replaced it with a reference to install.ReleasePublicKey. - Added a test to ensure the embedded public key matches the public_key.asc file. - Updated tests to reflect the changes in public key handling.
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28647461840 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28647724460 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28650130105 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28650681099 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28651527407 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28653626223 Note: These are preview builds and are not signed. |
|
🚀 Preview Build Artifacts You can download the preview builds for this PR from the following URL: https://github.com/smartcontractkit/cre-cli/actions/runs/28656004331 Note: These are preview builds and are not signed. |
DEVSVCS-5278
Summary
Hardens
cre updateby verifying release authenticity before replacing the running binary. Previously, the command downloaded a GitHub release archive, extracted it, and self-replaced with no signature check.Verification is mandatory and fail-closed: any failure aborts before
chmod/replaceSelf. There is no skip flag.Platform verification
install/public_key.ascvia newinstall/keys.go;.sigdownloaded from releasecodesign --verify --strict --identifier com.smartcontract.cre.cliGet-AuthenticodeSignature(Valid +SmartContractin subject)Update flow
On Linux, the matching
.sigasset (e.g.cre_linux_amd64.sig) is downloaded after extraction.Other changes
getAssetName()to returnarchNamefor sig asset namingverify_*.gofiles with build tagsRun()integration via httpmock, and helper testscre updatecommand long help anddocs/cre_update.md