URL: /docs/signing

---
title: Signing and provenance
description: How Turntable signs release artifacts, what the service guarantees, and how to verify what it signed.
---

<Note>
  The signing service, the key backends, the provenance and `turntable verify` are built. The [release lane](/docs/release-lane) records artifacts and calls the service, and it checks [human approvals](/docs/security#human-approvals) before it signs, so the service signs nothing without them.
</Note>

Turntable's control plane signs release artifacts and writes the provenance that says how they were built. The job never holds a signing key, and the job does not write the provenance.

## What is signed

The service builds one **in-toto statement** with a [SLSA v1](https://slsa.dev/spec/v1.0/provenance) provenance predicate and signs it as a [DSSE](https://github.com/secure-systems-lab/dsse) envelope with Ed25519.

| Field | Value |
| --- | --- |
| `subject` | The artifacts being attested: name and sha256, taken from the artifact store. |
| `buildType` | `https://longshore.dev/buildtype/workflow/v1` |
| `externalParameters` | The workflow path, ref, sha, event and inputs. |
| `resolvedDependencies` | The source commit, and every action commit the run pinned (from the plans stored when its attempts started). |
| `runDetails.builder.id` | The Turntable instance. |
| `runDetails.metadata` | The run id as the invocation id, and the start and finish times. |
| `runDetails.byproducts` | The run's other recorded artifacts, by digest. |

## Guarantees

- The service signs only digests recorded in the artifact store for that run. A caller names a run and artifact names; it never supplies a digest, a class, a ref or a key.
- A recorded artifact is never changed: a name is recorded once per run, and the store has no update or delete.
- A run is signed only if its stored class is `release`, it succeeded, its ref matches the project's release ref patterns, the project has a signing key, and its environment's approval is present. Any other answer is a refusal, and refusals are audited.
- Every signature and every refusal is written to the audit log, with the key id and the digests and never key material, before the signature is returned.
- The provenance is generated by the control plane from stored facts. Nothing in it comes from the job.
- Private keys are never exported: a backend can sign and name its public key, and nothing else.
- A signature that does not verify under its own backend's public key is never returned.
- Cloud backends authenticate with short-lived credentials from the org's identity issuer. No static cloud key is stored or used.
- The signing request names a key by reference, and the reference is checked against the backend's own format before any request is made.

## Backends

A project's signing key is `<backend>:<reference>`:

| Backend | Reference | Notes |
| --- | --- | --- |
| `builtin` | A key name | An Ed25519 key sealed in the system secret domain. For self-hosters and tests. |
| `aws-kms` | A key id, ARN or alias | An `ECC_NIST_EDWARDS25519` key; `Sign` with `ED25519_SHA_512`, request signed with SigV4 under temporary credentials. |
| `gcp-kms` | A full key version name | An `EC_SIGN_ED25519` key version; `asymmetricSign` with a short-lived OAuth token. |

KMS requests go through the same guarded outbound client as everything else the control plane fetches. Exchanging the org's OIDC token for those temporary credentials is the issuer's job ([#43](https://github.com/turntable-ci/turntable/issues/43)); the backends take a function that returns them.

## Configuration

```sh
turntable policy set --signing-key builtin:release --org <slug> [--project <slug>]
turntable policy set --release-refs 'refs/tags/v*,refs/heads/release/*' --org <slug> [--project <slug>]
turntable policy show --org <slug>
```

The approval environment defaults to `release` and is set with `--signing-environment <name>`. It is the project's own setting: `sign_release` takes no environment from the caller, refuses a request that names a different one, asks for approval in the project's environment, and records it in the provenance (`internalParameters.environment`) and the audit row.

A `builtin:<name>` key is looked up inside the org that owns the run (the org id is part of the stored name), so a project cannot name another org's key, and the same name in two orgs is two keys. A key outside Turntable (`aws-kms:`, `gcp-kms:`) may belong to one org only: `policy set` refuses a reference another org already uses, and signing is refused with `key_shared` if two orgs come to name the same one. Keys made before this change were stored under the bare name; create them again with `release init-key --org` and pin the new public key.

Release refs default to `refs/tags/v*`. An empty `--signing-key ''` unsets the key, and a project with no key cannot sign. Both are changed from the CLI only.

## Verifying

```sh
turntable verify <artifact> --provenance <file> --pubkey <file> [--name <subject>]
```

It hashes the artifact, checks that the DSSE signature verifies under the public key you give it (an Ed25519 SPKI PEM), that the envelope carries an in-toto statement with a SLSA v1 predicate, and that the artifact's digest is one of the statement's subjects (and its name, with `--name`). It trusts only that key. Exit code 0 means verified, 1 not verified, 2 usage or an unreadable file.

The public key of a built-in key is available from the service; a KMS key's public key is the one its console or API reports.

## Limits

- The service has no upload path of its own: it reads artifacts from the store through the repos, which the [release lane](/docs/release-lane) fills.
- Only Ed25519 is supported.
- Vault Transit is not a backend yet; the interface is the same.
