Skip to main content

More Info:

Verifies image provenance is enforced via the ImagePolicyWebhook admission controller so only approved, verified images can be admitted to the cluster.

Risk Level

High

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. Review current admission configuration for ImagePolicyWebhook
    • Machine: any machine with kubectl access
    • Command:
    • Interpretation: Check if any webhook configuration refers to an ImagePolicyWebhook implementation (e.g., names/URLs mentioning “image-policy”, “imageprovenance”, or your chosen image policy service). If none exist, image provenance via ImagePolicyWebhook is not configured.
  2. Identify and inspect any image policy webhook configuration
    • Machine: any machine with kubectl access
    • Commands:
      For each candidate webhook name (replace with actual name you saw, for example image-policy-webhook):
    • Interpretation: Confirm that the webhook is configured to intercept CREATE and UPDATE operations on pods and/or higher-level workload types (Deployments, StatefulSets, DaemonSets, Jobs, CronJobs) in relevant API groups.
  3. Verify the webhook enforces only approved, verified images
    • Machine: any machine with kubectl access
    • From the webhook config YAML, collect:
      • clientConfig.url or clientConfig.service target
      • rules.resources and rules.operations
      • failurePolicy and namespaceSelector/objectSelector
    • Then retrieve the backing Service/Deployment implementing the webhook (example name, adjust as needed):
    • Interpretation: Using your organization’s image policy design, confirm that the webhook backend validates image provenance (e.g., signature verification, allowed registries, allowed repositories/tags) and rejects non‑compliant images.
  4. Check behavior with a non‑compliant image (safe test)
    • Machine: any machine with kubectl access
    • Create a pod manifest using an image that should be rejected by policy (e.g., from an unapproved registry or with a disallowed tag):
    • Interpretation: The request should be rejected by the webhook, with an error message indicating image policy violation. If the pod is admitted and runs, provenance is not effectively enforced.
  5. If image provenance is missing or ineffective, plan and apply an ImagePolicyWebhook configuration
    • Machine: any machine with kubectl access
    • Using Kubernetes documentation and your image verification solution, prepare:
      1. A Deployment/Service that implements image verification logic.
      2. A ValidatingWebhookConfiguration that:
        • Targets CREATE/UPDATE on workloads using containers.
        • Uses failurePolicy: Fail (or your risk‑based choice).
        • Uses appropriate namespaceSelector to include production namespaces.
    • Apply once designed:
  6. Re‑verify enforcement and document the decision
    • Machine: any machine with kubectl access
    • Confirm configuration and behavior after changes:
    • Interpretation: Ensure the test pod is rejected; capture the webhook configuration and rejection output as evidence. If you intentionally choose not to enforce image provenance via ImagePolicyWebhook (e.g., using a different trusted mechanism), document that rationale and the alternative controls in your risk register.
If this returns No resources found or there is no admission configuration mentioning ImagePolicyWebhook, you likely do not have a cluster-scoped admission configuration resource configured. In GKE, image provenance is typically configured via Binary Authorization rather than raw ImagePolicyWebhook; absence here means you must confirm how provenance is enforced.
Review the NAME and WEBHOOKS columns. A problem exists if:
  • There is no webhook related to image policy, image verification, or provenance (names often contain strings like imagepolicy, binauthz, image-verify, cosign, notary), and
  • You rely on this mechanism to enforce provenance (per your policy).
In the YAML, focus on:
  • webhooks.rulesapiGroups, apiVersions, resources:
    A problem exists if the webhook does not target pod/image-bearing resources such as:
    • apiGroups: [""], resources: ["pods", "pods/ephemeralcontainers"]
    • Or workload types like deployments, daemonsets, statefulsets, jobs, cronjobs.
  • webhooks.rules.operations:
    A problem exists if CREATE (and ideally UPDATE) operations are not included for these resources, because images could be introduced/changed without being checked.
  • webhooks.clientConfig:
    A problem exists if the service or url targets a non-existent/broken backend (service missing, TLS misconfigured, or timeouts), meaning image checks may silently fail-open depending on failurePolicy.
  • webhooks.failurePolicy:
    A problem exists if failurePolicy: Ignore is set, because if the external verifier is unreachable, images may be admitted without provenance verification. Many orgs require failurePolicy: Fail.
  • webhooks.matchPolicy, namespaceSelector, objectSelector:
    A problem exists if selectors exclude namespaces or pods that should be governed by provenance policy (for example, all application namespaces are excluded).
Interpretation:
  • If the pod is created successfully and your policy says unverified/unapproved images must be blocked, this indicates:
    • No effective image provenance enforcement, or
    • The webhook configuration does not cover this namespace/resource/type.
  • If the pod fails to create with an error message from an admission controller (e.g. mentioning image verification, signature, policy, or provenance), that indicates some form of image provenance enforcement is in place. Review the error details and webhook config to confirm it meets your policy and CIS guidance.
Use the above evidence to decide whether:
  • Image provenance is enforced (via ImagePolicyWebhook, Binary Authorization, or an equivalent validating webhook), and
  • The scope and failure behavior align with your security requirements and the benchmark recommendation.