Skip to content

Supply chain

patchy has two command groups that run without a cluster. They turn what a platform runs into signed OCI artifacts in your own registries:

  • patchy mirror brings in what you did not write. It vendors upstream helm charts, the images they deploy and standalone OCI artifacts into a git tree for review (it copies the upstream files into your repository). It pins each one by digest, checks it against its publisher's signatures and scans it. Then it copies it into your registries, signed with your own identity.
  • patchy build publishes what you did write. It builds and scans Dockerfile images and Flux manifest directories before anything is pushed. Then it publishes and signs them the same way.

Both stop at the registry. Neither touches a cluster and neither runs git: commits, branches and pull requests belong to the pipeline that calls them. Both read the same patchy configuration for where to publish, how to sign and which scan policy applies. So a mirrored chart and a first-party image meet the same standard. You can also limit each one to approved sources.

patchy mirror patchy build
Input charts/<name>/manifest.yaml, artifacts/<name>/manifest.yaml the config's build.images and build.manifests
Committed the manifest, plus everything derived from it: vendored chart, rendered output, digest locks, allowlist the Dockerfiles and manifest trees themselves, plus security/allowlists/<name>.yaml
Gate validate: regenerate and byte-compare, verify provenance, scan, lint --dry-run: build and scan without a registry
Publish sync: copy charts and images by digest, sign build: push every tag, sign
Moves pins upgrade (the only verb that reads the clock) never: you choose the tags

The pipeline

Both groups run from the same three CI triggers:

  • A pull request runs the gate. The gate checks that the change is safe, and it needs no credentials.
  • A merge publishes the change.
  • A schedule finds what has changed since then, upstream or in the vulnerability databases.
flowchart LR
  pr["pull request"] --> gate["mirror validate (changed entries)<br/>build --all --dry-run"]
  merge["merge to main / release"] --> publish["mirror sync --all<br/>build --all"]
  cron["schedule"] --> sweep["mirror upgrade --check → update PRs<br/>mirror validate --only scan,lint → issues<br/>build --update-allowlists → allowlist PRs"]

Every verb that prints a report supports -o markdown. You can paste that output as-is into a job summary, a sticky PR comment or an issue body. -o json gives the same report as data. The exit code always carries the gate's result, so a workflow never has to parse the output to decide whether to fail.

Registries

registries lists every registry an artifact is published to. Every mirror entry and every build entry goes to all of them. --registry narrows a single run (patchy mirror sync --all --registry ghcr).

registries:
  - name: google # keys the lock files' targets and --registry
    url: us-central1-docker.pkg.dev/acme-platform/platform
    chartNamespace: charts # mirror: where charts land under the url (default charts)
    imageNamespace: images # mirror: images land at images/<canonical source path>
    artifactNamespace: artifacts # mirror: artifacts land at artifacts/<canonical source path>
  - name: aws
    url: 123456789012.dkr.ecr.eu-west-1.amazonaws.com/platform
    signing: # optional: replaces the top-level signing block for this registry
      provider: kms
      kms:
        key: awskms:///arn:aws:kms:eu-west-1:123456789012:alias/platform-signing

The namespaces apply only to mirrored content. A build entry names its own repository, which is published at <url>/<repository>:<tag>.

patchy logs in to registries through the docker keychain, the credential store that docker login writes to. Log in to each registry host (docker login, crane auth login, or a cloud credential helper) before you run sync or build. patchy, cosign and buildx all read it.

Signing

Everything published is signed with cosign. The signature is stored as a sigstore bundle attached through the OCI referrers API. Older ECR private registries without referrers support fall back to cosign's tag-based scheme. The top-level signing block is the default. A registry's own signing block replaces it completely for pushes to that registry.

signing:
  provider: keyless # keyless | kms
  keyless:
    certificateIdentity: https://github.com/acme/platform-mirror/.github/workflows/publish.yaml@refs/heads/main
    certificateOidcIssuer: https://token.actions.githubusercontent.com
    tlogUpload: true # public transparency log entry; turn off for private repositories
  # kms:
  #   key: gcpkms://projects/<p>/locations/<l>/keyRings/<r>/cryptoKeys/<k>
  • keyless signs with the run's ambient OIDC identity. In GitHub Actions, the workflow's id-token: write token becomes a short-lived Fulcio certificate whose subject is the workflow file at its ref. Before signing, patchy checks existing signatures against certificateIdentity. A digest that already carries a valid signature with that identity is not signed again, which keeps re-runs quiet. A digest signed under another identity (an edge workflow versus a release workflow, say) is signed again. The extra signature does no harm.
  • kms signs with a cloud KMS key (gcpkms://, awskms://, azurekms://, hashivault://). The installed cosign build decides which key schemes work.

Publishing needs cosign v3 or later on PATH. An image index is signed recursively, so every platform manifest is signed too.

Consuming what you publish

The artifacts are ordinary OCI artifacts, so any OCI client can pull them. Verify them the same way you configured them to be signed:

cosign verify us-central1-docker.pkg.dev/acme-platform/platform/charts/cert-manager:v1.21.2 \
  --certificate-identity https://github.com/acme/platform-mirror/.github/workflows/publish.yaml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

A Flux OCIRepository makes the same check on every reconcile with its verify block. So does a HelmChart pulled from an OCI HelmRepository for a mirrored chart. Pin the identity with matchOIDCIdentity. Use a subject regexp when several workflows publish to the same repository:

apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata:
  name: platform
  namespace: flux-system
spec:
  url: oci://us-central1-docker.pkg.dev/acme-platform/platform/manifests/platform
  ref:
    semver: ">=0.0.0"
  verify:
    provider: cosign
    matchOIDCIdentity:
      - issuer: ^https://token\.actions\.githubusercontent\.com$
        subject: ^https://github\.com/acme/platform-manifests/\.github/workflows/publish(-edge)?\.yaml@refs/.+$

What you need installed

patchy runs these tools as separate programs and does not bundle them. They must be on PATH for the verbs that use them:

Tool Needed by
cosign v3+ mirror validate (provenance verification), mirror sync (provenance verification and signing), build (signing; not --dry-run)
osv-scanner v2 image scans when scan.scanners.osv.enabled
grype image scans when scan.scanners.grype.enabled
kubescape configuration scans when scan.scanners.kubescape.enabled; skipped with a warning when missing
docker with buildx build of image entries (not needed for manifests entries)

You do not need Helm. Chart pulls, renders and pushes use the helm SDK built into patchy. It is pinned to one version so rendered output stays byte-for-byte the same.

Repositories on the shared toolchain

A repository on the bitwise-media-group toolchain gets all of this from the containers archetype. It provides pinned patchy, cosign, scanners and Flux validation tools, plus mise tasks that run these commands. mise run build runs patchy build --all --dry-run, mise run publish publishes, and the mirror-* tasks drive a mirror store. Before each patchy build, the tasks set GIT_COMMIT, VERSION and SOURCE_DATE_EPOCH from git, so tag templates expand the same way locally and in CI. See the containers archetype.