Skip to the content.

Air-gapped mirror: pre-warm, export/import & sealed mode

This document describes the operational tooling for disconnected and enterprise deployments (Task 17): pre-warming a cache from a declarative manifest, exporting the cache and provenance metadata to a portable, integrity-verified bundle, importing that bundle into an isolated instance, and running the proxy in sealed (offline) mode where it serves only from cache and never reaches upstreams.

All three CLI subcommands operate on the same content-addressable cache store and provenance link store the running proxy uses, so the data they read and write is exactly what the gateway serves.

pullthrough prewarm  -config c.yaml -manifest warm.yaml   # fill cache from a manifest
pullthrough export   -config c.yaml -out bundle.tar       # serialize cache → bundle
pullthrough import   -config c.yaml -in  bundle.tar       # load bundle → cache (verified)

The typical workflow

┌─────────────── connected (staging) ───────────────┐      ┌──── air-gapped (prod) ────┐
│  1. prewarm  → pulls packages/images into cacheA   │      │                           │
│  2. export   → cacheA + provenance → bundle.tar    │ ───► │  3. import → cacheB        │
│               (+ bundle.tar.sha256 manifest digest)│ usb/ │     (verifies every blob   │
│                                                    │ wire │      against its digest)    │
└────────────────────────────────────────────────────┘      │  4. run sealed: serve-only │
                                                             └────────────────────────────┘

Transfer the bundle and its .sha256 sidecar (the manifest digest) to the target through your approved channel. The digest is what lets the importer prove the bundle was not altered in transit.

1. Pre-warming the cache

Author a declarative manifest of the artifacts the sealed instance must serve. Each entry names an upstream (by its configured route name) and the request path under it — the same path a client would request through the proxy.

# warm.yaml
packages:
  - upstream: npm
    path: /lodash/-/lodash-4.17.21.tgz
  - upstream: pip
    path: /packages/source/r/requests/requests-2.31.0.tar.gz
images:
  # For Docker/OCI, list the manifest and each layer/config blob you need.
  - upstream: dockerhub
    path: /v2/library/alpine/manifests/3.19
  - upstream: dockerhub
    path: /v2/library/alpine/blobs/sha256:c6a83f...
pullthrough prewarm -config c.yaml -manifest warm.yaml -concurrency 8

Pre-warming replays each request through the live backend Resolve/Fetch pipeline — the exact code path the proxy uses on a cache miss — so warmed entries land under precisely the keys the proxy will later read. Already-cached entries are reported as cached and not re-fetched. Use -continue-on-error to warm as much as possible and collect failures rather than stopping at the first.

Non-cacheable resources (mutable index documents such as npm packuments or PyPI Simple pages) cannot be pinned and are reported as errors — pre-warm the concrete artifact paths instead.

2. Exporting a bundle

pullthrough export -config c.yaml -out bundle.tar

The bundle is an ordinary tar archive with a deterministic layout:

pullthrough-bundle.json          # manifest: format version, per-entry records + digests, provenance links, scan verdicts
blobs/<sha256-of-cache-key>      # one content blob per cache entry, in sorted order

Pass -no-provenance to omit provenance links (cache content only). The export requires cache.backend: filesystem.

3. Importing a bundle

pullthrough import -config c.yaml -in bundle.tar -manifest-digest bundle.tar.sha256

Import verifies integrity at two levels:

  1. Per-blob. Each blob is streamed into the cache store while its content is hashed and checked against the digest recorded in the manifest. A mismatch aborts the import and the partially-written entry is removed — a tampered or corrupt blob never lands in the cache.
  2. Whole-bundle (optional). When -manifest-digest is supplied (either a literal sha256:… or the path to the .sha256 sidecar), the importer recomputes the manifest digest and refuses the bundle on any mismatch, detecting tampering of the manifest itself.

Resumable / idempotent. Entries already present at the expected size are skipped, so re-running an interrupted import only transfers what is missing. Pass -overwrite to force re-importing every entry.

Scan verdicts need the manifest digest. Imported content is gated when it is served, like anything else in the cache, so importing blobs from a bundle nobody vouched for adds no trust. A verdict is different: the importing instance acts on it — a “benign” verdict admits an artifact without a scan. Verdicts are therefore imported only when -manifest-digest was given and matched, i.e. when the bundle is known to be the one the exporting instance wrote. Without it the blobs are imported, the verdicts are not, and the import says how many were left out. In addition:

4. Sealed (offline) mode

Set cache.sealed: true to run a fully disconnected instance:

cache:
  backend: filesystem
  dir: /var/lib/pullthrough/cache
  sealed: true

In sealed mode:

Sealing is defence in depth, not a substitute for network isolation: deploy a sealed instance with no network route to upstreams as well. The admin overview (info.cacheSealed) reports whether sealing is active.

Pre-warming intentionally bypasses the seal (it must reach upstreams). Run prewarm on a connected instance — or against a connected config — before sealing the production instance.

5. Offline security-feed bundles

Several admission gates ingest curated external feeds that a sealed instance cannot reach live. Each exports a signed bundle on a connected host for transfer into the air-gapped environment: