Skip to content

feat(ci): sign v2 images + build the signed greffer-updater (self-update v2) - #85

Merged
omarsy merged 1 commit into
mainfrom
feat/greffer-v2-image-signing
Jun 17, 2026
Merged

omarsy merged 1 commit into
mainfrom
feat/greffer-v2-image-signing

Conversation

@omarsy

@omarsy omarsy commented Jun 16, 2026

Copy link
Copy Markdown
Member

What

The final greffer self-update v2 piece: the release-pipeline signing the manager-push path verifies against. Managed cosign key, offline verify (no Rekor/tlog), per the merged trust model (docs/features/greffer-self-update/v2-image-provenance-and-trust-model.md).

Pairs with the merged v2 code: greffer#83, manager#120, manager-front#50.

Pipeline (docker-publish.yml)

  • Version label: stamp org.opencontainers.image.version on greffer / greffer-nginx / tunnel-sidecar (the label the updater reads for the min_supported floor + cohesion check, never the tag).
  • New greffon/greffer-updater image (Dockerfile.updater, multi-arch): the detached container the greffer spawns. python + the greffer_cli updater + docker-cli/buildx/compose + cosign (pinned ko image), baking /etc/greffer/cosign.pub (build secret from the COSIGN_PUBLIC_KEY variable) + min_supported_baseline. No ENTRYPOINT (the greffer supplies the full python -m greffer_cli.updater <tag>).
  • Sign all four greffon/* images by digest with a per-repo annotation (-a repo=<repo>), --tlog-upload=false, then round-trip each: the updater's exact cosign verify and a pull + docker inspect version-label read, so a cosign flag/behaviour drift or a missing label fails the release here, not silently in production.
  • Set-closure guard: assert every greffon/* image the shipped compose template renders is in the enumerated signed set (a new service can't ship unsigned).
  • Gated: signing + the updater build only run once COSIGN_PRIVATE_KEY (secret) + COSIGN_PUBLIC_KEY (variable) are provisioned, so main stays green until ops sets them; node images keep publishing (unsigned) meanwhile.

Verify-side fix (the contract the signing must match)

The merged greffer verify had two latent bugs that would have made every v2 verify fail closed:

  • It omitted --insecure-ignore-tlog, so against the offline --tlog-upload=false signatures cosign v2 would demand a Rekor entry and refuse. Added to provenance.cosign_verify + floor.verify_blob.
  • It used the singular --annotation (not a cosign flag — cosign has -a/--annotations). Switched both sides to -a. The CI round-trip runs the greffer's exact command, so this is now self-validating.

Tests assert both (-a repo= + --insecure-ignore-tlog=true on the image and blob paths). Full cli suite 203 green.

Ops handoff (docs/release-signing.md)

Keygen, the three CI entries, per-host opt-in + updater digest pin (GREFFER_UPDATER_IMAGE=...@sha256:), signing + publishing the version manifest .sig, the min_supported baseline policy, and key rotation. The CI round-trip also enforces that the public key actually pairs with the private key.

Review

3-lens independent review to convergence (cosign-semantics, CI/Docker, contract-consistency): cosign flags verified correct, contract clean across all 8 checks. Round 1 caught a P1 (the root .dockerignore allowlist stripped cli/ + min_supported_baseline from the updater's context: . build — fixed with a scoped Dockerfile.updater.dockerignore) and a P2 (extend the smoke to the label-read path) + P3s. Round 2 converged clean.

CI note

docker-publish runs on push-to-main only (not PRs), so this PR can't exercise the signing path here; it goes live once merged + keys provisioned. The cli-release PR check does validate the greffer_cli changes.

🤖 Generated with Claude Code

…ate v2)

Wires the v2 image-provenance pipeline (managed cosign key, offline verify, no
Rekor) so the manager-triggered remote update has signed artifacts to verify.

docker-publish.yml:
- Stamp org.opencontainers.image.version on greffer / greffer-nginx /
  tunnel-sidecar (the label the updater reads for the floor + cohesion check).
- Build + push greffon/greffer-updater (new, multi-arch) from Dockerfile.updater,
  baking cosign.pub (build secret from the COSIGN_PUBLIC_KEY variable) + the
  min_supported baseline.
- Sign all four greffon/* images by digest with a per-repo annotation
  (-a repo=<repo>), --tlog-upload=false, and immediately round-trip each with the
  updater's EXACT verify command so a cosign flag/behaviour drift fails the
  release here, not silently in production.
- Set-closure guard: assert every greffon/* image the shipped compose template
  renders is in the enumerated signed set (a new service can't ship unsigned).
- All signing + the updater build are gated on the key material being provisioned
  (COSIGN_PRIVATE_KEY secret + COSIGN_PUBLIC_KEY variable), so main stays green
  until ops sets them; node images still publish meanwhile (unsigned).

Dockerfile.updater: python + greffer_cli wheel + docker-cli/buildx/compose +
cosign (pinned ko image), bakes /etc/greffer/{cosign.pub,min_supported_baseline}.
No ENTRYPOINT (the greffer spawns the full `python -m greffer_cli.updater <tag>`).

Verify-side fix (the contract this signing must match): provenance.cosign_verify
and floor.verify_blob now pass --insecure-ignore-tlog=true (the offline managed
-key model has no tlog; without it cosign v2 requires one and fails every genuine
image), and use the short -a annotation flag (cosign has no singular
--annotation). Tests assert both.

docs/release-signing.md: ops handoff (keygen, CI secrets/variable, per-host
opt-in + digest pin, manifest sign-blob + publish, baseline policy, rotation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@omarsy
omarsy merged commit fbdab7b into main Jun 17, 2026
6 checks 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.

1 participant