|
| 1 | +<!-- |
| 2 | +--- |
| 3 | +linkTitle: "OCI Storage Formats" |
| 4 | +weight: 35 |
| 5 | +--- |
| 6 | +--> |
| 7 | + |
| 8 | +# OCI Storage Formats |
| 9 | + |
| 10 | +## Overview |
| 11 | + |
| 12 | +By default, Chains stores OCI signatures and attestations using a tag-based |
| 13 | +scheme (e.g. `<image>:sha256-<digest>.sig`). While universally supported, this |
| 14 | +approach creates additional tags in your registry for every signed artefact. |
| 15 | + |
| 16 | +Two independent configuration keys let you control this behaviour: |
| 17 | + |
| 18 | +- **`storage.oci.distribution-method`** — *where* the artefacts are stored in the registry. |
| 19 | +- **`storage.oci.serialization-format`** — *how* the cryptographic payload is encoded. |
| 20 | + |
| 21 | +## Configuration |
| 22 | + |
| 23 | +Set the keys in the `chains-config` ConfigMap: |
| 24 | + |
| 25 | +```yaml |
| 26 | +apiVersion: v1 |
| 27 | +kind: ConfigMap |
| 28 | +metadata: |
| 29 | + name: chains-config |
| 30 | + namespace: tekton-chains |
| 31 | +data: |
| 32 | + storage.oci.distribution-method: "referrers-api" |
| 33 | + storage.oci.serialization-format: "dsse" |
| 34 | +``` |
| 35 | +
|
| 36 | +### `storage.oci.distribution-method` |
| 37 | + |
| 38 | +Controls where signatures and attestations are attached to the subject image. |
| 39 | + |
| 40 | +| Value | Storage mechanism | Default | |
| 41 | +|---|---|---| |
| 42 | +| `legacy` | Tag-based (`sha256-<digest>.sig` / `.att`) | ✓ | |
| 43 | +| `referrers-api` | OCI 1.1 Referrers API (no extra tags) | | |
| 44 | + |
| 45 | +### `storage.oci.serialization-format` |
| 46 | + |
| 47 | +Controls how the cryptographic payload is encoded. |
| 48 | + |
| 49 | +| Value | Encoding | Default | |
| 50 | +|---|---|---| |
| 51 | +| `dsse` | [Dead Simple Signing Envelope](https://github.com/secure-systems-lab/dsse) | ✓ | |
| 52 | +| `protobuf-bundle` | [Sigstore protobuf bundle](https://github.com/sigstore/protobuf-specs) (experimental) | | |
| 53 | + |
| 54 | +> [!NOTE] |
| 55 | +> `protobuf-bundle` requires `distribution-method: referrers-api`. |
| 56 | +> Combining `legacy` with `protobuf-bundle` is rejected at startup. |
| 57 | + |
| 58 | +### Valid combinations |
| 59 | + |
| 60 | +| `distribution-method` | `serialization-format` | Description | |
| 61 | +|---|---|---| |
| 62 | +| `legacy` | `dsse` | **Default.** Tag-based storage, DSSE encoding. Maximum compatibility. | |
| 63 | +| `referrers-api` | `dsse` | OCI 1.1 Referrers API, DSSE encoding. Reduces tag proliferation. | |
| 64 | +| `referrers-api` | `protobuf-bundle` | OCI 1.1 Referrers API, Sigstore bundle. Experimental. | |
| 65 | + |
| 66 | +## Formats in detail |
| 67 | + |
| 68 | +### `legacy` distribution + `dsse` serialization (default) |
| 69 | + |
| 70 | +Chains pushes signatures and attestations to tags derived from the image digest: |
| 71 | + |
| 72 | +- `<image>:sha256-<digest>.sig` – signature |
| 73 | +- `<image>:sha256-<digest>.att` – attestation |
| 74 | + |
| 75 | +Works with every OCI registry and every version of cosign. |
| 76 | + |
| 77 | +**Use when:** you need maximum compatibility with existing tooling or registries |
| 78 | +that do not support the OCI 1.1 distribution spec. |
| 79 | + |
| 80 | +### `referrers-api` distribution + `dsse` serialization |
| 81 | + |
| 82 | +Chains uses the [OCI 1.1 Referrers API](https://github.com/opencontainers/distribution-spec/blob/v1.1.0/spec.md#listing-referrers) |
| 83 | +to associate signatures and attestations with the subject image. No extra tags |
| 84 | +are created. |
| 85 | + |
| 86 | +The payload encoding is identical to `legacy` (DSSE), so any tooling that can |
| 87 | +verify DSSE-wrapped attestations continues to work. |
| 88 | + |
| 89 | +If the registry does not support the Referrers API, cosign automatically falls |
| 90 | +back to the [referrers tag schema](https://github.com/opencontainers/distribution-spec/blob/v1.1.0/spec.md#referrers-tag-schema) |
| 91 | +as required by the OCI distribution spec. |
| 92 | + |
| 93 | +**Use when:** you want to reduce tag proliferation and your registry supports |
| 94 | +OCI 1.1 (e.g. quay.io, GHCR, GCR, ECR). |
| 95 | + |
| 96 | +### `referrers-api` distribution + `protobuf-bundle` serialization (experimental) |
| 97 | + |
| 98 | +Chains creates a [Sigstore protobuf bundle](https://github.com/sigstore/protobuf-specs) |
| 99 | +and pushes it via the OCI 1.1 Referrers API. |
| 100 | + |
| 101 | +> [!WARNING] |
| 102 | +> This format is **experimental**. It requires cosign ≥ 2.4 for verification |
| 103 | +> and the bundle structure may change in future Chains or cosign releases. |
| 104 | + |
| 105 | +**Use when:** you are testing the new Sigstore bundle format or need |
| 106 | +interoperability with tools that consume protobuf bundles. |
| 107 | + |
| 108 | +## Registry compatibility |
| 109 | + |
| 110 | +| Registry | `legacy` | `referrers-api` | |
| 111 | +|---|---|---| |
| 112 | +| Any OCI registry | ✓ | ✓ (fallback to referrers tag schema if native API unavailable) | |
| 113 | +| GHCR (`ghcr.io`) | ✓ | ✓ — native Referrers API not exposed; cosign falls back to the OCI referrers tag schema automatically. Referrers are stored and discoverable via `oras discover --distribution-spec v1.1-referrers-tag`. | |
| 114 | +| GCR, ECR, Artifact Registry | ✓ | ✓ (native Referrers API) | |
| 115 | +| quay.io | ✓ | ⚠️ — write is accepted (HTTP 200) but referrers are not discoverable via either the native API or the tag schema fallback. This is a known quay.io registry limitation. Use `legacy` mode with quay.io until full OCI 1.1 support is available. | |
| 116 | + |
| 117 | +> [!NOTE] |
| 118 | +> Registry support for OCI 1.1 referrers is still rolling out across the ecosystem. |
| 119 | +> If `oras discover --distribution-spec v1.1-referrers-api` returns `unsupported`, |
| 120 | +> cosign will automatically fall back to the referrers tag schema |
| 121 | +> (`oras discover --distribution-spec v1.1-referrers-tag`) as required by the OCI |
| 122 | +> distribution spec. In either case no `.sig`/`.att` tags are created. |
| 123 | + |
| 124 | +## Verifying stored artefacts |
| 125 | + |
| 126 | +Regardless of the configuration used, cosign can verify both signatures and |
| 127 | +attestations. Point cosign at your signing key or certificate and run: |
| 128 | + |
| 129 | +```shell |
| 130 | +# Verify a signature |
| 131 | +cosign verify \ |
| 132 | + --key k8s://tekton-chains/signing-secrets \ |
| 133 | + <image>@sha256:<digest> |
| 134 | +
|
| 135 | +# Verify an in-toto attestation |
| 136 | +cosign verify-attestation \ |
| 137 | + --key k8s://tekton-chains/signing-secrets \ |
| 138 | + --type slsaprovenance \ |
| 139 | + <image>@sha256:<digest> |
| 140 | +``` |
| 141 | + |
| 142 | +In `referrers-api` mode, signatures are written using cosign's native signature |
| 143 | +manifest (`config.mediaType: application/vnd.dev.cosign.artifact.sig.v1+json` |
| 144 | +with the image set as the manifest `subject`). This is the exact shape `cosign |
| 145 | +verify` discovers, so verification works with **no extra flags** on registries |
| 146 | +that support the Referrers API — the same command shown above works for both |
| 147 | +`legacy` and `referrers-api` distribution methods. |
| 148 | + |
0 commit comments