|
| 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 tag schema if Referrers API unavailable) | |
| 113 | +| OCI 1.1 registries (quay.io, GHCR, GCR, ECR) | ✓ | ✓ (native Referrers API) | |
| 114 | + |
| 115 | +## Verifying stored artefacts |
| 116 | + |
| 117 | +Regardless of the configuration used, cosign can verify both signatures and |
| 118 | +attestations. Point cosign at your signing key or certificate and run: |
| 119 | + |
| 120 | +```shell |
| 121 | +# Verify a signature |
| 122 | +cosign verify \ |
| 123 | + --key k8s://tekton-chains/signing-secrets \ |
| 124 | + <image>@sha256:<digest> |
| 125 | +
|
| 126 | +# Verify an in-toto attestation |
| 127 | +cosign verify-attestation \ |
| 128 | + --key k8s://tekton-chains/signing-secrets \ |
| 129 | + --type slsaprovenance \ |
| 130 | + <image>@sha256:<digest> |
| 131 | +``` |
| 132 | + |
| 133 | +For registries that support the Referrers API, cosign will automatically |
| 134 | +discover and verify artefacts stored using any of the configurations above. |
| 135 | + |
0 commit comments