feat(firewall): download from a random origin with cross-origin fallback - #18
Open
Julian Gruber (juliangruber) wants to merge 2 commits into
Open
Julian Gruber (juliangruber) wants to merge 2 commits into
Julian Gruber (juliangruber) wants to merge 2 commits into
Conversation
Julian Gruber (juliangruber)
force-pushed
the
julian/sfw-mirror-origin
branch
from
September 29, 2026 12:00
1abae1f to
b5cc177
Compare
Julian Gruber (juliangruber)
changed the base branch from
ruxandrafediuc/bump-sfw-1.15.2-and-download-retry
to
main
September 29, 2026 12:00
Julian Gruber (juliangruber)
added a commit
that referenced
this pull request
Sep 29, 2026
Review on #18: firewallDownloadUrls now returns the equivalent origins in a fixed order, GitHub first. The per-job coin flip lives in orderDownloadOrigins, which downloadFirewall applies to that list. The mirror constant is named for the edition it serves.
This comment was marked as outdated.
This comment was marked as outdated.
Julian Gruber (juliangruber)
marked this pull request as ready for review
September 30, 2026 10:15
Julian Gruber (juliangruber)
changed the base branch from
main
to
fix/bump-sfw-1.15.3
September 30, 2026 10:16
Julian Gruber (juliangruber)
force-pushed
the
julian/sfw-mirror-origin
branch
2 times, most recently
from
September 30, 2026 10:24
618166f to
30e5c79
Compare
Julian Gruber (juliangruber)
changed the base branch from
fix/bump-sfw-1.15.3
to
main
September 30, 2026 10:24
Julian Gruber (juliangruber)
force-pushed
the
julian/sfw-mirror-origin
branch
from
September 30, 2026 10:25
30e5c79 to
c7ff378
Compare
This was referenced Sep 30, 2026
The free-edition binary is now downloadable from two origins: GitHub release assets, and the Socket-owned mirror at install.socket.dev/firewall/dl/<version>/<binary> (served by firewall-download-server in depscan). firewallDownloadUrls returns the equivalent origins in a fixed order; downloadFirewall tries them in a Fisher-Yates permutation from shuffledIndexes, so roughly half the fleet's downloads keep the mirror's edge cache warm, which is what lets it keep serving pinned binaries during a GitHub release-asset incident. Adding a third origin needs no change to the selection. downloadToolWithRetry takes the origin list and alternates across the existing 30s/60s retry schedule. An error a retry cannot change (a 404) still gets one immediate try of the other origin, because a missing asset on one host says nothing about the other. The checksum table in this action's source validates every download regardless of origin, so the second host cannot alter what gets installed. Enterprise stays GitHub-only: firewall-release is private and not mirrored. test-sfw-mirror.yml runs on every pull request and forces the failure this guards against: GitHub or the mirror pointed at 127.0.0.1 in the hosts file, with the install expected to succeed from the other origin on windows-2025 and ubuntu-26.04.
Julian Gruber (juliangruber)
force-pushed
the
julian/sfw-mirror-origin
branch
from
September 30, 2026 13:21
3af8a1e to
b4631d4
Compare
Julian Gruber (juliangruber)
requested a review
from Andre Coetzee (Andre153)
September 30, 2026 13:29
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.
The free-edition binary is now downloadable from two origins: GitHub release assets, and the Socket-owned mirror at
install.socket.dev/firewall/dl/<version>/<binary>(served by SocketDev/depscan#26562). Each job picks one origin at random, so roughly half the fleet's downloads keep the mirror's edge cache warm — which is what lets it keep serving pinned binaries during a GitHub release-asset incident.downloadToolWithRetrynow takes the origin list and alternates across the existing 30s/60s retry schedule. An error a retry cannot change (a 404) still gets one immediate try of the other origin, because a missing asset on one host says nothing about the other — which also makes this safe to merge before the mirror endpoint is deployed: until then the mirror 404s and every download falls through to GitHub at the cost of one request.The checksum table in this action's source validates every download regardless of origin, so the second host cannot alter what gets installed. Enterprise stays GitHub-only:
firewall-releaseis private and not mirrored.dist/is rebuilt.Note
Medium Risk
Changes how production firewall binaries are fetched and verified; incorrect failover or URL logic could break installs, though checksum pinning limits supply-chain impact from the mirror.
Overview
Free-edition
sfwinstalls can now pull from GitHub release assets or a Socket mirror atinstall.socket.dev/firewall/dl; each job shuffles which origin is tried first so traffic keeps the mirror warm during GitHub CDN blips. Enterprise stays GitHub-only.downloadToolWithRetryaccepts multiple equivalent URLs, rotates origins across the existing 30s/60s backoff for retryable failures, and fails over immediately on errors like 404 without waiting—so a dead mirror still falls through to GitHub after one extra request. Pinned SHA256 validation is unchanged for every download.A new CI regression workflow blocks either GitHub or the mirror via the hosts file on Windows and Ubuntu, runs this action with cache disabled, and asserts
sfw --versionstill works. Unit tests cover URL construction, shuffle order, and cross-origin retry behavior;dist/is rebuilt.Reviewed by Cursor Bugbot for commit 3af8a1e. Configure here.