CKS Supply Chain Security Practice Question
An administrator wants to ensure that only images from a specific registry (e.g., myregistry.internal) can run in the cluster. Which tool can be used to enforce this via admission control?
⚠ Common exam trap
Test-takers frequently confuse tools for image signing or scanning (Cosign, Notary, Trivy) with admission control tools that enforce runtime policies, but only OPA/Gatekeeper provides the Kubernetes-native admission webhook mechanism to block pods based on image registry origin.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
OPA/Gatekeeper
OPA/Gatekeeper is a Kubernetes admission controller that can enforce policies on pod creation, including restricting which container image registries are allowed. By writing a ConstraintTemplate and Constraint that checks the image field against a whitelist of registries, Gatekeeper can reject any pod that attempts to use an image from an unauthorized source. This directly addresses the requirement to enforce registry restrictions at admission time.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Cosign
Why it's wrong here
Cosign is a tool for signing container images and verifying those signatures, typically using keyless signatures or private keys. It does not operate as an admission controller or policy engine, so it cannot evaluate API objects like Pods or reject them based on registry names. While Cosign signatures can be checked by a separate admission mechanism such as Gatekeeper, Cosign itself provides no enforcement of trusted registry allowlists.
- ✗
Notary
Why it's wrong here
Notary is a server-side component that implements Docker Content Trust by managing cryptographic signing roles and metadata for image tags. Its purpose is to produce trust data that a client can verify before pulling an image, ensuring the image was signed by a trusted publisher. It has no webhook capability and never sees Kubernetes resource definitions, so it cannot act as an admission controller to restrict which registries are allowed.
- ✗
Trivy
Why it's wrong here
Trivy is a comprehensive vulnerability scanner that analyzes container images, filesystems, and repositories for known CVEs, misconfigurations, and exposed secrets. It is typically run in CI pipelines or as a cluster scanner that reports security issues, but it does not intercept admission requests or enforce policy. Trivy cannot block a Pod that references an untrusted registry because it is not an admission webhook, only a static analysis tool.
- ✓
OPA/Gatekeeper
Why this is correct
OPA/Gatekeeper is the correct choice because it is an admission controller that integrates with Kubernetes as a validating webhook. Using Constraint Templates and constraint manifests, an administrator can write a Rego policy that inspects each Pod's container images and denies creation if any image does not come from an approved registry. This provides real-time, cluster-wide enforcement of registry allowlists, which is exactly what the administrator wants.
Go deeper
Related to this question
Learn chapter
Cluster Setup: Secure Configuration and Best Practices
Key term
Kyverno Policy Engine
Kyverno Policy Engine is a Kubernetes-native tool that enforces rules on resources to ensure security, compliance, and best practices across your cluster.
Key term
Pod Security Admission
Pod Security Admission is a Kubernetes feature that enforces security standards on pods at creation time to prevent running containers with dangerous privileges.
About these practice questions
This CKS question is part of Courseiva's 845-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on CKS
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An administrator wants to ensure that only images from a trusted registry 'myregistry.io' can run in the cluster. Which admission controller should be configured?
medium- A.NodeRestriction
- B.MutatingAdmissionWebhook
- ✓ C.ImagePolicyWebhook
- D.PodSecurity
Why C: The ImagePolicyWebhook admission controller enforces that only images from a trusted registry (e.g., 'myregistry.io') can run. It does this by querying an external webhook to validate the image source against a policy. Options A, B, and D are incorrect: NodeRestriction restricts node API access, MutatingAdmissionWebhook can mutate pods but is not specifically designed for image registry control, and PodSecurity handles pod security contexts, not image source validation.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.