From 2f9b59ce637f23d0a44188d174f32fc51f0195e6 Mon Sep 17 00:00:00 2001 From: Brandon Julio Thenaro <44537252+brandon-julio-t@users.noreply.github.com> Date: Sat, 28 Nov 2026 20:51:44 +0700 Subject: [PATCH] Allowlist Socket's package-verdict API for Bun security scanner Bun runs its native install security scanner during `bun update`, so a Bun repository using @socketsecurity/bun-security-scanner in anonymous free mode fails every update job under egress enforcement: proxy | * egress not allowlisted firewall-api.socket.dev error: Security scanner failed: Socket Security Scanner: Received 403 from server Add the exact host to the shared npm/Bun anchor. Child hosts and sibling Socket hosts stay blocked. Fixes #368 Co-Authored-By: Claude Opus 5.5 --- internal/handlers/egress_allowlist_defaults.yaml | 4 ++++ internal/handlers/egress_allowlist_test.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/internal/handlers/egress_allowlist_defaults.yaml b/internal/handlers/egress_allowlist_defaults.yaml index 44e66e3..025068d 100644 --- a/internal/handlers/egress_allowlist_defaults.yaml +++ b/internal/handlers/egress_allowlist_defaults.yaml @@ -253,6 +253,10 @@ ecosystem_default_domains: # Backstage's published version manifests, read by the Backstage CLI during # upgrades. Anonymous, no redirects. - versions.backstage.io + # Socket's package-verdict API, queried by Bun's native install security + # scanner (@socketsecurity/bun-security-scanner) in anonymous free mode. + # Exact only; sibling Socket hosts stay blocked. + - firewall-api.socket.dev bun: *npm_registries pip: &python_registries - pypi.org diff --git a/internal/handlers/egress_allowlist_test.go b/internal/handlers/egress_allowlist_test.go index 4080fee..371cc5c 100644 --- a/internal/handlers/egress_allowlist_test.go +++ b/internal/handlers/egress_allowlist_test.go @@ -749,6 +749,7 @@ func TestEgressAllowlist_NewEntriesDoNotWidenBeyondExactHosts(t *testing.T) { "https://evil.repo.osgeo.org/repository", "https://evil.androidx.dev/snapshots", "https://evil.pkg.pr.new/owner/repo", + "https://evil.firewall-api.socket.dev/purl", "https://evil.julialang-s3.julialang.org/bin", "https://evil.maven.artifacts.atlassian.com/maven", "https://evil.mirrors.huaweicloud.com/repository/npm", @@ -949,6 +950,7 @@ func TestEgressAllowlist_AdditionalEcosystemsAllowDefaults(t *testing.T) { "opentofu": "https://registry.opentofu.org/v1/modules", "elm": "https://package.elm-lang.org/packages/elm/core/latest", "deno": "https://jsr.io/@std/assert", + "bun": "https://firewall-api.socket.dev/purl/pkg%3Anpm%2Freact%4019.2.0", "bazel": "https://bcr.bazel.build/modules/rules_go", "julia": "https://pkg.julialang.org/registries", "rust_toolchain": "https://static.rust-lang.org/dist/channel-rust-1.80.toml",