Skip to content

fix(security): add cosign keyless signing to releases#495

Draft
antitree wants to merge 1 commit into
chainguard-dev:mainfrom
antitree:fix/FIND-055-cosign-signing
Draft

fix(security): add cosign keyless signing to releases#495
antitree wants to merge 1 commit into
chainguard-dev:mainfrom
antitree:fix/FIND-055-cosign-signing

Conversation

@antitree
Copy link
Copy Markdown
Member

Summary

  • Adds Sigstore cosign keyless signing to release checksums alongside existing GPG signing
  • Installs cosign via sigstore/cosign-installer@v4.1.1 in the release workflow
  • Adds Sigstore endpoints (fulcio.sigstore.dev, rekor.sigstore.dev, oauth2.sigstore.dev, tuf-repo-cdn.sigstore.dev) to the harden-runner egress allowlist

Motivation

Release artifacts are currently signed with GPG only (required by Terraform Registry). Adding cosign keyless signing provides:

  • Verifiable provenance via Fulcio short-lived certificates tied to the GitHub Actions OIDC identity
  • Transparency log entries in Rekor for auditability
  • Alignment with how chainguard-dev/apko and chainguard-dev/melange sign their releases

The workflow already has id-token: write permission, which cosign keyless uses to obtain a Fulcio certificate. No new secrets or keys are required.

Changes

.goreleaser.yml

  • Added COSIGN_YES=true global env var (suppresses cosign interactive prompts)
  • Added id: gpg to existing GPG signs block (required when multiple signs blocks exist)
  • Added new id: cosign signs block that signs checksum artifacts using cosign sign-blob with keyless mode

.github/workflows/release.yml

  • Added sigstore/cosign-installer@v4.1.1 step before goreleaser
  • Added Sigstore endpoints to harden-runner egress allowlist
  • Updated id-token: write comment to reflect dual use (GPG federation + cosign keyless)

Verification

After the next tagged release, verify cosign signatures:

cosign verify-blob \
  --certificate terraform-provider-chainguard_*_SHA256SUMS.crt \
  --signature terraform-provider-chainguard_*_SHA256SUMS.sig \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  --certificate-identity-regexp 'https://github.com/chainguard-dev/terraform-provider-chainguard/.*' \
  terraform-provider-chainguard_*_SHA256SUMS

Applicability to other providers

This same pattern applies to all Chainguard terraform providers:

  • terraform-provider-apko
  • terraform-provider-cosign
  • terraform-provider-imagetest
  • terraform-provider-oci

The changes are generic — only the harden-runner endpoint list may vary per provider.

Addresses: FIND-055

@antitree antitree temporarily deployed to acceptance-tests March 27, 2026 14:27 — with GitHub Actions Inactive
@antitree antitree temporarily deployed to acceptance-tests March 27, 2026 14:27 — with GitHub Actions Inactive
Add Sigstore cosign keyless signing alongside existing GPG signing for
release checksums. This provides verifiable provenance via Fulcio
certificates and Rekor transparency log entries.

Changes:
- .goreleaser.yml: Add cosign signs block (id: cosign) for checksum
  artifacts, set COSIGN_YES=true env, add id: gpg to existing block
- release.yml: Install cosign via sigstore/cosign-installer v4.1.1,
  add Sigstore endpoints to harden-runner egress allowlist

The existing GPG signing is preserved (required by Terraform Registry).
Cosign keyless signing uses the workflow's id-token: write permission
(already present) to obtain a Fulcio certificate.

Addresses: FIND-055
@antitree antitree force-pushed the fix/FIND-055-cosign-signing branch from 44e355b to d89d549 Compare March 27, 2026 14:29
@antitree antitree temporarily deployed to acceptance-tests March 27, 2026 14:29 — with GitHub Actions Inactive
@antitree antitree temporarily deployed to acceptance-tests March 27, 2026 14:29 — with GitHub Actions Inactive
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.

1 participant