Skip to content

Phase 5: sindri registry serve --sign-with re-signing (ADR-028) #275

@pacphi

Description

@pacphi

Background

sindri registry serve ships in Phase 3 (#259) as a read-only embedded OCI registry over a components directory. The original spec called for an optional --sign-with <key> flag so operators could test end-to-end strict-OCI verification against a local dev registry.

In PR #259 the flag was stripped because shipping a flag that parses but no-ops would have been misleading. The use case (local signed-pull testing) is real but niche, and re-signing is non-trivial — it requires v4's first signing operation (everything else is verification).

In scope

  • New CosignSigner sibling to the existing CosignVerifier (v4/crates/sindri-registry/src/signing.rs). Reads a cosign private key, signs a manifest digest per the cosign manifest spec.
  • Wire --sign-with <keyfile> back onto sindri registry serve (v4/crates/sindri/src/commands/registry/serve.rs).
  • When --sign-with is set, every served manifest is signed and the cosign signature manifest is injected into the served index.json per the spec.
  • Optional --key-password-env <var> for password-protected keys; never read from prompt in a server (would block).
  • Update v4/docs/SOURCES.md to remove the "Phase 5 follow-up" note on serve and document the flag.
  • Tests: pull from serve --sign-with <key> via oci-distribution's client, verify the cosign signature against the configured key.

Out of scope

  • Production signing infrastructure (KMS, HSM integration). --sign-with is for local dev/test of the trust chain.
  • Re-signing in prefetch — that workflow's contract is verbatim manifest streaming (preserves upstream signatures); see Phase 3 follow-up rationale.

Verification

  • sindri registry serve --root ./components --sign-with ./test-cosign.key is reachable from a LocalOciSource with supports_strict_oci() returning true against the configured key's trust scope.
  • An apply --strict-oci against a registry served with --sign-with succeeds end-to-end with no network.
  • Without --sign-with, served manifests are unsigned (current behaviour); --strict-oci correctly rejects them.

Reference

  • ADR-028 — v4/docs/ADRs/028-component-source-modes.md
  • DDD-08 — v4/docs/DDDs/08-registry-source-domain.md
  • SOURCES.md — v4/docs/SOURCES.md
  • Plan §5 — v4/docs/plan/source-modes-implementation.md
  • ADR-014 (signed registries with cosign) — v4/docs/ADRs/014-signed-registries-cosign.md
  • Existing CosignVerifier to mirror — v4/crates/sindri-registry/src/signing.rs
  • Existing serve command — v4/crates/sindri/src/commands/registry/serve.rs
  • Phase 3 follow-up that stripped the no-op flag — PR feat(v4): Phase 3 — GitSource, registry serve/prefetch, OCI blob streaming (ADR-028) #259

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions