Skip to content

feat(policies): verify-images Kyverno policy for factory-built images#12

Merged
stxkxs merged 1 commit into
mainfrom
feat/verify-images-policy
Jun 24, 2026
Merged

feat(policies): verify-images Kyverno policy for factory-built images#12
stxkxs merged 1 commit into
mainfrom
feat/verify-images-policy

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 22, 2026

Copy link
Copy Markdown
Member

Why

Sibling of nanohype/eks-gitops#47. The factory signs every image it ships (keyless Cosign in the operator + tenant release workflows), but no cluster verified those signatures — a hand-pushed or tampered image was admitted like a signed one. Tenants publish to ghcr.io/nanohype/* regardless of cluster, so the same registry-scoped check belongs on AKS.

What

New policies/kyverno/supply-chain/ group (pure Kustomize, like best-practices / pod-security-standards):

  • verify-images ClusterPolicy scoped to ghcr.io/nanohype/* (foreign images pass untouched).
  • Keyless Cosign attestor matching the release-workflow identity (GitHub Actions OIDC issuer, subject github.com/nanohype/<repo>/.github/workflows/release.ya?ml@refs/tags/*), public Rekor.
  • required: true, mutateDigest/verifyDigest: false, webhookTimeoutSeconds: 30.
  • ApplicationSet entry kyverno-supply-chain at sync-wave 22.

Rollout

Audit across all three envs (report, don't block). Flip to Enforce is a one-line AuditEnforce change per overlay — staging first after a clean audit week, then production.

Verification

task validate (yamllint + kustomize build all environments) — green.

Mirrors the eks-gitops supply-chain policy onto AKS. The factory's tenants and
operator publish to ghcr.io/nanohype/* and are signed by their release
workflows (keyless OIDC) regardless of which cluster they land on, so the
registry-scoped signature check applies identically on AKS clusters.

─────────────────────────── What changed ───────────────────────────

policies/kyverno/supply-chain/ (new) — a `verify-images` ClusterPolicy with
base + dev/staging/production overlays:
  - Scopes to imageReferences `ghcr.io/nanohype/*`; foreign images pass untouched.
  - Keyless Cosign attestor matching the release-workflow identity (issuer
    GitHub Actions OIDC, subject `github.com/nanohype/<repo>/.github/workflows/
    release.ya?ml@refs/tags/*`), verified against public Rekor.
  - required: true, mutateDigest/verifyDigest: false; webhookTimeoutSeconds: 30.
  - Excludes kube-system/kube-public/kube-node-lease/kyverno.

applicationsets/kyverno-policies.yaml — adds the `kyverno-supply-chain` entry
at sync-wave 22, same matrix generator and per-environment overlay path as the
existing policy groups.

─────────────────────────── Rollout ───────────────────────────

Ships in Audit across all three environments — unsigned ghcr.io/nanohype/*
images are reported, not blocked. The overlays make the flip to Enforce a
one-line value change per environment, staging first after a clean audit week.

Validated with `task validate` (yamllint + kustomize build, all environments).
@github-actions

Copy link
Copy Markdown

CI Results

Check Status
YAML Lint
Environment Kustomize Build
dev
staging
production

All validations passed.

@stxkxs stxkxs merged commit 22a00ff into main Jun 24, 2026
7 checks passed
@stxkxs stxkxs deleted the feat/verify-images-policy branch June 24, 2026 03:43
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