Repository navigation
feat(agent-handoff): Verify and pin the CLI installer from the release registry - #130060
Conversation
|
This should be good to go |
|
bigger thought: since toolkit#1962 each release has an then the script and checksum always come from the same release, so there's no mismatch window during a CLI release. the checksum still only comes from the registry, so a tampered script still fails. and the served-hash fetch, registry refresh, ratelimit, fallback and "release in progress" text could all go. |
|
Agreed, I think this works and it's simpler. Some details from checking the current state:
I'll check with @evanpurkhiser, since this replaces most of what's in the PR now. |
|
Ahh OK so basically we would server the latest fixed version from the registry. yes ok this actually does seem a lot better |
|
Jr I think we can simplify even more, do we actually need to download the installer? |
|
Yeah, we don't need to hash it. Done in 29ae569. The runbook now renders:
One caveat: no release has the |
|
jr please rebase ci failing |
…e registry The runbook ran whatever https://cli.sentry.dev/install served, at whatever version it picked. Each CLI release now attaches its install script, and the release registry lists the asset URL and SHA-256. The runbook downloads the script from that release, runs it only if it matches the registry checksum, and pins SENTRY_VERSION to the same release. Without a registry entry it keeps the plain cli.sentry.dev command.
39f78ff to
8836e89
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e973f57. Configure here.
| if not isinstance(sha256, str) or not _SHA256_HEX.fullmatch(sha256): | ||
| return None | ||
|
|
||
| return PinnedInstaller(url=url, version=match["version"], sha256=sha256) |
There was a problem hiding this comment.
Pinned installer reads the wrong registry payload
High Severity
pinned_installer() pulls file_urls.install and files.install.checksums from the cached GET /apps index. That index is summary metadata (same pattern as /sdks); the install URL and SHA-256 live on /apps/sentry/latest, which is not cached. Missing nested fields return None, and the runbook silently emits the old unverified curl | bash command, so checksum pinning likely never activates in production.
Reviewed by Cursor Bugbot for commit e973f57. Configure here.


The private CLI setup runbook (#129764) tells the agent to run
curl -fsSL https://cli.sentry.dev/install | … bash. That runs whatever cli.sentry.dev serves at that moment, at whatever version it picks.Since getsentry/toolkit#1962, each CLI release attaches its
installscript as a GitHub release asset, and the release registry lists its URL (file_urls.install) and SHA-256 (files.install.checksums["sha256-hex"]). The runbook now reads both from the cached/appsregistry entry, downloads the script from that release, runs it only if the hash matches, and pinsSENTRY_VERSIONto the same release. The installer then verifies the CLI binary against the registry's checksums.CLI releases are immutable, but GitHub is what enforces that. Baking in the registry checksum means the script only runs if GitHub and the registry agree, and the check is visible to anyone reading the handoff. Because the script and checksum come from the same registry entry, a CLI release opens no mismatch window.
sentry.agent_handoff.installerpicks the installer and builds the command; the runbook only renders it.github.com/getsentry/toolkit/releases/download/cli@<semver>/installURL and a 64-character lowercase hex checksum are accepted. The pinned version comes from that URL.installentry (self-hosted, or before the first CLI release that ships one), the runbook uses the plaincurl https://cli.sentry.dev/install | bashcommand.via evan.purkhiser, @BYK.
--
View Session [Sentry]