Skip to content

HOWTO: Mirror Kastoria Releases into Your Own Registry

This guide covers copying promoted releases from the Merkalis distribution registry (acrmerkalisdist0c66.azurecr.io) into your own OCI registry without losing the evidence that ships with them — the Notation signatures, SLSA build provenance, and SBOM — and verifying everything again after import against the published trust material (Distribution Registry guide).

Read the Distribution Registry guide first for credentials, tool installation, and importing the trust anchor. This document assumes all of that is already done.

Example tags and digests

Tags and digests in this guide (v0.0.1, v0.10.0, @sha256:…) are illustrative — v0.0.1 in particular is an example placeholder, not a tag to copy. Substitute the tag and resolved digest of the release you are actually importing; where the supply chain matters, always verify and copy by digest, never by a mutable tag.

1. The rule: oras copy --recursive, never docker save/load

Release evidence does not live inside the image. Signatures, provenance, and the SBOM are OCI referrers attached to the image manifest in the registry. Only operations that walk the referrer graph carry them along:

Operation Image Signatures Provenance SBOM
oras copy --recursive ✅ ✅ ✅ ✅
docker pull + docker push ✅ ❌ ❌ ❌
docker save + docker load ✅ ❌ ❌ ❌
az acr import (named manifest) ✅ ❌ ❌ ❌

docker save/docker load (and plain docker pull/push) must not be used for any evidence-bearing move. The copy that lands in your registry will run fine and look identical — and the moment anyone tries to verify it, there is nothing to verify against. This is the same mechanism choice the promotion gate itself makes (oras copy --recursive preserves images plus the full referrer tree).

docker save/load remains acceptable only for the air-gapped case in §6, where the environment has no registry reachable at transfer time and you deliberately accept the verify-before-transfer model and its documented limits.

2. Prerequisites

  • ORAS 1.3.x and Notation CLI 1.3.x on the machine doing the copy (the versions the promotion pipeline itself uses).
  • Credentials for both registries: your scoped dist token (token-<customer>, see registry guide §1) and push access to your own registry.
  • The published trust material imported into Notation (registry guide §3). The published trust-policy.json uses registryScopes: ["*"], so the same trust material verifies artifacts in any registry — no reissue for your mirror.
  • Your destination registry must support the OCI referrers API. Any registry that advertises it is fine (Azure ACR, Harbor, GitHub GHCR, ECR with the referrers capability, and most others current since ~2023); older deployments (e.g. plain Docker Distribution without the referrers tag-schema fallback, long-pinned Artifactory) can silently drop referrers on push. The check in §3.4 catches that — if the copied artifact shows no referrers at the destination, the copy is not evidence-bearing and that destination is not usable as-is.
  • Worked examples below use <customer>/kastoria-ohif, with illustrative referrer digests (the ones shown in registry guide §6). The registry guide's §4–§5 examples use <customer>/kastoria-testcontainer instead — same structure, different release; substitute your release's references wherever a digest or tag appears.

3. Mirror an image

3.1 Authenticate to both registries

# Source (dist) — scoped customer token
oras login acrmerkalisdist0c66.azurecr.io --username token-<customer>
notation login acrmerkalisdist0c66.azurecr.io --username token-<customer>

# Destination — your registry's credentials
oras login registry.example.com --username <your-user>
notation login registry.example.com --username <your-user>

3.2 Verify at the source first

Never mirror something you have not verified where it is authoritative. Resolve the semver tag to a digest and verify that digest (signatures attach to digests, not tags):

SRC=acrmerkalisdist0c66.azurecr.io/<customer>/kastoria-ohif
DIGEST=$(oras manifest fetch --descriptor "${SRC}:v0.10.0" | jq -r .digest)
echo "$DIGEST"   # example: sha256:f7c1e79b5131f396c8d3f950d2e180cd90a7fcb2524ad5daa4da458adb5fa4e6

notation verify "${SRC}@${DIGEST}"

Verify the provenance referrer at the source too — §7's checklist asks for it, and a defect the source already has should not be discovered after import. The provenance is the application/vnd.dsse+json referrer carrying the io.kastoria.slsa.provenance annotation (registry guide §6):

