Skip to main content

Admission Policies

Hardening a chart is only useful if the settings survive contact with a real cluster. OLIVE therefore supports admission-time policy enforcement: Pod Security Admission for the workload security context, and Kyverno for image signature verification and a registry allow-list.

The charts declare the posture as namespace labels; the cluster enforces it. The policy definitions, the signer identity and the registry credentials live in the kyverno-infra chart, not in the tenant charts. See Cluster Operator → Admission control and image integrity for the cluster side.

The mode settings do not enforce anything by themselves

imageVerification.mode and imageRegistry.mode only label the namespace. The checking is done by Kyverno policies, which OLIVE ships as examples in kyverno-infra and which read that label.

If Kyverno is not installed, or the policies are not deployed, or a policy selects a different label than the namespace carries, then setting mode: enforce enforces nothing — silently. The values file will read as though the tenant were protected.

Confirm both halves before treating the control as in place. The policy report for your namespace is yours to read:

kubectl get polr -n <namespace>

Whether the policies exist and compiled is a cluster-scoped read you are unlikely to hold rights for — ask your cluster operator to confirm the policies are present and active.

ControlRecommended steady stateWhy
tenant-setup.imageRegistry.modeenforceNo network call, no rebuild, and it evaluates pods that are already running. Nothing about it can fail at an awkward moment
tenant-setup.imageVerification.modeauditIt answers the stronger question, but enforcing it puts a synchronous dependency on two public internet services into the pod-creation path. See below
tenant-setup.podPrivileges.modeenforceComplying needs only a pod spec that stops asking for host access. Usually the first label a tenant can move

This is a deliberate recommendation rather than a staging order: audit on signature verification is defensible as a permanent position, not just a step on the way to enforce.

Why enforce on signature verification is a bigger commitment than it looks

Verification is keyless: there is no stored public key, so Kyverno checks the signing certificate against Fulcio and the transparency-log entry against Rekor — and both calls happen inside the admission webhook, synchronously, while a pod is being created.

Enforcement therefore means failurePolicy: Fail, because Ignore would admit unverified images and enforce nothing. And Fail means that if Fulcio or Rekor is unreachable — a network change, a proxy rule, or an outage at a public service you do not operate — no pod can be created in any enrolled namespace. Not degraded: no rollouts, no scale-ups, no recovery from an eviction or a node drain, until the route is restored.

Sigstore is a public good-faith service with its own availability history. Accepting it as a dependency in your pod-creation path is a real decision, and it is not one the registry allow-list asks you to make.

What audit still gives you​

A great deal, which is why it is a defensible end state:

  • Every unsigned or wrongly-signed OLIVE image appears in the policy report, so you know within one deployment cycle if something is off.
  • You can alert on the report rather than block on the webhook, which moves the failure out of the pod-creation path and into your monitoring.
  • Nothing in your cluster stops working when a public service does.

And the allow-list at enforce is doing substantial work alongside it. In a deployment that pulls from one registry, "did it come from the registry we approved" excludes the whole class of substituted-image attacks that do not involve compromising your own registry. Signature verification adds "and is it the artefact OLIVE built" — valuable, and the increment is smaller than the two controls' names suggest.

Move signature verification to enforce when you have a reason to: a compliance requirement that names it, egress to Fulcio and Rekor that you control and monitor, Kyverno running at least two replicas, and an audit report that has been empty across a full deployment cycle. Not because a checklist says enforce is the finished state.

Pod Security Admission​

tenant-setup labels the tenant namespace for Pod Security Admission:

tenant-setup:
podSecurity:
enabled: true
enforce: baseline
audit: restricted
warn: restricted
version: latest

enforce: baseline blocks the container-escape primitives — privileged containers, host namespaces, hostPath, most capabilities — without breaking the Vault agent sidecars the injector adds, which do not satisfy restricted.

audit and warn are already set to restricted, so restricted-level violations are reported without blocking. Move enforce to restricted once those are quiet:

kubectl get events -n <namespace> --field-selector reason=FailedCreate

Image signature verification​

OLIVE signs the container images it builds with cosign. The kyverno-infra chart ships a policy that verifies those signatures at admission. Each tenant namespace chooses whether it is evaluated:

tenant-setup:
imageVerification:
mode: audit # disabled | audit | enforce
ModeBehaviour
disabledNo label is written; the namespace is not evaluated at all. The correct setting for a tenant whose images predate the signing pipeline.
auditViolations are reported, nothing is blocked. Start here.
enforceA pod whose OLIVE images are unsigned is rejected at admission.

Read the findings:

kubectl get policyreport -n <namespace>
kubectl describe policyreport <policy-report-id> -n <namespace>
What enforce actually means for a running tenant

Admission control acts on pod creation, not on pods that already exist. Switching a tenant to enforce evicts nothing — the workload keeps running and everything looks fine. It breaks at the next pod creation: a rollout, a scale-up, an eviction, or a node drain during maintenance. A tenant can therefore sit in a broken state for weeks and discover it during a node reboot at 2 a.m.

A crash-looping container does not recreate the pod object and is therefore not re-admitted, which is exactly why the failure is so delayed.

Move a tenant to enforce only after its audit report has been empty across a full deployment cycle.

Image registry allow-list​

The same three states and the same mechanics, but a different question: not did our pipeline sign this but is this image from a registry we approved at all.

tenant-setup:
imageRegistry:
mode: audit # disabled | audit | enforce

Complying with the allow-list requires no rebuild — images either come from approved places or they do not — so most tenants can move this to enforce well before signatures are ready. That is why it is a separate label from the signature policy: tying both to one switch would hold the cheap control hostage to the expensive one.

Expect audit to go quiet quickly here. Unlike the signature policy, this one evaluates pods that are already running (no registry call is needed), so the full inventory appears within a minute of enrolling rather than at the next deploy.

Signature verification and registry allow-listing answer different questions — is this ours? and did it come from where our things come from? — and running both is the defence-in-depth position.

The label contract​

Nothing cross-checks the two sides

kyverno-infra renders cluster-scoped policy objects that select namespaces by a label; tenant-setup decides what value this tenant's namespace gets. A typo on either side produces a cluster where the policies exist, the namespace looks enrolled, and nothing is checked, with no error anywhere.

global:
imageVerification:
labelKey: 'olive/image-verification'
imageRegistry:
labelKey: 'olive/image-registry'

Keep these in the shared values file so one edit moves both charts.

Extra namespace labels​

When another team adds a Kyverno policy that selects namespaces by some new label, a tenant can opt in without waiting for a new tenant-setup release:

tenant-setup:
namespaceLabels:
olive/require-probes: audit
acme.example.com/pci-scope: 'true'

This enrols the namespace in whatever policy selects that label. It does not create, describe or validate that policy, and nothing here can tell you whether the label is spelled the way the policy expects — the same silent non-enforcement the typed fields above exist to prevent. Use it to move fast on a new policy, and promote anything long-lived to a typed field. A key that collides with one of the typed fields is refused at render time rather than silently overriding it.

These values are cluster-operator-only​

imageVerification and imageRegistry are set by the platform administrator. Tenants cannot reach them.