More Info:
The ImagePolicyWebhook admission controller can enforce image provenance so that only trusted, verified images are admitted to the cluster.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Review current admission configuration for ImagePolicyWebhook
- On any machine with kubectl access:
- If you find a config file path (for example
/etc/kubernetes/admission-config.yaml), inspect it: - Confirm whether there is a
ImagePolicyWebhookplugin section configured; if not, the feature is not in use.
- On any machine with kubectl access:
-
Determine the desired image provenance mechanism and trust policy
- Decide what constitutes a “trusted image” in your environment (e.g., signed by a particular key, coming from a specific registry/project, or verified by an external attestation service).
- Choose or design the webhook backend that will enforce this policy (custom admission webhook service, in-cluster or external, or a supported third‑party image verification solution).
- Document:
- The verification method (signing/attestation technology).
- The registries/namespaces allowed.
- Failure policy (reject on verification error vs allow).
-
Design or validate the ImagePolicyWebhook AdmissionConfiguration
- Draft an
AdmissionConfigurationmanifest including theImagePolicyWebhookplugin that points to your webhook backend and enforces your policy decisions. For example (adjust URLs, timeouts, and CABundle to your environment): - Ensure the referenced
kubeconfig(or other connection method your Kubernetes version supports) exists and points to your policy webhook service. - Do not apply yet; validate it against Kubernetes version compatibility and your webhook implementation docs.
- Draft an
-
Stage and test the webhook service and policy in a non‑production environment
- Deploy the admission webhook service (if not already running) in a test or staging cluster using manifests:
- Configure the apiserver in that environment to use your drafted
AdmissionConfigurationand restart the apiserver as required by your distribution. - Test with sample workloads:
- Confirm that untrusted images are rejected and trusted ones are admitted, and refine policy if behavior is not as intended.
- Deploy the admission webhook service (if not already running) in a test or staging cluster using manifests:
-
Promote the configuration to production and monitor
- Copy the validated
AdmissionConfigurationfile and supporting artifacts (kubeconfig, CA certs) to the production control plane nodes, then update thekube-apiservermanifest (or equivalent) to reference it via the appropriate flag. This is done outside kubectl (host-level change) and will restart the apiserver. - After the apiserver restarts, verify that workloads using untrusted images are rejected and trusted images succeed:
- Review apiserver and webhook logs for errors or excessive denials and adjust policy if needed.
- Copy the validated
-
Document, periodically review, and re‑verify
- Record: where the
AdmissionConfigurationfile lives, what the policy rules are, and who maintains the webhook service. - On a recurring basis, re‑check configuration and effectiveness:
- Re-run functional tests (trusted vs untrusted images) after significant cluster or policy changes to ensure image provenance enforcement remains active.
- Record: where the
Using kubectl
Using kubectl
- No webhook configuration related to image policy or provenance (for example names not mentioning
image-policy,imageprovenance,cosign,notary,policy, etc.). - This usually means no image provenance enforcement is configured at all.
webhooks[].rulesdo not includeapiGroups: [""]andresources: ["pods"]or other workload types (deployments,replicasets,statefulsets, etc.) — then pod/image creation may bypass the policy.failurePolicyisIgnoreinstead ofFail— unverified images may still be admitted.sideEffectsis unset or incorrect (should typically beNone).clientConfig.servicepoints to a non‑existent namespace/service, or wrongpath/port.namespaceSelectororobjectSelectorexclude important namespaces (e.g., default application namespaces), leaving workloads unenforced.- No mention in annotations or configuration of trusted registries, signatures, or verification policy.
- No mutating webhook that adjusts image references to a verified form (if your design expects this).
- Any mutating webhook that weakens image references (e.g., stripping digests or pinning to
:latest) instead of strengthening provenance.
- No policy engine or image-verification service deployed at all.
- Configuration (in ConfigMaps/Secrets) that does not reference trusted registries, keys, or signature verification settings.
- Policy engine pods in
CrashLoopBackOfforErrorstate, indicating admission requests may fail open depending onfailurePolicy.
- The “untrusted” pod is created and runs successfully; this strongly suggests image provenance is not enforced.
- No admission webhook denial messages in the pod events (
kubectl describe pod ...) for the untrusted image. - The “trusted” pod is rejected with provenance-related errors (misconfigured policy) or both pods are treated identically (no provenance enforcement).
- No reference to
ImagePolicyWebhookin--enable-admission-pluginsif your design relies on the legacy built‑in ImagePolicyWebhook admission plugin (on self‑managed control planes). - For managed control planes (EKS/AKS/GKE/OKE), control plane flags are typically not visible; in that case, absence of any webhooks/configs as above is the main indicator.
All of the above commands only surface the current state. Any decision to introduce, tighten, or relax image provenance policies, and the exact implementation (ImagePolicyWebhook vs. external policy engines), requires human review against your organization’s threat model and Kubernetes documentation.
Automation
Automation

