Skip to content

release.signing: KMS, key and private Sigstore modes, and signing on Forgejo #5458

Closed

Description

@lex00

release.signing should offer signing modes besides keyless public Sigstore, and signing should work on every forge chant release workflow renders.

Epic: #5452. Related: #5447 (FIPS research).

What exists, checked at chant 3bf0df0

  • Under supply-chain, the oci, forge and pypi targets are signed keylessly with cosign plus SLSA provenance, using the pinned cosign in TOOL_PINS. npm uses its own --provenance.
  • signingIdentity (lifecycle/publish-signing.ts) knows only two environments. One is GitHub Actions with id-token: write; the other is GitLab CI with a SIGSTORE_ID_TOKEN whose audience is sigstore. Anywhere else it refuses.
  • The certificate authority and transparency log are the public Sigstore instance. There is no option for a key, a KMS key, or a private Fulcio and Rekor.
  • Forgejo is a forge the release workflow renders for, but it has no identity here. A runner that sets GITHUB_ACTIONS would be taken for GitHub, with GitHub's issuer.

A regulated team often cannot write its release identities to the public log, and may need a key held in its own KMS or HSM. Some need FIPS-validated crypto (#5447).

What it should be

release.signing takes one of these:

  • keyless, the default, as today. Optionally it names a private Fulcio and Rekor URL and the trust root to verify against.
  • kms: "<uri>": cosign's KMS references (awskms://, gcpkms://, azurekms://, hashivault://), with the credentials named by environment variable and passed only to the signing step.
  • key: a key file or a secret in an environment variable, for workstations and air-gapped runners.

On top of that:

  • chant release verify checks against whichever mode signed, with the trust root it names.
  • Forgejo gets an identity when its runner provides an OIDC token. Otherwise the pipeline needs kms or key, and the renderer says so instead of rendering a step that fails.
  • The chant-native git forge (chant ci serve --forge git, land branches, the ref gate) has no CI OIDC token either. chant release workflow renders for github, gitlab and forgejo only (RELEASE_WORKFLOW_FORGES), so a release on the git forge runs chant release publish from a host. There, kms or key is the only way to sign, and chant release doctor says so when supply-chain is on and no mode can sign.
  • The GITHUB_ACTIONS check confirms the issuer, so a Forgejo runner is not taken for GitHub.
  • Provenance without a CI OIDC token. Today detectProvenance (lifecycle/release-publish.ts) returns oidc: false outside GitHub Actions and GitLab CI, and under supply-chain the rendered --require-provenance refuses the whole publish (publish-provenance-missing). So kms and key alone do not unlock Forgejo, a ci serve host or the git forge. In kms and key modes, --require-provenance is met by the release's signed SLSA statement, and the refusal names what is missing in each mode. npm, which records provenance only from a CI OIDC token, publishes without npm provenance and the release's own statement is the provenance, as the publish already says for a workstation (publish-attachments.ts).
  • Builder identity per environment. slsaProvenanceStatement (lifecycle/publish-signing.ts) writes GitHub's build type and builder id for any environment that is not GitLab, so a Forgejo runner or a host would get a statement naming GitHub with an empty repository. Each environment gets its own build type and builder id: GitHub, GitLab, Forgejo (its server and workflow), and a ci serve host (the runner key's fingerprint).

