feat(install): install from install.socket.dev/patch — trusted origin for the curl|sh installer - #145
Open
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Open
feat(install): install from install.socket.dev/patch — trusted origin for the curl|sh installer#145Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
curl -fsSL https://install.socket.dev/patch | sh The documented one-liner pointed at raw.githubusercontent.com. That asks a user to trust a third-party CDN for a script they pipe into a shell, and it is the first URL a locked-down egress policy blocks. install.socket.dev is a name Socket controls, already inside the trust boundary a customer grants socket.dev, and stable if the artifacts ever move. What the host serves is a byte-for-byte copy of scripts/install.sh, with its SHA-256 alongside it at /patch.sha256 — the README tells people to diff it, so that has to hold literally. The GitHub raw URL keeps working and serves the same bytes, for anyone who would rather not depend on the Socket domain. The trust model is unchanged and the docs are careful not to imply otherwise: binaries still come from the GitHub release and are still verified against its SHA256SUMS, and nothing is signed. Hosting the script moved who serves the script, nothing more. docs/installer-hosting.md is the runbook for the part that is not obvious from this repository: the copy is published out of depscan's vendored submodules/socket-patch pin, so an installer change here goes live on a submodule bump + deploy — while a new socket-patch release needs no publish at all, since the script resolves the latest release itself at run time. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three gaps around the thing users are told to pipe into a shell: 1. install.sh was only shellchecked, never run. CI now installs with it end to end and execs the result, so "downloads the latest release, verifies SHA256SUMS, produces a binary that starts" is asserted on every PR instead of discovered by a user. (It installs the latest RELEASE, not the checkout — on a bump PR that is deliberately the previous version.) 2. Nothing kept the URL consistent. The README, the script's own usage comment, and the hosting runbook all name it; a grep guard fails if any of them drifts. 3. Nothing checked the HOSTED copy. install.socket.dev/patch is published from depscan's submodule pin, so it can lag this repo silently. The new `installer-drift` workflow (weekly + dispatch) diffs the served bytes against scripts/install.sh, verifies the published checksum, and shellchecks what is actually served. The drift job is deliberately not part of CI: it tests a deployed artifact, so a red run means "bump the pin in depscan", not "this PR is broken". Two behaviors keep it honest rather than noisy — if the host does not resolve it reports "not deployed yet" and passes, so it is inert until the domain exists; and if the host answers non-200 it surfaces the specific failure this design is exposed to, a Cloudflare bot challenge, which would otherwise feed an HTML interstitial to sh. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What
Points the documented one-liner at a Socket-controlled domain:
curl -fsSL https://install.socket.dev/patch | shinstall.socket.dev/patchserves a byte-for-byte copy ofscripts/install.sh, withits SHA-256 at
/patch.sha256. Theraw.githubusercontent.comURL keeps working andserves the same bytes — the README keeps it as the alternative for anyone who would rather
not depend on the Socket domain.
The domain itself is stood up in the companion depscan PR, SocketDev/depscan#23840. Nothing here
breaks before that lands — the drift workflow is inert until the host resolves, and the
README's alternative URL works today.
Why
The old URL asks a user to trust a third-party CDN for a script they pipe into a shell,
and it is the first URL a locked-down egress policy blocks.
install.socket.devis a nameSocket controls, already inside the trust boundary a customer grants
socket.dev, and itstays stable if the artifacts ever move.
The trust model is unchanged, and the docs are careful not to imply otherwise. Binaries
still come from the GitHub release and are still verified against its
SHA256SUMS. Nothingis signed. Hosting the script moved who serves the script, nothing more.
Commits
feat(install): install from install.socket.dev/patchinstall.sh's own usage comment +docs/installer-hosting.md+ CHANGELOGci(install): run the installer, pin its URL, and watch the hosted copyinstaller-driftworkflowCI additions
Three gaps around the artifact users are told to pipe into a shell:
install.shwas only shellchecked, never run. CI now installs with it end to endand execs the result. It installs the latest release, not the checkout — on a
version-bump PR that is deliberately the previous version. Verified the current release
has the assets and
SHA256SUMSformat the script'sawkexpects(
socket-patch-x86_64-unknown-linux-gnu.tar.gzmatches onv3.3.0), so this steppasses as written.
the runbook. A grep guard fails if any of them drifts.
installer-drift(weekly +workflow_dispatch)diffs the served bytes against
scripts/install.sh, verifies the published checksum,and shellchecks what is actually served.
installer-driftis deliberately not part of CI: it tests a deployed artifact, so ared run means "bump the submodule pin in depscan", not "this PR is broken". Two behaviors
keep it honest rather than noisy:
Cloudflare bot challenge, which would otherwise feed an HTML interstitial to
sh.Sequencing
The hosted copy is published from depscan's vendored
submodules/socket-patchpin, so:submodules/socket-patchto that commit (its pin is currently 19 commitsbehind
main, andinstall.shdoes differ —mainhas the SC2144detect_libcfix);
installer-driftwill be red in the window between (1) and (3). That is the signal workingas designed — its error message says exactly which bump is missing.
A new socket-patch release needs none of this: the script resolves the latest release
itself at run time, so only edits to the script require a publish.
Verified locally
shellcheck --shell=sh scripts/install.shandsh -n scripts/install.sh— cleanscripts/release-lint.shversion coherence OK (its CHANGELOG[3.3.0]complaint ispre-existing on
mainand only gates bump PRs)SHA256SUMSline format confirmed against the livev3.3.0releaseNot run locally: the end-to-end install step (it installs into
/usr/local/bin) — CI isits first real execution.
Follow-up, not in scope
No Windows installer.
install.shis POSIXsh; native Windows users go through apackage manager or a release archive. A
patch.ps1object on the same host is the naturaladdition and the hosting side already supports it — left out rather than shipped untested
from a macOS dev box.