Skip to content

ci: attach provenance and SBOM attestations to the published image - #1919

Open
kobihikri wants to merge 2 commits into
basecamp:mainfrom
kobihikri:ci/image-provenance-sbom
Open

kobihikri wants to merge 2 commits into
basecamp:mainfrom
kobihikri:ci/image-provenance-sbom

Conversation

@kobihikri

Copy link
Copy Markdown

Hi, and thanks for Kamal.

.github/workflows/docker-publish.yml publishes the image, but the pushed manifest carries no provenance or SBOM attestation. Someone pulling it cannot check that it was built by this workflow, from this repository, at that tag.

Kamal is in the deployment path rather than beside it — people run it with SSH access to their servers and registry credentials in hand, to put their own applications into production. That is a lot of authority for one container, and there is currently nothing attached to the image that an operator could check before granting it.

The change is two lines on the build step:

          push: ...
          provenance: mode=max
          sbom: true

BuildKit attaches both to the image manifest, so they travel with the image. No permissions change is needed — nothing has to gain id-token.

docker buildx imagetools inspect <image>:<tag> --format '{{ json .Provenance }}'

There is a pleasing symmetry to it as well: Kamal's whole job is getting a known image onto a server, and this makes Kamal's own image one that can be checked the same way.

Two caveats: mode=max records build arguments (provenance: true gives a smaller record if any have ever been sensitive), and attestations add an extra manifest to the index, which the registry supports.

No SLSA level claimed.

Disclosure: I used AI assistance to help spot this and prepare the change, and I read the workflow myself.

Copilot AI review requested due to automatic review settings July 28, 2026 22:58
Copilot AI previously approved these changes Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docker image publishing workflow to attach BuildKit provenance and SBOM attestations to the pushed GHCR image, enabling downstream consumers to inspect supply-chain metadata directly from the image manifest.

Changes:

  • Enable maximum-detail provenance attestation on published images (provenance: mode=max).
  • Enable SBOM attestation generation and attachment (sbom: true).

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 28, 2026 23:25
Copilot AI dismissed their stale review, a newer Copilot review was requested July 28, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@kobihikri

Copy link
Copy Markdown
Author

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, docker/build-push-action adds provenance attestations with mode=max by default — Docker's documentation states it plainly: "Public repos: provenance attestations with mode=max are automatically added". I checked published images and they do already carry attestation manifests. So the provenance: mode=max line in my diff makes existing behaviour explicit; it does not add anything new.

The SBOM is genuinely new. That part stands — the same page says "SBOM attestations aren't automatically added to the image", and sbom: true is what enables them.

I also wrote in the caveats that provenance: true gives "a smaller record". That is wrong as well: true resolves to max on a public repo, and the smaller setting is provenance: mode=min.

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.

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