Skip to content

mirror-image: dedicated reusable workflow for signing third-party mirrors - #5

Merged
jt-lumen merged 4 commits into
masterfrom
jonthia/publish-image-mirror-mode
Sep 16, 2026
Merged

jt-lumen merged 4 commits into
masterfrom
jonthia/publish-image-mirror-mode

Conversation

@jt-lumen

@jt-lumen jt-lumen commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

What

A new reusable workflow, `mirror-image.yml`, for third-party images we run but don't build: it crane-copies a digest-pinned upstream ref into `mirror/` in both ECRs (digest asserted end-to-end) and signs it with this workflow's own identity. First user: the SEDA data proxy (`ghcr.io/sedaprotocol/seda-data-proxy`), wired up in infrastructure-v3 PR #1885.

`publish-image.yml` is untouched (an earlier commit added mirror mode inside it; reverted here after security review — see below).

Why a separate identity

A mirror signature means "we reviewed and chose this upstream digest" — weaker than publish-image's "built from reviewed source" — so the two must not be interchangeable. The split is enforced two ways:

  • this identity (`mirror-image.yml@refs/heads/master`) is accepted only by the new `velocity-ecr-mirror-keyless` ClusterImagePolicy, whose glob is `/mirror/*`; the app-image policy is narrowed to single-segment repos so the two image sets are disjoint (matching CIPs AND together);
  • the `mirror/` path prefix is forced inside this workflow, not taken from the caller — so this identity can physically never sign a ref the app-image policy matches.

Net: a compromised mirror flow cannot mint a signature accepted for an app image, and vice versa.

Upstream verification hook

`source_verify_identity` / `source_verify_issuer`: set them once the upstream signs their releases and the mirror cosign-verifies the upstream signature before copying, failing closed on mismatch. Unset (today — SEDA has been asked to add signing), the run summary carries an explicit "NOT verified" warning; the trust anchor is the PR-reviewed digest, which content-addressing makes immutable.

Same invariants as publish-image: master-ancestry gate, cosign v2 pin, digest-preserving copies with assertions.

Ordering

Merge before the first `seda-data-proxy-v*` tag on infrastructure-v3 (mirror tags call this file `@master`), and before infra PR #1885's CIP change ships to clusters is fine either way — the new CIP only matches `mirror/*`, which is empty until the first mirror runs.

…am image

source_image (a ref pinned by digest) skips the build and crane-copies
that exact manifest into our ECR, then signs it under this workflow's
identity — so third-party images we run (first user: the SEDA data
proxy, ghcr.io/sedaprotocol/seda-data-proxy) pass the same admission
policy as images we build, with the digest reviewed in the caller's PR.

source_verify_identity/issuer are the future hook: set once the
upstream signs their releases, and the mirror cosign-verifies the
source before copying (fails closed). Unset today — SEDA doesn't sign
yet (asked); the run summary carries an explicit warning.

Digest handling is unified in a resolve step (build output or upstream
pin); the prod copy + both sign steps read from it, preserving the
digest-end-to-end invariant. setup-crane moves earlier and runs
unconditionally since mirror mode needs it before the prod section.
…or third-party mirrors

Replaces the mirror mode previously added inside publish-image.yml
(reverted here): a mirror signature means 'we reviewed and chose this
upstream digest', which is weaker than 'built from reviewed source' and
must not be interchangeable with it.

The split is enforced two ways: this workflow signs with its own
identity (mirror-image.yml@refs/heads/master), accepted only by the
mirror ClusterImagePolicy whose glob is <registry>/mirror/*; and the
mirror/ ECR path prefix is forced inside this workflow rather than
taken from the caller, so this identity can never sign a ref the
app-image policy matches. publish-image.yml stays byte-identical to
master — build mode untouched.

Same invariants otherwise: master-ancestry gate, cosign v2 pin,
digest-preserving crane copies asserted end-to-end, and the
source_verify_identity/issuer hook that turns on upstream cosign
verification once the upstream (SEDA) signs releases.
@jt-lumen jt-lumen changed the title publish-image: mirror mode — copy + sign a digest-pinned upstream image mirror-image: dedicated reusable workflow for signing third-party mirrors Sep 16, 2026
… via env

Two review findings, both flagged independently by the Opus and Codex
review passes:

- the upstream-verification guard skipped when EITHER identity or issuer
  was empty, so a caller that set one and typo'd the other got a green
  run with verification silently off. Skip only when both are empty;
  error when exactly one is set.
- the prod signing step interpolated inputs.name straight into the run
  script, one step after the prod AWS credentials are configured. Pass it
  through env: and quote it, matching the non-prod signing step.
@jt-lumen
jt-lumen merged commit 966ccad into master Sep 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants