Skip to content

Pull images and check signatures through Tor, with the Tor image baked and the boot-time cosign check offline #4150

Open

Description

@pithead-developer

What's the problem

Images and their signature check still reach the clearnet. Tor-only egress is the owner's ruling (2026-11-16 "all as recommended" on the egress plan), so this path has to move onto Tor or off the network.

  • docker-compose.yml pulls ghcr.io images and three docker.io images (tecnativa/docker-socket-proxy twice and caddy). Those three refs are not fully qualified, so they depend on registry search order.
  • verify_release_images (lib/pithead/03-release-verify.sh) runs cosign from a container image pinned at ghcr.io/sigstore/cosign/cosign@sha256:.... cosign_run does docker pull -q and docker run, so each check can dial ghcr.io from a default-bridge container, outside the Tor fence.
  • It is not a one-off. pithead-boot runs ./pithead up on every boot, and up calls verify_release_images (lib/pithead/01-lifecycle.sh:248, just after the Tor egress firewall step). A box that is offline or behind a Tor-only firewall cannot finish that check.
  • The Tor image cannot be pulled through itself. The loader for baked archives already exists (load_baked_images in lib/pithead/11-baked-images.sh), but Tor is not relied on as baked.
  • The first-party quadlet units pin the Tor image by tag only (os/quadlet/tor.container).

What it impacts

Every appliance boot and every update or upgrade. Today a clearnet connection to ghcr.io happens outside Tor on each boot, and a firewall that drops non-Tor traffic would break boot-time verification. DIY installs run the same verifier.

How I found it

From the Tor-only egress inventory and plan in research (nothing filed before). I read 03-release-verify.sh, 01-lifecycle.sh, 11-baked-images.sh, docker-compose.yml and os/quadlet/tor.container on origin/develop with git show. Unknown until tried: how ghcr.io and docker.io treat Tor exit nodes for anonymous pulls (no primary source exists), whether the podman service honours proxy settings set only on the CLI, and how large the images are compressed and in storage. Go clients ignore ALL_PROXY, so only HTTPS_PROXY works.

How important is it

High, and a blocker for the 2.0.5 egress firewall. Without this step the firewall (log-only first in #4145 (step 1: log-only firewall and netwatch), enforcing last in #4154 (step 9: enforce the firewall)) either blocks boot or needs a permanent hole for registries. It is also the step most likely to fail in the field on exit-node rate limits, which is why it carries a live trial and a bounded benchmark.

Acceptance criteria

  • The Tor image ships in the RAUC slot and is loaded by the existing baked-image loader. A box with no registry access reaches a healthy Tor.
  • One host pull script is the only way images are fetched. It sets HTTPS_PROXY=socks5h:// to Tor, waits for Tor to report healthy first, backs off and retries on HTTP 429 and 403, and compares each pulled digest with the pinned one. A mismatch or a persistent failure is a distinct, readable error, not a signature-failure report.
  • After the script runs, compose and the quadlets start with pull policy never. A start with a missing image fails with a clear message instead of reaching a registry.
  • Every image ref in compose, quadlets and docs is fully qualified (for example docker.io/library/caddy, docker.io/tecnativa/docker-socket-proxy).
  • On the appliance, verify_release_images runs the host cosign (already in the rootfs) against a signed digest list shipped in the RAUC slot and opens no network connection. No cosign container is pulled or run. A tampered list or a digest not on the list refuses to start the stack.
  • DIY installs keep an online check, routed through Tor. With Tor down it fails closed with a clear message and never falls back to a direct connection.
  • A negative probe shows podman pull outside the script cannot reach a registry once the firewall enforces.
  • Live trial, run first: pull every non-baked image from ghcr.io and docker.io through a Tor exit on a clean box, several times at different hours, and record success rate, 429 and 403 counts and time per image. If docker.io throttles, the small docker.io images are baked or mirrored; the decision and the numbers are written down.
  • Bounded measurement (hours per arm, at most 24 h per run, no soak), comparing direct pulls with the Tor script on the same hardware: time per image and for a full cold install, success rate with retries, boot-to-healthy time with the offline check versus today, and whether a cold pull over Tor delays or stalls the stack already running (sync, mining shares and hashrate during the pull). It uses the update and first-boot legs of [benchmark] Stability and mining impact of Tor-only egress #4155 (benchmark) where they apply, and results are posted on this issue.
  • The one-click upgrade path (verify-blob on the bundle) is retested with the pinned cosign version and still works.

Possible solutions

  • Pull script (recommended): a single host script as above. It gives one owner for proxy settings, retries and errors. Put the same proxy settings in a drop-in on the podman service so compose pulls inside it are covered, since it is unknown whether containers.conf [engine] env reaches podman system service.
  • Proxy settings only, no script: the minimal form, close behind in value, but retries, back-off and clear errors have no home.
  • Offline cosign: on the appliance the slot is already RAUC-signed and carries the pinned digests and cosign.pub, so verifying a signed digest list with host cosign (verify-blob, expecting a --bundle on cosign v3) adds authenticity at no network cost. Dropping the runtime check entirely on the appliance is the fallback if the list adds too much.
  • If Docker Hub throttles: bake the small docker.io images (caddy and the socket proxy), or mirror them under the project's own registry. A LAN pull-through mirror is not recommended: it adds a box, and a fallback to the primary registry is a leak.
  • Not now: baking every image. It roughly triples the image size and every update bundle.

Related: #4144 (tracker), #4151 (step 6: rig Tor client), #4135 (healthcheck over Tor), #4125 (Tor version pin).

Activity

  1. added this to the v2.0.5 milestone on Nov 16, 2026
  2. added
    security
    appliance
    operator-action
    on Nov 16, 2026
  3. added
    blocked
    on Nov 16, 2026
  4. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4148.
    Blocked on #4149.

    Step 6 of the rollout order in #4144: it starts when steps 4 and 5 close.

  5. removed
    operator-action
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    applianceblockedsecurity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions