The Bare Image Reference Is the Secure One
base/vuln-exporter writes image: python:3.13-alpine with no registry prefix — on purpose. Fully qualifying it would bypass the Kyverno rewrite, Harbor's scan-on-push, the SBOM, and Copacetic patchability in one edit.
Somewhere in the repo is a Deployment whose image line reads, deliberately:
image: python:3.13-alpineNo registry prefix. To anyone raised on "always fully qualify your image references," it looks like a bug. It is the security design.
Why bare routes, qualified bypasses
Kyverno's rewrite rules classify references by shape. A bare name — no dot before the first slash — matches rewrite-images-without-namespace and becomes harbor.private.example.com/dockerhub/library/python:3.13-alpine at admission. A reference like docker.io/library/python matches the *.*/* precondition — "has a registry host" — and is treated as external, pulled direct, and never seen by Harbor. One word of extra YAML bypasses scan-on-push, the SBOM, and Copacetic patchability, all at once.
The distinction is invisible when reading a manifest, which is why the manifest carries a comment and the docs carry a table:
| Written in the manifest | Routed through Harbor? |
mariadb:11.8.8 | yes |
grafana/grafana:12.4.3 | yes |
docker.io/library/mariadb:11.8.8 | no |
quay.io/prometheus/prometheus:v3.11.2 | no |
The two paths through admission — and the worked example the repo keeps as a live demonstration of the policy.
No versioning regression
The objection is Renovate: surely the bot cannot resolve a bare tag? It can — the kubernetes manager resolves bare references against Docker Hub by default, so python:3.13-alpine still gets update MRs. The comment on the deployment ends with the instruction that matters: do not "fully qualify" this reference. It is the one place in the repo where a bare image tag is the secure choice.
The worked example, why it exists
The vuln-exporter deployment is not just compliant with the rewrite policy — it is the policy's living documentation. The manifest comment says the image is bare so the rewrite routes it through Harbor, granting scan-on-push, an SBOM, and Copacetic patchability; the docs call it the one place in the repo where a bare image tag is the secure choice, and a working demonstration of the rewrite policy. The value of such a specimen shows up in onboarding: the new engineer who reads the rule and the example together understands the precondition (*.*/* = external) in about a minute, without running anything.
The classification table, generalized
The same shape-matching governs every rewrite policy in the directory, and the seven-case verification table used for the docker.io phase is the cleanest statement of it:
| Case | Input | Result |
| Qualified | docker.io/library/mariadb:11.8.8 | → …/dockerhub/library/mariadb:11.8.8 |
| index prefix | index.docker.io/grafana/grafana:12.4.3 | → …/dockerhub/grafana/grafana:12.4.3 |
| Digest-pinned | docker.io/velero/velero@sha256:… | prefix swapped, digest preserved |
| quay.io | quay.io/argoproj/argocd:v3.3.6 | unchanged (other policy) |
| Bare | nginx:1.27 | unchanged (original policy) |
| harbor namespace | docker.io/goharbor/harbor-core | unchanged (excluded) |
| initContainer | both containers | both rewritten |
Two rows carry warnings. Digest-pinned references keep their digest across the rewrite — which is what makes digest-joining safe for attribution (the registry-label-lies post). And the gotchas list is blunt that the preconditions are order-sensitive and pattern-based, not a real image-reference parser: an unusual reference (a port in the host, a digest in an odd position) may not classify the way you expect — verify against a live Pod's .spec.containers[].image rather than reasoning about the regex.
The Kyverno-CLI habit
Before any rewrite policy goes near the cluster, it is verified offline:
kyverno apply <policy>.yaml --resource <test-pod>.yamlThe docker.io phase was verified with nine test resources — 9 rewritten, 5 excluded ones untouched, digests preserved — before the MR merged. The habit converts classification questions ("what happens to this reference?") from production experiments into local ones, which is the only way to explore the regex's edge cases without occasionally being wrong in front of the kubelet.
Next: what Kyverno's autogen did to a Job template — and the annotation that stopped it.