Done when

  • A release signs and verifies in each mode against fakes: a local key, a KMS stand-in (a cosign hashivault:// or local KMS plugin), and a local Rekor and Fulcio for the private-instance mode. Runs on real forges, a real KMS or public Sigstore need a person's grant.
  • With supply-chain on and kms or key, a publish with no CI OIDC token is not refused, and its SLSA statement names the environment's builder, not GitHub.
  • The same holds for a train's release workflow (release-train-workflow.ts, chant workspace train publish), which behold releases with. Today it receives only releaseSetupSteps and the idTokens slot (release-workflow.ts, the train context), so job steps added here must reach it too.
  • The rendered pipeline passes the KMS credentials only to the signing step.
  • The release workflow page and the security features reference list the modes.

Pull requests, in order

  • 1. Builder identity per environment in the SLSA statement, and the GITHUB_ACTIONS issuer check.
  • 2. key mode, with --require-provenance met by the signed statement.
  • 3. kms mode, with credentials passed only to the signing step.
  • 4. Private Fulcio and Rekor for keyless, with the trust root in release verify.
  • 5. Forgejo: an identity when its runner has an OIDC token, else the renderer requires kms or key, and the train.

Activity

  1. added
    epic:ci-hardening
    on Nov 21, 2026
  2. lex00 commented on Nov 22, 2026

    @lex00
    ContributorAuthor

    Decision: the shape of release.signing

    release.signing stays true, false or an object. The object picks its mode by which key it carries, so a config written for the keyless mode today keeps working unchanged:

    release: {
      signing: {
        // keyless (no kms, no key): the CI job's OIDC token, as today
        identity?: string,        // the certificate identity verify expects (a regular expression)
        issuer?: string,          // the OIDC issuer verify expects; on Forgejo, also the issuer the job's token comes from
        fulcio?: string,          // a private Fulcio URL
        rekor?: string | false,   // a private Rekor URL; false (kms and key only) writes no transparency log entry
        trustRoot?: string,       // a Sigstore trusted_root.json, from the member; required with fulcio or a rekor URL
    
        // kms
        kms?: "awskms://..." | "gcpkms://..." | "azurekms://..." | "hashivault://...",
        env?: string[],           // the variables holding the KMS credentials; default per scheme
    
        // key
        key?: string,             // a cosign key file from the member, or env://NAME holding the PEM
        passwordEnv?: string,     // the variable holding its password; default COSIGN_PASSWORD
    
        // kms and key
        publicKey?: string,       // the PEM public key verify checks against; required with key
      }
    }

    The config check refuses kms with key, fulcio, identity or issuer beside kms or key, env without kms, passwordEnv without key, key without publicKey, rekor: false in the keyless mode, and fulcio or a rekor URL without trustRoot. Default env per scheme: awskms AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION; azurekms AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET; hashivault VAULT_ADDR and VAULT_TOKEN; gcpkms none, so it names its own.

    What the publish does in each mode

    • Keyless signs as today. With fulcio and rekor it runs cosign against them with the trust root, and release verify --sigstore checks against that trust root.
    • kms and key sign the same bundles (cosign signature and SLSA provenance on an image, a bundle beside each forge asset, PEP 740 on PyPI) with --key. The record names the key (the public key file, else the KMS reference) instead of an issuer and identity, and release verify --sigstore checks with --key, and with --insecure-ignore-tlog only when rekor: false.
    • --require-provenance is met by an OIDC token, as today, or by a release whose SLSA statement this run signs: keyless with an identity, or kms or key with the key and its credentials present. The refusal names what is missing in the mode configured: the OIDC token, a KMS credential variable, the key file or variable, or its password. npm publishes without --provenance when the run has no CI OIDC token, and the release's own statement is its provenance, as on a workstation.

    Builder identity

    slsaProvenanceStatement names the environment it ran in, each with its own build type and builder id: GitHub Actions, GitLab CI, Forgejo Actions (the server and the workflow ref), a chant ci serve host (the runner key's fingerprint, which the serve passes in CHANT_RELEASE_RUNNER_KEY_FINGERPRINT), and a workstation. A job is GitHub only when nothing marks it as Forgejo or Gitea (FORGEJO_ACTIONS, GITEA_ACTIONS, or a GITHUB_API_URL ending in /api/v1, which runners before v7 leave as the only sign). The issuer then follows the server: https://token.actions.githubusercontent.com on github.com, https://token.actions.<host> on a ghe.com host, and <server>/_services/token on GitHub Enterprise Server.

    The rendered pipeline

    Signing runs inside chant release publish (and chant workspace train publish), so that step is the signing step. On GitHub and Forgejo, the KMS credentials, env:// key and password reach that step's own env: from the repository's secrets, and no other step or job gets them. The doctor in a dispatched cut does not hold them, so it reports them as unknown there, the way it already treats the publish job's OIDC token. GitLab has no per-line variables, and a project's CI/CD variables reach every job, so the GitLab file names none of them and the workflow page says to keep them protected and scoped to the release's environment.

    Forgejo: keyless renders only with a fulcio that trusts the instance's issuer (<server>/api/actions), since public Fulcio issues no certificates for a Forgejo token. The publish job then gets enable-openid-connect: true. Without a fulcio, a Forgejo workflow that signs keylessly is refused at render, with the fix to set kms or key. The train workflow gets the same publish-step credentials and the same Forgejo rule through the context the single-member file uses.

    chant release doctor on a host with no CI OIDC token (the chant git forge, a ci serve host) fails the signing check in the keyless mode with the fix to set kms or key.

    Corrections to the issue

    • Forgejo's OIDC token is not enough for keyless signing on public Sigstore: public Fulcio does not trust a Forgejo issuer. A Forgejo keyless release needs a private Fulcio that does, so in practice Forgejo signs with kms or key unless one is run.
    • The "signing step" is the publish step, since chant runs cosign itself during the publish. Nothing renders a separate cosign step.
    • On GitLab the rendered file cannot keep CI/CD variables from other jobs; the platform hands them to every job.
    • Forgejo runners before v7 set only the GITHUB_* variables, so FORGEJO_ACTIONS alone does not tell them from GitHub; GITHUB_API_URL does.

    Tests

    They run against fakes only: a fake cosign that records its arguments, a local key file, a KMS stand-in (a hashivault:// reference with stand-in credentials read by the fake cosign), and fake Fulcio and Rekor URLs with a trust root file. A local Rekor and Fulcio, and a running Vault, are left to the person-granted runs in stage 6.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:ci-hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions