Skip to content

feat(release): sign OCI images and Helm charts with cosign - #5451

Open
alangou wants to merge 3 commits into
mainfrom
feat/sign-oci-artifacts/alangou
Open

alangou wants to merge 3 commits into
mainfrom
feat/sign-oci-artifacts/alangou

Conversation

@alangou

@alangou alangou commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Published OpenShell images and Helm charts carry no signature, so a consumer cannot tell a release build from anything else written to the registry. Release Dev, Pre-release, and Release now sign each image and chart digest with keyless cosign, using the GitHub OIDC identity of the publishing workflow.

A run signs only the digests of its own build and never resolves a registry tag to find a digest to sign. A run completes only when every image and chart tag it publishes has a valid signature for its channel.

Related Issue

None.

Changes

  • tasks/scripts/sign-oci-artifacts.sh owns every cosign call. It signs the image digests it reads from the build archives of the run and the chart digests that helm push printed. Then it verifies every published tag against the policy of the channel. It never signs a tag, and it skips a digest that the registry no longer has.
  • The policy requires the workflow identity, the repository that ran the workflow and, for a stable release, the main branch. The identity alone is not enough: it names the workflow file, and any repository can call the reusable release-publish.yml.
  • A sign-oci-artifacts job in release-dev.yml and release-publish.yml runs after the image and chart jobs. GitHub Release assets wait for it. The job is separate so that "Re-run failed jobs" repeats only the signing.
  • Dev and prerelease promotion now copies the digest of the run's build archive from the CI registry. It used to copy the commit SHA tag, which Release Dev and Pre-release both write for the same commit, so a promoted image could be another build.
  • release-helm-oci reports the digest Helm prints for each pushed chart, and pins Helm to v4.3.2 because earlier versions print it on stderr.
  • docs/security/verify-image-contents.mdx gives the cosign verify command for each channel. CI.md and the release captain skill say what to do when the sign job fails.

Release Notes

Published images and OCI Helm charts are signed with cosign. Verify them with the commands in the "Verify Signatures" section of docs/security/verify-image-contents.mdx. Artifacts published before this change carry no signature.

Testing

  • The script ran with stub cosign and docker and real buildx archives in 34 scenarios: what it signs and verifies per channel, kept images and charts, a dev re-run after a later run moved the floating chart tags, unsigned tags, refused references, missing or corrupt archives, and transient failures.
  • With cosign 3.1.5, each channel policy accepts a real certificate that a past run of that channel obtained (dev, tag-pushed prerelease, stable) and rejects what it must: the certificate of the other workflow, a tag-pushed prerelease under the stable policy, another repository, and another branch.
  • The image promotion steps ran as written with stub registry tools. The chart steps ran against a real helm push (Helm v4.3.2) to a loopback registry, including a registry that returns crafted error text.
  • With cosign 3.1.5, the script fails with the repair message against the current unsigned 0.1.10 artifacts.
  • actionlint with ShellCheck, zizmor, the SPDX check, and markdownlint add no finding.
  • Live keyless signing has not run. The release environment admits only main and v* tags, so the first Release Dev run after merge is the first real signature. Until then it is unverified that the Quay robot can push signature referrers, and that the organization's Actions policy allows sigstore/cosign-installer, which is new to this repository.

Limits and follow-ups:

  • A retry cannot sign an image or chart that an earlier run published. Rerun the failed jobs of the run that published it within five days, while its image archives last, or release the next version. This includes a retry of a release that was published before this change.
  • Do not rerun all jobs of a run that has published an image or chart. The rebuild has other digests, and nothing can then sign what is published.
  • Dependabot does not update the Helm version pin in release-helm-oci.
  • The latest image tag still moves before the signature exists.
  • A signature shows that the release workflow published a digest. It does not show that the source was reviewed: v* tags have no ruleset, and release tags are not checked for main ancestry.

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

@alangou alangou added topic:security Vulnerability management, security analysis/auditing, bypass detection, and abuse prevention. area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. github_actions Pull requests that update GitHub Actions code labels Nov 10, 2026
@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown

@purp purp added meta:labeler-checkpoint Temporary label used by /label-issue to record a verified classification checkpoint. and removed meta:labeler-checkpoint Temporary label used by /label-issue to record a verified classification checkpoint. labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request has had no activity for 14 days and is now marked stale.

