Skip to content

ci(scout): fetch the Scout binary with the job's token, and pin the action - #111

Merged
maksimtech merged 1 commit into
mainfrom
ci/scout-binary
Nov 22, 2026
Merged

maksimtech merged 1 commit into
mainfrom
ci/scout-binary

Conversation

@maksimtech

Copy link
Copy Markdown
Owner

The last of the six; same as maksimtech/apkradar#122, maksimtech/mailradar#132, maksimtech/cookieradar#102, maksimtech/exeradar#59, maksimtech/releaseradar#61, all merged and tried on main.

Why

Docker Scout fails now and then with Unexpected HTTP response: 403, right after Downloading asset: docker-scout-action_linux_amd64, before scanning anything (here on 2026-10-11, 10-15, 10-17 and 11-21); Security Posture after it is then skipped. docker/scout-action downloads that binary from api.github.com without authentication (tc.downloadTool(asset.url, binary, undefined, …)), on the 60-an-hour budget of the runner's shared address. Upstream: docker/scout-action#116.

And the two Scout steps ran different, unchosen versions: @v1 (a moving tag, v1.30.0 since 2026-11-20) in docker-scout.yml, v1.24.0 in docker.yml.

What

  • Both Scout steps pinned to docker/scout-action@e7e2a72… # v1.29.0 (published 2026-10-28), the version the other Radars run. For docker.yml this is an upgrade from 1.24.0.
  • .github/scripts/fetch_scout_binary.sh <commit> <tag>, run with GH_TOKEN before each Scout step: checks the tag is the pinned commit, downloads the binary authenticated, checks the published SHA-256, puts it in the action's dist/. If the directory is not there or the download fails, it warns and the action downloads as before.
    • docker.yml checks out the version it builds (ref: inputs.version on a dispatched rebuild), and a version older than this change has no script; there the step warns and the action downloads as it always did. A release from now on carries the script.
  • tests/test_scout_binary.py (same file as the other Radars').

Left for the alignment with apkradar, not here: the other actions of docker-scout.yml are on moving tags too (actions/checkout@v7, docker/login-action@v4, upload-sarif@v4), and its scan runs cves,recommendations in one step.

Checks

  • The new test failed before the change, on the @v1 pin and the two missing steps.
  • pytest: 2431 passed, 4 skipped. ruff check src tests benchmarks scripts tools: clean.
  • Docker Scout does not run on pull requests, so docker-scout.yml is dispatched on this branch to run the step on a real runner before merge. docker.yml publishes, so it is not dispatched.

Not to be auto-merged: merge by hand after review.

🤖 Generated with Claude Code

…ction

docker/scout-action downloads its binary from api.github.com without
authentication, on the 60-an-hour budget of the runner's shared
address: when it is spent the scan fails with a 403 before looking at
the image (docker/scout-action#116). fetch_scout_binary.sh fetches it
first with GH_TOKEN and puts it in the action's dist/, after checking
the tag against the pinned commit and the file against the published
SHA-256. docker.yml checks out the version it builds, so for an older
version with no script it warns and the action downloads as before.

The weekly scan used docker/scout-action@v1, a moving tag, and the
image's scan v1.24.0: both now pinned to the commit of v1.29.0, as in
the other Radars. Same as maksimtech/apkradar#122.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@maksimtech maksimtech added the enhancement New feature or request label Nov 22, 2026
@codspeed

codspeed Bot commented Nov 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 11 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 17 untouched benchmarks


Comparing ci/scout-binary (7af8683) with main (7734b45)

Open in CodSpeed

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@sonarqubecloud

Copy link
Copy Markdown

@maksimtech
maksimtech merged commit a3d8931 into main Nov 22, 2026
24 of 25 checks passed
@maksimtech
maksimtech deleted the ci/scout-binary branch November 22, 2026 12:26
maksimtech added a commit that referenced this pull request Nov 22, 2026
Docker Scout reported it on main on 2026-11-22, after #111, and
Security Posture failed. crl_crldp_check costs CPU time quadratic in
the number of CRL distribution points of a certificate verified with
CRL checking on (openssl/openssl#33546; no advisory, no Debian fix).
Not reachable: patchradar's only TLS is httpx with Python's default
context, which enables no CRL checking. Scout-only; reviewed on
2026-12-15 with the other OpenSSL entries (maksimtech/apkradar#124).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
maksimtech added a commit that referenced this pull request Nov 22, 2026
Codecov files an upload under the project its token belongs to. This
repository's CODECOV_TOKEN secret held exeradar's token, so every
coverage report since at least 2026-10-17 went to exeradar's project,
and codecov/patch on #111 waited for one that never came.

The upload now uses OIDC (use_oidc: true; id-token: write on the test
job, contents: read repeated since job permissions replace the
workflow's): GitHub tells Codecov which repository the job runs in.
test_the_upload_is_given_a_token becomes a test that requires OIDC and
forbids the secret. Same as maksimtech/mailradar#135.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant