Skip to content

[sec-check] fix: cosign-verify stable image before oras pulls its SBOM - #770

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
sec/fix-oci-sbom-verify
Open

[sec-check] fix: cosign-verify stable image before oras pulls its SBOM#770
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
sec/fix-oci-sbom-verify

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Security Fix

Claims: scripts/update-stream-versions.js pullStableSbom() only. No workflow changes.

The script ran oras discover/oras pull against the mutable ghcr.io/ublue-os/bluefin:stable tag with no signature verification, then fed the SBOM package versions into public/stream-versions.yml, which update-content.yml caches and deploys to the live site. The generated header claims the data comes from cosign-verified attestations — true for the docs.projectbluefin.io pipeline, false for this direct oras path.

This PR:

  • Adds verifyImageDigest(): keyless cosign verify (OIDC issuer https://token.actions.githubusercontent.com, identity regexp ^https://github.com/(ublue-os|projectbluefin)/), returning the verified manifest digest.
  • Adds ensureCosign(): uses PATH cosign when present; otherwise downloads the pinned v3.1.3 release and checks its SHA-256 (4629c757…7f71, from upstream cosign_checksums.txt) before executing.
  • pullStableSbom() now runs oras discover/pull against the digest-pinned ref that cosign actually verified.
  • New unit tests in scripts/tests/verify-oci-sbom.test.ts (digest parsing, issuer/identity args, no-signature and missing-digest errors, cosign failure propagation). 11/11 targeted tests pass; full suite shows only pre-existing failures identical to main.

Refs #768


Filed by sec-check agent (ACMM L4/L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=sec-check backend=copilot model=kimi-k3

pullStableSbom() ran oras discover/pull against the mutable
ghcr.io/ublue-os/bluefin:stable tag with no signature verification,
then deployed the parsed version data to the live site. The generated
header claims the data is cosign-verified; the direct oras path was not.

Now: verify the image with keyless cosign (GitHub Actions issuer,
ublue-os/projectbluefin identity regexp), take the manifest digest
from cosign output, and run oras discover/pull against the
digest-pinned ref. When cosign is not on PATH, download the pinned
v3.1.3 release and verify its SHA-256 before executing.

Refs #768

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added the hold Hold for human review label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Hold for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants