← Back to Pull requests

feat(release): sign release tags with cosign keyless #761

Closed
unknown closed this pull request without merging on Oct 06, 2026 11:27 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 01:19 UTC
Author

Closes #760

What

After publish creates the release tag, a new sign job in semver-tag.yml:

1. Reads the tag back from GitHub, checks that it points at target-sha, and writes release-statement.json, {"commit":…,"repository":"confidential-dot-ai/C8s","tag":…} (compact, jq -S).
2. Signs it with cosign sign-blob --yes --bundle (keyless, GitHub Actions OIDC), then verifies its own bundle against the identity that downstream checks will use.
3. Publishes the statement and release-statement.sigstore.json as assets of a GitHub release for the tag. It makes the release when there is none (gh release create --verify-tag).

Downstream verification is documented in docs/releases.md, "Verify a release tag":

cosign verify-blob --bundle release-statement.sigstore.json \
  --certificate-identity https://github.com/confidential-dot-ai/C8s/.github/workflows/semver-tag.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  release-statement.json

After that, check that .repository, .tag and .commit match the tag's commit.

Design notes

  • Identity case. GitHub names this repository confidential-dot-ai/C8s. Fulcio puts that exact name in the certificate (from job_workflow_ref), and cosign verify-blob --certificate-identity compares the string exactly. The identity is therefore https://github.com/confidential-dot-ai/C8s/.github/workflows/semver-tag.yml@refs/heads/main. A lowercase c8s identity would not match. The job fails before it signs if GITHUB_REPOSITORY no longer gives that identity, and it verifies its own bundle before it uploads anything. A wrong identity therefore never reaches a release.
  • Permissions. Only the sign job has id-token: write, plus contents: write for the release. A called workflow gets only the permissions its caller grants, so docker.yml's release-tag job now grants id-token: write too. The identity comes from job_workflow_ref, so it is semver-tag.yml@refs/heads/main even though docker.yml calls it. The job runs in the release environment, does not check out source and runs no repository code.

  • cosign install. v3.1.3 is fetched with curl and checked against a pinned SHA-256, the same way git-cliff is installed. This adds no third-party action. cosign version must report the pinned version.

  • The 'Latest' release. Today the only release, v0.9.2, is marked Latest. The workflow passes --latest=<update-latest> from calculate, the rule that already moves the latest image alias. The newest stable release becomes Latest, which fixes the stale v0.9.2 mark. A repair rerun for an older tag cannot take the mark back. The releases are not marked prerelease because they are stable releases. A release made with GITHUB_TOKEN starts no workflows. The only other side effect is release notifications to repository watchers.

  • Retries. If both assets already exist, the job downloads them, checks that the statement matches byte for byte, and verifies the bundle. It does not replace them. If only one asset exists, the job fails. If the release exists but has no assets, the job uploads them.

  • Tags up to v0.34.2 stay unsigned. Consumers should treat a missing statement as unsigned. They should treat a statement that is present but does not verify as an error.
  • Follow-up

    Signing the component images (cosign sign on the digests) is optional in the issue and is left for a follow-up.

    Testing

  • actionlint v1.7.12 with the repository's ignore flags (shellcheck enabled): clean.

  • The new action pins and the cosign download meet pin-hygiene.yml.

  • The keyless path can run only on main in Actions. The first release after merge exercises it, and the job verifies its own signature before it uploads anything.
  • Diff: 478 lines (+358 / -120) across 5 files Reviewer: joaosa Review duration: 608m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.46) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 478 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.369
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #761"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.8% (MEDIUM) · Higher = larger blast radius
    45.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.8% · Safe to merge
    19.8%