PROVS=$(oras discover --format json --depth 1 "${SRC}@${DIGEST}" \
  | jq -r '.referrers[]
      | select((.annotations // {})["io.kastoria.slsa.provenance"] == "true")
      | .digest')
PROV=$PROVS              # exactly one line today; verify each if a release ever carries more
notation verify "${SRC}@${PROV}"

Keep $DIGEST and $PROV. Every later step is pinned to them; tags are mutable and must not be the identity you carry across the trust boundary.

3.3 Copy with the referrer graph

oras copy --recursive \
  "acrmerkalisdist0c66.azurecr.io/<customer>/kastoria-ohif@${DIGEST}" \
  "registry.example.com/merkalis/kastoria-ohif:v0.10.0"
  • --recursive walks the referrer tree: signatures, provenance, SBOM — everything attached.
  • The source is the digest resolved in §3.2, so the copy is pinned to exactly what you verified. The copy is content-addressed, so whatever tag you put on the destination, the manifest that lands carries that same digest — §3.4 confirms it.
  • Give the destination a tag, as above. oras copy also accepts <repo>@<digest> on the right-hand side and will succeed, but it leaves the repository with no tag at all ( oras repo tags reports the name as unknown), and registries that garbage-collect untagged manifests can then delete the copy. Tagging after the fact works too: oras tag registry.example.com/merkalis/kastoria-ohif@${DIGEST} v0.10.0.
  • oras copy also supports --from-distribution-spec / --to-distribution-spec to force how referrers are discovered (Referrers API vs. referrers tag schema). Only touch these if §3.4 shows your destination is a legacy registry that only understands the referrers tag scheme (or vice versa) — leave them at the default and let §3.4 be the arbiter.

3.4 Confirm the referrer graph survived

oras discover --depth 1 "registry.example.com/merkalis/kastoria-ohif@${DIGEST}"

Compare with the same command against the source ref. The tree below shows --depth 1 on ORAS 1.3; older/newer versions vary the column layout and whether annotations appear inline, so treat oras discover --format json (which yields artifactType + digest + annotations per referrer) as the comparison's source of truth rather than the pretty output:

registry.example.com/merkalis/kastoria-ohif@sha256:f7c1e79b5131...
├── application/vnd.cncf.notary.signature
│   ├── sha256:b3e85d02eeec...          (infra key, from the build)
│   └── sha256:...                       (dist key, added at promotion)
├── application/vnd.dsse+json
│   └── sha256:ba5806e878a6f8877dd0c735d4defa17d0ab1c6ea646ae7503436094366613a1   ← provenance
│       └── io.kastoria.slsa.provenance: "true"
└── application/spdx+json
    └── sha256:6161b920ff0976b3f11e170129576fc781dc64c0190fbf8cd5be9674b9fa86f6   ← SBOM

Both Notary signatures in the tree are already present on the source before the customer copy runs — promotion attaches the dist-key signature at the Merkalis side and the recursive copy passes both through unchanged. The same pair appears in the registry guide §6 tree.

The comparison rule for a customer mirror is set equality on referrers, both content and signature — the copy is content-addressed, so nothing should differ across the hop:

  • Content referrers (provenance, SBOM: everything that is not a Notary signature) must match the source exactly — same artifactType, same digest.
  • Signature referrers must also match exactly. Every signature the source carries must be present on the destination at the same digest, and the copy must not introduce any that were not on the source. A missing signature means the copy dropped evidence — treat it as a failed mirror and re-copy after fixing the cause. An extra signature means your destination changed the manifest (registry-side auto-signing is one benign possibility; middleware rewriting the referrer graph is the non-benign one). Either way, investigate before consuming.
  • The provenance's own signature referrers do not show here: --depth 1 lists children of the image; provenance signatures attach one level down, to the provenance digest. §4 verifies them.

(Our promotion gate uses a different, looser rule internally — signature set superset, not equality — because it copies from the internal build registry into dist, where a digest may already carry dist signatures from an earlier promotion of the same SHA under a different semver. Extras are legitimate there. That case does not apply to your one-shot copy out of dist, so demand equality.)

If the destination lists no referrers at all, the registry dropped them on push: it does not support the referrers API for your artifacts and cannot host evidence-bearing copies (see §2).

4. Verify in your registry (post-import)

Everything below runs against the destination reference and uses the same trust material you imported in registry guide §3 — the dist certificate is the single anchor on both sides (registryScopes: ["*"] matches your registry too).

4.1 Image signature

notation verify "registry.example.com/merkalis/kastoria-ohif@${DIGEST}"
# Successfully verified signature for registry.example.com/merkalis/kastoria-ohif@sha256:f7c1e79b...

4.2 Build provenance

Two separate facts, checked separately:

  1. It is attached to the copy you just made — §3.4's oras discover at the destination lists the provenance digest, and that digest equals the $PROV you recorded in §3.2 (a digest-preserving copy cannot change it).
  2. It is authentic Merkalis material — notation verify the provenance digest at the destination. notation verify on the image covers only the image manifest, never its referrers, so this is a second command and not a side effect of §4.1:
notation verify "registry.example.com/merkalis/kastoria-ohif@${PROV}"

What a pass proves — and what it does not — is exactly as described in registry guide §6: the signature authenticates the issuer and the binding of this provenance document to this image digest; it does not vouch for the truth of the claims inside. Read them:

oras pull "registry.example.com/merkalis/kastoria-ohif@${PROV}" -o ./provenance
cat ./provenance/*

Pin the pair (image digest, provenance digest) in your deployment records — that pairing is what prevents a provenance document being swapped between two images.

The SBOM ships as a content-addressed referrer, not a Notation-signed one — promotion signs the image and the provenance referrer (registry guide §6). Treat the SBOM's integrity as riding on the image digest binding (it is preserved by the same digest-preserved copy), not as an independently anchored attestation.

5. Mirror OpenTofu module packages

Module packages (modules/azure/<component>, see registry guide §7) are ordinary OCI artifacts with the same referrer model, so the recipe is identical — including §3.2's rule that the identity you verify and copy is the digest, not the mutable vX.Y.Z tag:

SRC=acrmerkalisdist0c66.azurecr.io/modules/azure/compute
MDIGEST=$(oras manifest fetch --descriptor "${SRC}:v0.0.1" | jq -r .digest)   # v0.0.1 = example tag

# 1. verify the digest at source
notation verify "${SRC}@${MDIGEST}"

# 2. copy with referrers (the signature is included)
oras copy --recursive \
  "${SRC}@${MDIGEST}" \
  registry.example.com/merkalis-modules/azure/compute:v0.0.1

# 3. verify in your registry — by digest, not by the tag you just wrote
notation verify "registry.example.com/merkalis-modules/azure/compute@${MDIGEST}"

Consumption works the same as the dist registry — your tofu init reads the destination credential from ~/.docker/config.json (docker login to your registry):

module "compute" {
  source = "oci://registry.example.com/merkalis-modules/azure/compute?tag=v0.0.1"   # example tag
}

To pin the consumed module by digest instead of tag, use ?digest=<sha256:…> with the MDIGEST above (one of ?tag= / ?digest=, never both). All modules share one version train: mirror every modules/azure/* repository you consume at the same release, resolving each to its own digest as above — a single version train does not mean a single digest.

6. Air-gapped environments: verify-before-transfer

When your environment has no registry reachable at transfer time, evidence cannot cross with the image — no signature travels in a tarball, and no post-import verification against the registry is possible. Accept this as a documented limit and control the transfer instead:

  1. Verify by digest on the connected machine, exactly as §3.2:
    SRC=acrmerkalisdist0c66.azurecr.io/<customer>/kastoria-testcontainer
    DIGEST=$(oras manifest fetch --descriptor "${SRC}:v0.0.1" | jq -r .digest)   # v0.0.1 = example tag
    notation verify "${SRC}@${DIGEST}"
    
  2. Export the digest-pinned image to a tarball:
    docker pull "${SRC}@${DIGEST}"
    docker tag "${SRC}@${DIGEST}" kastoria-testcontainer:v0.0.1
    docker save kastoria-testcontainer:v0.0.1 -o kastoria-testcontainer-v0.0.1.tar
    
  3. Record before transfer. Into your change-control record write the successful notation verify output line (it names the verified digest) and the checksum of the tarball you just created:
    sha256sum kastoria-testcontainer-v0.0.1.tar | tee kastoria-testcontainer-v0.0.1.tar.sha256
    
  4. Transfer via your normal media process. At the far end, recompute the checksum and compare it to the change record before loading. Only a match proves the bytes you are loading are the bytes that were checksummed after exporting what you verified.
  5. Load: docker load -i kastoria-testcontainer-v0.0.1.tar.

Keep the order — checksumming before the export would seal a checksum to a file that does not exist yet, and would leave the exported bytes unbound to anything you recorded.

Limits, stated plainly:

  • docker load does not preserve registry digests — RepoDigests is empty for loaded images. Do not attempt to "re-check the digest" with docker inspect after loading; that check can only fail to say anything.
  • There is no cryptographic re-verification available inside the air-gapped environment. The loaded image is the image that passed notation verify only to the extent that the recorded verify output, the tarball checksum, and the change-control process are followed and trustworthy. A tampered tarball is caught only by the checksum step.
  • If your air-gapped network has an internal registry, skip the tarball entirely: run oras copy --recursive from a connected mirror machine into the internal registry and do the full §3–4 verification there. That is the evidence-preserving offline pattern; use it whenever it exists.

Module packages follow the same logic, with a packaging twist — the artifact carries a zip whose root is the module root, and offline OpenTofu consumes module files from a local directory rather than a registry. On the connected machine:

SRC=acrmerkalisdist0c66.azurecr.io/modules/azure/compute
MDIGEST=$(oras manifest fetch --descriptor "${SRC}:v0.0.1" | jq -r .digest)   # v0.0.1 = example tag
notation verify "${SRC}@${MDIGEST}"                       # record the output line
oras pull "${SRC}@${MDIGEST}" -o ./compute-v0.0.1         # writes ./compute-v0.0.1/compute.zip
cd compute-v0.0.1 && unzip compute.zip -d src && cd ..    # zip root = module root
tar czf compute-v0.0.1.tar.gz -C compute-v0.0.1/src .
sha256sum compute-v0.0.1.tar.gz | tee compute-v0.0.1.tar.gz.sha256

After the checksum is verified at the receiving end, unpack into a directory inside your configuration tree and point tofu init at it with a relative source — vendored-directory consumption works with no registry and no cache priming:

module "compute" {
  source = "../../vendor/kastoria/compute-v0.0.1"   # contains main.tf, variables.tf, ...
}

Some teams instead copy .terraform/modules from a connected host where tofu init resolved the package. Two caveats if you do: the cache layout is OpenTofu-internal, so it cannot be rebuilt from the extraction above — your custody record then binds the cache directory as it left the connected host, not the digest you recorded; and whether later tofu init runs inside the isolated network try to re-download from the oci:// source depends on source matching and lock files, so test it before relying on it. Vendoring the extracted module, as above, is the straightforward audit trail: one tarball, one checksum, one recorded digest.

7. End-to-end validation checklist

Run this against one promoted release before treating the procedure above as validated for your environment. Re-run the checklist at first customer import, and again whenever your registry or tooling changes.

# Check Command / evidence
1 Tooling pinned oras version, notation version recorded
2 Trust material imported notation cert show --store merkalis-dist --type ca merkalis-dist-ca.pem prints the anchor; notation policy show lists merkalis-dist
3 Anchor fingerprint cross-checked out-of-band against the fingerprint published in the registry guide
4 Source release recorded oras discover --depth 1 on the dist ref → image, provenance, SBOM digests written down
5 Source verifies (image) notation verify "${SRC}@${DIGEST}" passes
6 Source verifies (provenance) notation verify "${SRC}@${PROV}" passes (§3.2)
7 Copy done oras copy --recursive by source digest → your registry, semver tag applied
8 Digest identical at destination oras manifest fetch --descriptor <dest>:<tag> equals $DIGEST
9 Referrer graph preserved dest oras discover --depth 1 vs source, per §3.4's rule: content referrers identical and signature referrers identical — no signature missing, none added
10 Destination verifies (image) notation verify <dest>@${DIGEST} passes
11 Destination verifies (provenance) notation verify <dest>@${PROV} passes
12 Provenance claims reviewed provenance pulled and its build claims (commit, pipeline) match the release you meant to import
13 Module package mirrored one modules/azure/* package copied + verified per §5
14 Negative control (recommended) docker save/load the same image into a scratch daemon, then docker push it to a disposable registry; notation verify and oras discover there find nothing. See note below.
15 Air-gapped rehearsal (if applicable) §6 flow completed once, including the receiving-end checksum comparison

Note on #14's ordering: notation verify and oras discover talk to a registry, and a docker loaded image exists only in the local Docker daemon — neither tool can inspect it there, and docker inspect on a loaded image shows no trace of signatures or referrers. So the control is push-then-query: only after the loaded image is pushed somewhere does the absence of signatures become visible. Push the loaded copy to a disposable registry rather than back to a real one, or it will look like a legitimate-looking unsigned artifact in a namespace that should contain only signed ones.

Record the checklist outcome (pass/fail per row, with any deviations) in your import runbook — it is the evidence trail that the procedure was executed as written, and it is what you diff against next time a release or a registry changes.

8. Troubleshooting

Symptom Cause / fix
oras copy succeeds, oras discover at destination is empty Destination dropped referrers (no referrers API / proxy between). §2/§3.4 — registry is unusable for evidence-bearing mirrors; check for an intermediary cache first
notation verify fails with "no trust policy matching" Trust policy not imported on this host, or the policy's registryScopes was edited to exclude your registry. Re-run registry guide §3; do not invent a second policy — the published one is * on purpose
notation verify passes at dist, fails on the mirror copy Content differs → digests will not match. Check destination middleware/rewriting, and re-compare §3.4 output. Verify by digest, never by tag
oras login succeeds but notation gets 401/403 notation uses its own credential store: notation login per registry (§3.1)
Provenance verifies on images promoted on/after 2026-10-08 but not an older one Expected: pre-cutoff provenance was not dist-signed. See the note in registry guide §6 — ask Merkalis to re-sign it (attaches a dist signature; no artifact moves)