Skip to content

Commit 36e5c48

Browse files
ci: migrate cosign to v3 and dual-publish image signatures (#3382)
* ci: migrate cosign to v3 with legacy signature compatibility Keep legacy image payloads, .sig tags, and Rekor v1 service defaults. Document exact cosign v2/v3 image verification and unchanged release archive attestations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * ci: dual-publish legacy and native cosign image signatures Sign the same immutable digest in separate fail-fast steps. Retain legacy signatures and publish native bundles with v3 service defaults. Remove the verification documentation introduced by this PR as requested; keep compatibility evidence and rollout plans in the PR description. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 876195b commit 36e5c48

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

‎.github/workflows/docker-publish.yml‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
if: github.event_name != 'pull_request'
4949
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 #v4.1.2
5050
with:
51-
cosign-release: "v2.6.5"
51+
cosign-release: "v3.1.3"
5252

5353
# Set up BuildKit Docker container builder to be able to build
5454
# multi-platform images and export cache
@@ -122,16 +122,20 @@ jobs:
122122
oauth_client_secret=${{ secrets.OAUTH_CLIENT_SECRET }}
123123
124124
# Sign the resulting Docker image digest except on PRs.
125-
# This will only write to the public Rekor transparency log when the Docker
126-
# repository is public to avoid leaking data. If you would like to publish
127-
# transparency data even for private images, pass --force to cosign below.
125+
# Publish both v2-compatible .sig tags and native Sigstore bundles.
126+
# --yes also consents to publishing signing metadata to the public log.
128127
# https://github.com/sigstore/cosign
129-
- name: Sign the published Docker image
128+
- name: Sign the published Docker image (legacy)
130129
if: ${{ github.event_name != 'pull_request' }}
131130
env:
132131
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
133-
TAGS: ${{ steps.meta.outputs.tags }}
134132
DIGEST: ${{ steps.build-and-push.outputs.digest }}
135133
# This step uses the identity token to provision an ephemeral certificate
136134
# against the sigstore community Fulcio instance.
137-
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
135+
run: cosign sign --yes --new-bundle-format=false --use-signing-config=false --registry-referrers-mode=legacy "${REGISTRY}/${IMAGE_NAME}@${DIGEST}"
136+
137+
- name: Sign the published Docker image (native bundle)
138+
if: ${{ github.event_name != 'pull_request' }}
139+
env:
140+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
141+
run: cosign sign --yes "${REGISTRY}/${IMAGE_NAME}@${DIGEST}"

0 commit comments

Comments
 (0)