Skip to content

feat(images): sign, SBOM, and attest provenance for Docker Hub publishes - #539

Merged
SemTiOne merged 4 commits into
mainfrom
fix/dockerhub-sign-sbom-provenance-275
Aug 27, 2026
Merged

feat(images): sign, SBOM, and attest provenance for Docker Hub publishes#539
SemTiOne merged 4 commits into
mainfrom
fix/dockerhub-sign-sbom-provenance-275

Conversation

@RonaldHensbergen

Copy link
Copy Markdown
Owner

Summary

Resolves #275: the publish-dockerhub job in publish-images.yml only built, vulnerability-gated, and pushed images — it had none of the supply-chain guarantees (cosign sign, SBOM attestation, SLSA provenance attestation) that the publish (ghcr.io) job already has.

  • Adds id-token: write permission and a cosign-installer step to publish-dockerhub.
  • After push, captures the pushed digest (docker inspect --format='{{index .RepoDigests 0}}'), mirroring the ghcr.io job.
  • Adds cosign sign --yes, CycloneDX SBOM generation + cosign attest, an SLSA provenance predicate + cosign attest, and a cosign verify self-check — same steps as the publish job, same keyless OIDC identity (same workflow file/branch).
  • docs/image-signing.md: documents Docker Hub naming/tagging alongside GHCR, and clarifies both registries share the same trust identity (OIDC issuer + certificate identity), since both jobs run from this workflow.
  • tests/test_publish_images_workflow.py: new assertions for the publish-dockerhub job mirroring the existing publish job checks (id-token permission, cosign-installer step, digest-based signing/attestation, SBOM+provenance both attested, gate runs before sign/push).

Out of scope

  • tests/fixtures/signed-images.json remains GHCR-only (unchanged) — it's used for offline cds security --verify-images verification against the images this project references by default (ghcr.io/...), not a general publish-audit log for every registry.

Testing

  • python -m unittest discover -s tests -p "test_*.py" -v — 567 tests, all pass
  • make lint — passes
  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/publish-images.yml'))" — valid YAML

Extends the publish-dockerhub job in publish-images.yml to match the
ghcr.io publish job's supply-chain guarantees:
- cosign keyless-sign the pushed digest
- generate and attest a CycloneDX SBOM
- write and attest an SLSA provenance predicate
- self-verify the signature after signing

Adds id-token: write permission and the cosign-installer step needed
for keyless signing. Updates docs/image-signing.md to document Docker
Hub alongside GHCR (naming/tagging differences, shared trust
identity), and adds workflow-structure test coverage in
tests/test_publish_images_workflow.py mirroring the existing ghcr.io
assertions.

Resolves #275

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@SemTiOne SemTiOne left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good work. However there are some minor suggestions (see below).

Comment thread .github/workflows/publish-images.yml Outdated
Comment thread .github/workflows/publish-images.yml
Comment thread tests/test_publish_images_workflow.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@RonaldHensbergen
RonaldHensbergen force-pushed the fix/dockerhub-sign-sbom-provenance-275 branch from d27f49a to 9073cb8 Compare August 27, 2026 10:12
@SemTiOne
SemTiOne merged commit d6e908d into main Aug 27, 2026
9 checks passed
@SemTiOne
SemTiOne deleted the fix/dockerhub-sign-sbom-provenance-275 branch August 27, 2026 10:35
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.

Sign, SBOM, and attest provenance for Docker Hub image publishes

3 participants