@github-actions github-actions Bot added the state:stale Inactive item at risk of automatic closure. label Nov 29, 2026
@alangou
alangou force-pushed the feat/sign-oci-artifacts/alangou branch from 759dec1 to d2b0aaf Compare November 30, 2026 10:29
@alangou
alangou marked this pull request as ready for review November 30, 2026 10:37
@alangou
alangou requested a review from a team as a code owner November 30, 2026 10:37
@alangou alangou added state:accepted A maintainer decided OpenShell should pursue this issue and removed state:stale Inactive item at risk of automatic closure. labels Nov 30, 2026
@alangou
alangou force-pushed the feat/sign-oci-artifacts/alangou branch from 8bb357c to 0da141c Compare November 30, 2026 13:16
Release Dev and Pre-release both write the commit SHA tag in the CI
registry, so promotion by that tag could publish the build of another
run. Promote the digest recorded in the run's own image archive instead.

Signed-off-by: Adrien Langou <alangou@nvidia.com>
Release Dev, Pre-release, and Release sign what they publish to Quay with
keyless cosign, under the GitHub OIDC identity of the publishing workflow.

A sign-oci-artifacts job signs the image digests it reads from the build
archives of its run and the chart digests that helm push printed. It then
requires a valid signature for the channel on every published tag. It
never resolves a tag to find a digest to sign, so an artifact the run did
not build cannot obtain a signature.

The job is separate from the publishing jobs so that "Re-run failed jobs"
repeats only the signing. GitHub Release assets wait for it.

Pin Helm because the chart digests are read from the stdout of helm push,
and Helm before 4.3 prints them on stderr.

Signed-off-by: Adrien Langou <alangou@nvidia.com>
Give the cosign verify command for each release channel, and say how to
repair a failed sign-oci-artifacts job.

Signed-off-by: Adrien Langou <alangou@nvidia.com>
@alangou
alangou force-pushed the feat/sign-oci-artifacts/alangou branch from 0da141c to be17cff Compare December 1, 2026 11:24
@elezar

elezar commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This looks sound. It signs digests the run built itself, never a registry tag, and the verify step checks each published tag against a per-channel policy that pins the repository. Promoting by archive digest also closes the race on the shared SHA tag. I have two functional comments and two non-blocking nits. I only read the diff and did not run the script or the workflows.

1. The dev and latest image tags are never verified (tasks/scripts/sign-oci-artifacts.sh:35-39, release-dev.yml:287)

The tags array holds only ${IMAGE_TAG} and the chart versions. Release Dev also publishes :dev, and a stable release publishes :latest. A run can go green while those tags carry no check. The digest behind :dev is the one that gets signed, so the exposure is small. Still, the PR description says a run completes only when every tag it publishes has a valid signature. You already list latest under follow-ups. Please either add :dev to the verified tags or list it there too.

2. A transient imagetools inspect failure skips signing without a clear error (sign-oci-artifacts.sh:50-52)

The comment says the skip is for a digest the registry no longer has. But any non-zero exit from inspect, including a Quay 5xx, takes the same path. The run then fails at the verify step with "has no valid signature. Re-run the failed jobs of the run that published it". Rerunning is the right action for a transient failure, but the message suggests nothing was ever signed. Wrapping the inspect in retry would cut the false skips. Alternatively, only skip on a not-found error and fail on anything else.

3. Nit: the two sign-oci-artifacts jobs are near-copies (release-dev.yml:145-181, release-publish.yml:235-271)

Both jobs use the same environment, permissions and steps. They differ only in needs, RELEASE_CHANNEL, IMAGE_TAG and CHART_VERSIONS. The pinned cosign-installer and quay-login SHAs and the robot name are duplicated. A small composite action taking those four values as inputs would keep the pins in one place. The action path in release-publish.yml would need to follow the existing release-workflow/ checkout convention. I'm fine with merging as is. This is worth doing if a third caller appears or the copies drift.

4. Nit: the verify flags are written in three places (sign-oci-artifacts.sh:17-26, docs/security/verify-image-contents.mdx, the PR testing notes)

If the policy changes in the script but not in the docs, consumers will verify against a looser or stricter policy than CI enforces. A comment in the script header pointing at the docs section would help.

Rollout

The sign job now gates stable GitHub Release assets (release-publish.yml, release.needs), and the PR says live signing hasn't run. The Quay robot's referrer push rights, the Actions policy for sigstore/cosign-installer, and the Helm stdout parsing are all unverified. I'd merge and let Release Dev exercise it before the next stable or prerelease cut.

Smaller notes

  • Helm is now pinned to v4.3.2 (release-helm-oci/action.yml:43-46). Before, it used the azure/setup-helm default. Dependabot won't bump the pin, as the PR already says.

Comment thread tasks/scripts/sign-oci-artifacts.sh Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. github_actions Pull requests that update GitHub Actions code state:accepted A maintainer decided OpenShell should pursue this issue topic:security Vulnerability management, security analysis/auditing, bypass detection, and abuse prevention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants