Skip to content

Commit c59515a

Browse files
authored
Merge pull request #73 from ConnectEverything/pdp/unbreak-cosign-v3
cosign invocation API has changed for v3
2 parents 5ef82ae + 0ac7051 commit c59515a

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

build-nightlies.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ extract_signing_keys() {
265265
# maintenance constraint, where one mistake could upload.
266266
# So we make sure that the private keys dir is outside the upload area.
267267
SIGNING_KEYS_DIR="$start_cwd/private-keys"
268-
mkdir -m 0700 "$SIGNING_KEYS_DIR"
268+
[[ -d "$SIGNING_KEYS_DIR" ]] || mkdir -m 0700 "$SIGNING_KEYS_DIR"
269269
cp "$start_cwd"/public-keys/* "$SIGNING_KEYS_DIR/./"
270270
touch "$SIGNING_KEYS_DIR/nightlies-ssh-signing" "$SIGNING_KEYS_DIR/nightlies-cosign.key"
271271
chmod 0600 "$SIGNING_KEYS_DIR/nightlies-ssh-signing" "$SIGNING_KEYS_DIR/nightlies-cosign.key"
@@ -286,7 +286,22 @@ remove_signing_keys() {
286286
sign_artifact_cosign() {
287287
local artifact="${1:?}"
288288
extract_signing_keys
289-
cosign sign-blob --yes --key "$SIGNING_KEYS_DIR/nightlies-cosign.key" --output-signature "${artifact}.cosign.sig" "$artifact"
289+
# 2026-03-11:
290+
# We now need --new-bundle-format=false to continue to get the signatures we expect.
291+
# Also --use-signing-config=false.
292+
# If we migrate away from that, we should move to keyless signatures via attestations in public audit logs instead.
293+
# (Which cosign supports, and championed).
294+
# `--new-bundle-format=false` was introduced in v2.6.0 and became default in v3.
295+
# As of now, my laptop has cosign v3.0.5 and GitHub in an Action run defaulted to that version but the installer led to selecting v3.0.3 instead.
296+
#
297+
# See also <https://github.com/sigstore/cosign/security/advisories/GHSA-whqx-f9j3-ch6m>
298+
# and note that because we're using a static key, manually distributed, the
299+
# advisory does not apply to us.
300+
cosign sign-blob --yes \
301+
--new-bundle-format=false --use-signing-config=false \
302+
--key "$SIGNING_KEYS_DIR/nightlies-cosign.key" \
303+
--output-signature "${artifact}.cosign.sig" \
304+
"$artifact"
290305
}
291306

292307
sign_artifact_ssh() {

0 commit comments

Comments
 (0)