Skip to content

harden-runner: close two egress-allowlist holes (deps.dev, Sonar binaries) - #95

Merged
nickmarden merged 2 commits into
mainfrom
fix/dependency-review-egress-depsdev
Aug 10, 2026
Merged

harden-runner: close two egress-allowlist holes (deps.dev, Sonar binaries)#95
nickmarden merged 2 commits into
mainfrom
fix/dependency-review-egress-depsdev

Conversation

@nickmarden

@nickmarden nickmarden commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Two unrelated egress holes, both surfacing today. Neither is transient.

1. Dependency Review: fetch failed on every Go module bump

Run 31419996907 (#93, twice). Docker and Actions bumps pass, which makes it look flaky when it isn't.

show-openssf-scorecard defaults to true, so for each added dependency the action needs the package's source repository URL:

  • actions ecosystem: synthesized as github.com/<owner>/<repo> from the package name; no network call.
  • go ecosystem: GitHub's dependency-change API returns source_repository_url: null, so the action falls back to https://api.deps.dev/v3/systems/go/packages/....

That deps.dev call has no error handling upstream (getProjectUrl in src/scorecard.ts), unlike the getScorecard call right after it, which is wrapped in try/catch. With egress blocked the fetch rejects, the rejection escapes main(), and the job dies before reviewing a single dependency. The docker bump touched nothing in the dependency graph, so it had no changes to score at all.

Allows api.deps.dev:443 and api.securityscorecards.dev:443. The Scorecard endpoint was blocked too; it fails quietly, so the Scorecard summary in the job output has just been empty rather than fatal.

2. SonarCloud: Connection refused fetching the scanner CLI

Started at 18:34 UTC today, on main as well as this branch. binaries.sonarsource.com has never been on that job's allowlist; the scan action downloads sonar-scanner-cli-7.0.2.4839-linux-x64.zip from it.

Hidden until now by caching. The action stores the CLI in a version-keyed Actions cache and only downloads on a miss. That cache predates the flip to block mode (ca837dc, Jul 24), and every run since restored it, refreshing its 7-day eviction window. Last restore was the Aug 3 run; seven days on, the cache is gone (gh cache list shows no sonar-scanner-cli entry), so the download ran for real and hit the wall.

Allowing the host lets the cache repopulate. The entry has to stay regardless, since any scanner version bump invalidates the cache key.

Not fixed here

#93 also fails to compile, independent of both of the above: otel/log v0.21.0 drops its own log.KeyValue in favor of attribute.KeyValue, so internal/logger/logger_test.go:135 no longer builds. That fix belongs on the bump branch.

Follow-up

pull_request runs take the workflow file from the PR head, so #93 needs @dependabot rebase after this merges to pick these up.

No CHANGELOG entry: CI egress allowlisting is not user-visible, matching the other harden-runner: commits.

Dependency Review has been failing on every Go module bump with a bare
"fetch failed" (PR #93, run 31419996907) while passing on Docker and
Actions bumps.

show-openssf-scorecard defaults to true, so for each added dependency the
action needs the project's source repo URL. GitHub's dependency-change API
supplies source_repository_url for Actions (and the action synthesizes it
from owner/repo anyway), but leaves it null for most Go modules, so the
action falls back to api.deps.dev to look it up. Unlike the Scorecard
lookup that follows it, that deps.dev call has no error handling upstream,
so egress blocking surfaces as an unhandled fetch rejection and fails the
job before any dependency is reviewed.

Allow api.deps.dev and api.securityscorecards.dev. The latter was also
being blocked; it fails quietly, so the Scorecard summary was empty rather
than fatal.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Docker Image Built

docker pull ghcr.io/tight-line/ballast:pr-95-910c43a

Helm (values override)

image:
  repository: ghcr.io/tight-line/ballast
  tag: "pr-95-910c43a"

Image expires ~15 days after PR closes.

The SonarCloud scan has been failing since 18:34 UTC today with
"failed: Connection refused" while fetching the Sonar Scanner CLI zip.
It is not transient and it is not related to any change we made: the
scan action downloads sonar-scanner-cli from binaries.sonarsource.com,
which has never been on this job's allowlist.

It went unnoticed because the action caches the CLI under a
version-keyed Actions cache and only downloads on a cache miss. The
cache predates the flip to block mode (ca837dc, Jul 24), and every run
since restored it, refreshing its 7-day eviction window each time. The
last restore was the Aug 3 run; seven days later the cache is gone
(`gh cache list` shows no sonar-scanner-cli entry), so the download
started running for real and hit the blocked endpoint.

Allowing the host lets the cache repopulate, after which downloads stop
happening again; the endpoint has to stay allowlisted regardless, since
any scanner version bump invalidates the cache key.
@nickmarden nickmarden changed the title harden-runner: allow deps.dev and the Scorecard API in dependency-review harden-runner: close two egress-allowlist holes (deps.dev, Sonar binaries) Aug 10, 2026
@nickmarden
nickmarden merged commit 212452e into main Aug 10, 2026
10 checks passed
@nickmarden
nickmarden deleted the fix/dependency-review-egress-depsdev branch August 10, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants