CKS Supply Chain Security Practice Question
An organization uses Kyverno to enforce policies. Which Kyverno rule action would you use to require that all images come from a specific registry?
⚠ Common exam trap
A common trap is confusing `validate` (which rejects non-compliant resources) with `mutate` (which modifies resources). For requiring a specific registry, only `validate` can block disallowed images at admission time.
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
✓
validate
The `validate` action in Kyverno is used to enforce policies that check resource attributes against specified rules. To require that all images come from a specific registry, you would use a `validate` rule with a pattern or deny clause that inspects the image field (e.g., `spec.containers[*].image`) and rejects any that do not match the allowed registry prefix. This ensures non-compliant resources are blocked 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.
- ✗
verifyImages
Why it's wrong here
verifyImages validates signatures and attestations on container images, not registry origins; it cannot enforce a registry allow-list. It is tempting because it also targets image supply chain, but registry restriction belongs to a validate rule matching the image field against allowed registry prefixes.
- ✗
generate
Why it's wrong here
Generate creates or copies additional resources when a rule matches; it cannot block or reject a Pod whose image registry is disallowed. It is tempting because it is a common Kyverno action, and it would be correct when new ConfigMaps or NetworkPolicies must be created automatically.
- ✗
mutate
Why it's wrong here
Mutate alters a matching resource's fields, such as patching an image reference, rather than rejecting non-compliant Pods. It is tempting because it can rewrite values, and it would be correct when you want to automatically correct or default settings instead of denying admission.
- ✓
validate
Why this is correct
The validate action checks incoming resources against a matching rule and rejects those that fail, so a rule requiring images from a specific registry blocks any pod whose image path does not match. Mutate would rewrite rather than enforce, and generate only creates supporting resources.
Go deeper
Related to this question
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 →
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.