Skip to content

Allowlist Socket's package-verdict API for Bun security scanner - #386

Merged
v-robaiken merged 1 commit into
dependabot:mainfrom
brandon-julio-t:allowlist-socket-bun-scanner
Nov 30, 2026
Merged

v-robaiken merged 1 commit into
dependabot:mainfrom
brandon-julio-t:allowlist-socket-bun-scanner

Conversation

@brandon-julio-t

Copy link
Copy Markdown
Contributor

What are you trying to accomplish?

Closes #368

Bun Dependabot update jobs fail under egress enforcement when the repository uses Socket's native Bun install security scanner (@socketsecurity/bun-security-scanner) in its anonymous free mode. Bun runs the scanner during the updater's bun update, the scanner calls GET https://firewall-api.socket.dev/purl/<encoded-purl>, and the proxy blocks it:

proxy | GET https://firewall-api.socket.dev:443/purl/pkg%3Anpm%2Freact%4019.2.0
proxy | * egress not allowlisted firewall-api.socket.dev
proxy | 403 https://firewall-api.socket.dev:443/purl/pkg%3Anpm%2Freact%4019.2.0
error: Security scanner failed: Socket Security Scanner: Received 403 from server

This adds firewall-api.socket.dev as an exact entry in the shared npm/Bun anchor (&npm_registries), so the scanner keeps running and keeps its verdicts.

Anything you want to highlight for special attention from reviewers?

  • Exact host only. Children such as evil.firewall-api.socket.dev and sibling Socket hosts stay blocked.
  • Anonymous public API, no credentials. Socket's unauthenticated mode sends no auth header. An anonymous request for a public package returns 200 application/x-ndjson with no redirect.
  • Why the shared anchor. It's a package-verdict service, not a registry, so configuring it as a private registry would misrepresent it. The scanner is Bun-native, and the bun ecosystem aliases this anchor.

How will you know you've accomplished your goal?

Two regression tests:

  • TestEgressAllowlist_AdditionalEcosystemsAllowDefaults gains a bun case for the scanner URL. It fails on main and passes with this change.
  • TestEgressAllowlist_NewEntriesDoNotWidenBeyondExactHosts gains evil.firewall-api.socket.dev. I checked that it fails when the entry is changed to the suffix form .firewall-api.socket.dev.

Also ran locally:

  • go test -race -shuffle=on -count=2 ./... (the same command as script/test, run natively rather than in Docker), all packages ok
  • gofmt, go vet ./... and yamllint

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

AI disclosure: Claude Opus 5.5 (claude-opus-5-5, medium reasoning effort) wrote this change and its tests. I reviewed it and take responsibility for it.

🤖 Generated with Claude Code

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 dependabot#368

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandon-julio-t
brandon-julio-t requested a review from a team as a code owner November 28, 2026 13:52
@github-actions github-actions Bot added the allowlist Changes the default egress allowlist label Nov 28, 2026
@brandon-julio-t

Copy link
Copy Markdown
Contributor Author

The two red smoke jobs look like infrastructure failures, not this change. I can't rerun them from a fork:

  • e2e (docker): Docker Hub returned UNAUTHORIZED: authentication required for library/ubuntu pulls.
  • e2e (npm-group-rules): the updater produced no output, so the diff is the entire expected output: block. No request in the log was blocked by egress.

Every other e2e job passed. Could a maintainer rerun the failed jobs?

@brandon-julio-t

Copy link
Copy Markdown
Contributor Author

Follow-up on the two red smoke jobs, compared with other recent Smoke runs:

  • e2e (docker) fails the same way on Bump github/codeql-action/upload-sarif from 4.39.3 to 4.39.5 #387 (run 46281854410, 2026-11-29, a codeql-action bump) and on Allowlist releases.amplify.aws for Swift binary targets #378 (2026-11-20): Docker Hub answers UNAUTHORIZED: authentication required for library/ubuntu. It is not specific to this change.
  • e2e (npm-group-rules) never reached the proxy. The CLI logged pulling image: ghcr.io/dependabot/dependabot-updater-npm and reported update failed expectations 0.6 seconds later, with no proxy or updater output in between. The same job passed in every other Smoke run listed for the past week, so this looks like a one-off image pull failure.

This PR only adds one exact host to egress_allowlist_defaults.yaml plus its test, which neither job reaches. A rerun of the failed jobs should clear them; I can't trigger one from a fork.

@v-robaiken
v-robaiken merged commit b98f6d3 into dependabot:main Nov 30, 2026
107 of 109 checks passed
@brandon-julio-t
brandon-julio-t deleted the allowlist-socket-bun-scanner branch December 1, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allowlist Changes the default egress allowlist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bun security scanner blocked by proxy egress allowlist

2 participants