Skip to content

ci: sign the published image in CI via OIDC-federated KMS - #268

Closed
robinnsc wants to merge 2 commits into
mainfrom
ci/sign-image-workflow
Closed

ci: sign the published image in CI via OIDC-federated KMS#268
robinnsc wants to merge 2 commits into
mainfrom
ci/sign-image-workflow

Conversation

@robinnsc

Copy link
Copy Markdown
Collaborator

What

A sign-image workflow: dispatch it with a verified image digest and an
approved run signs that digest on Docker Hub with the production KMS key —
attached Cosign signature, legacy tag-based storage, no transparency log
(deliberate, see below). AWS access is OIDC-federated (id-token: write);
there are no new secrets anywhere. cosign is pinned by checksum, the
credentials action by commit SHA. A post-sign gate fails the run unless the
sha256-<digest>.sig TAG exists and is a single OCI manifest — the exact
failure mode cosign v3's defaults produce (new-format referrer, no tag),
which we hit live on ECR tonight.

Why

Manual signing requires one person to simultaneously hold a production KMS
session and the team registry credential on a laptop. Nobody should be
comfortable with that. This moves the act into the dockerhub environment,
which supplies the registry credential it already holds and enforces the
two-person rule mechanically (required reviewers, no self-review, main
only) instead of by chat message.

The AWS side is already live and verified: ExtendDBContainerSigningCI
can be assumed only via GitHub OIDC by runs of this repository in the
dockerhub environment, and the key policy (both its Allow and its
explicit Deny) admits exactly that role plus the manual break-glass
operator role. This is Phase 1 of the pipeline consolidation plan, pulled
forward — nothing here is launch-throwaway.

Transparency log is off this release for consistency with the ECR
signature (signed from a corp machine, which cannot reach Rekor — it is
DNS-sinkholed). Runners can reach Rekor, so next release this becomes a
one-flag change plus runbook update.

Testing done

Checklist

  • All tests pass (cargo test --workspace) — not applicable, workflow-only change
  • Code is formatted (cargo fmt --check) — not applicable
  • Clippy is clean (cargo clippy -- -W clippy::pedantic) — not applicable
  • I have added or updated tests for new functionality — gates traced above; post-sign tag gate is the regression test for the storage-mode trap
  • I have updated documentation if behavior changed — header documents rationale, trust chain, and the Rekor plan; runbook update follows merge
  • Breaking changes are noted below (if any)

ADR / RFC: n/a — CI tooling only.

Breaking changes

None. The manual signing path remains available as break-glass.


By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.

Moves production Docker Hub signing off operator laptops into a
reviewer-gated workflow: the dockerhub environment supplies the
registry credential and enforces the two-person rule mechanically,
and AWS access is OIDC-federated to a role only this repository's
approved environment runs can assume. Pins cosign by checksum and
the credentials action by commit SHA, forces the proven tag-based
storage flags, and fails the run if the .sig tag does not appear.
github.ref_name on a workflow_dispatch from main is 'main', which
would have annotated production signatures with the wrong release.
Sign up for freeto 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

@robinnsc