ci: attach provenance and SBOM attestations to the published images - #6130
ci: attach provenance and SBOM attestations to the published images#6130kobihikri wants to merge 1 commit into
Conversation
SummaryTwo lines on the single FindingsSeverity: Medium Severity: Medium If a target platform is unsupported, either pin an explicit generator ( Severity: Low Positive observationsThe permissions analysis in the description holds up: I checked lines 3-5 and 46-51, and BuildKit attestations pushed through the existing registry logins need no VerdictComment. The diff is correct and low-risk as written; before merging I would confirm the SBOM scanner covers This review was generated automatically; a maintainer may follow up. |
|
Correction — I got a fact wrong in this PR, and I would rather flag it myself than let it sit. I wrote that the pushed manifest "carries no provenance or SBOM attestation". That is half wrong, and the wrong half matters. Provenance is already there. For public repositories, The SBOM is genuinely new. That part stands — the same page says "SBOM attestations aren't automatically added to the image", and I also wrote in the caveats that So the honest description of this PR is: it adds an SBOM attestation, and pins the provenance mode explicitly instead of relying on the default. Both are still defensible — an explicit line means the behaviour will not change quietly if the default ever does — but it is a smaller change than my description implied, and you should judge it on that basis rather than on what I originally wrote. Happy to retitle and rewrite the description accordingly, or to close this if the SBOM alone is not worth the diff to you. Either is fine — just say which and I will act on it. Apologies for the inaccuracy. It was caught by a maintainer reviewing the same change on another project, and they were right to. |
Hi, and thanks for 3x-ui.
.github/workflows/docker.ymlpublishes to bothhsanaeii/3x-uion Docker Hub andghcr.io/mhsanaei/3x-uion every tag, but the pushed manifests carry no provenance or SBOM attestation. Someone pulling the image cannot check that it was built by this workflow, from this repository, at that tag.That felt worth raising for 3x-ui in particular. It is a panel people deploy on a VPS, usually straight from the image with a one-line install, and it holds the credentials for everything it fronts. Where the image came from is exactly the thing a deployer would want to be able to confirm.
The change is two lines on the single build step:
I used BuildKit's own attestation support rather than a separate signing action for a specific reason: your step pushes one build to two registries at once, and BuildKit attaches the attestation to the image manifest itself, so Docker Hub and GHCR both get it with no extra plumbing and no second credential. It also means no permissions change —
contents: readandpackages: writestay exactly as they are, and nothing needsid-token.After a release, anyone can check with:
Two things worth knowing before merging:
mode=maxrecords the full build including build arguments. That is normally right for a public image;provenance: trueproduces a smaller record if you would rather.I have not claimed any SLSA level — the attestation is what BuildKit produces, and how the whole build should be characterised is your call.
Disclosure: I used AI assistance to help spot this and prepare the change, and I read the workflow and both push targets myself.