[PR #6130] [MERGED] ci: attach provenance and SBOM attestations to the published images #6091

Closed
opened 2026-11-02 04:06:18 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6130
Author: @kobihikri
Created: 7/28/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @MHSanaei

Base: main ← Head: ci/image-provenance-sbom


📝 Commits (1)

  • 2924654 ci: attach provenance and SBOM attestations to the published images

📊 Changes

1 file changed (+2 additions, -0 deletions)

View changed files

📝 .github/workflows/docker.yml (+2 -0)

📄 Description

Hi, and thanks for 3x-ui.

.github/workflows/docker.yml publishes to both hsanaeii/3x-ui on Docker Hub and ghcr.io/mhsanaei/3x-ui on 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:

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

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: read and packages: write stay exactly as they are, and nothing needs id-token.

After a release, anyone can check with:

docker buildx imagetools inspect ghcr.io/mhsanaei/3x-ui:<tag> --format '{{ json .Provenance }}'

Two things worth knowing before merging:

  • mode=max records the full build including build arguments. That is normally right for a public image; provenance: true produces a smaller record if you would rather.
  • Attestations add an extra manifest to the index. Docker Hub and GHCR both handle it, but it is worth knowing if a mirror ever sits in front.

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6130 **Author:** [@kobihikri](https://github.com/kobihikri) **Created:** 7/28/2026 **Status:** ✅ Merged **Merged:** 8/15/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `ci/image-provenance-sbom` --- ### 📝 Commits (1) - [`2924654`](https://github.com/MHSanaei/3x-ui/commit/29246542819c128331c68aa41ac88575b466391e) ci: attach provenance and SBOM attestations to the published images ### 📊 Changes **1 file changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/docker.yml` (+2 -0) </details> ### 📄 Description Hi, and thanks for 3x-ui. `.github/workflows/docker.yml` publishes to both `hsanaeii/3x-ui` on Docker Hub and `ghcr.io/mhsanaei/3x-ui` on 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: ```yaml with: ... push: true provenance: mode=max sbom: true ``` 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: read` and `packages: write` stay exactly as they are, and nothing needs `id-token`. After a release, anyone can check with: ``` docker buildx imagetools inspect ghcr.io/mhsanaei/3x-ui:<tag> --format '{{ json .Provenance }}' ``` Two things worth knowing before merging: - `mode=max` records the full build including build arguments. That is normally right for a public image; `provenance: true` produces a smaller record if you would rather. - Attestations add an extra manifest to the index. Docker Hub and GHCR both handle it, but it is worth knowing if a mirror ever sits in front. 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:18 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6091
No description provided.