This challenge checks that you can, on your own, make the cluster refuse what breaks a rule: apply the restricted standard to a namespace, rebuild a privileged Pod without its flaws and set a native admission policy. It is meant for people who have just followed the module on confining and admitting Pods, starting from the lesson Pod Security Standards. It runs in a dsoxlab virtual machine, on a kubeadm cluster with Kubernetes 1.37, and takes about 45 minutes. It gives no hints and teaches nothing new: it checks what the lessons of the module and their guided labs have already let you practice.
What you will learn
The lab reads the namespaces, the admitted Pods and the admission policy, and submits real Pods to the cluster. It checks that you can:
- Make a namespace apply the
restrictedstandard in its three modes. - Write a Pod that meets the requirements of that standard.
- Rebuild a Pod that accumulates flaws, under another name, then remove the original.
- Bind a native admission policy in deny mode, not in mere warning mode.
- Refuse the images named by a tag in a namespace, accept those pinned by digest, and leave the other namespaces alone.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right settings is part of what it checks. Everything it asks for is taught in four lessons of the module:
- Pod Security Standards: the three standards, their three modes and the requirements of a
restrictedPod. - Admission Controllers: what admission does with a request before it is stored.
- ValidatingAdmissionPolicy: a policy evaluated by the API server, its binding and its actions.
- VAP + MAP vs Kyverno vs Gatekeeper: where native policies stand next to the other engines.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The kubeadm cluster admits everything. The security team wants it to refuse what breaks its rules, at creation time, rather than rely on everyone's discipline. Four namespaces are ready. You are on the control plane, with kubectl configured.
vitrineapplies no security standard. A Pod namedcataloguemust run there:busybox:1.37, runningsleep.paiementrunscaisse, a Pod that nobody reported and that accumulates flaws. It must be rebuilt cleanly under the namecaisse-durcie, so that it does the same thing.productionaccepts any image, including one named by a plain tag. A Podconformealready runs there, pinned by its digest: do not touch it.recetteis a test namespace. Nothing is asked of it, and nothing must change there.
The statement says what must be true at the end, never how to get there:
vitrinedeclares therestrictedstandard in all three modes:enforce,warnandaudit.- The Pod
catalogueruns invitrine. cataloguemeets the four requirements of the standard: it runs as non root, cannot escalate its privileges, has dropped its capabilities and declares a seccomp profile.- Admission in
vitrinerefuses a Pod that breaks the standard and accepts a compliant Pod. This requirement is blocking. caisse-durcieruns inpaiement.caisse-durciekeeps none of the flaws you find incaisse.- The original Pod
caisseno longer exists. - The container of
caisse-durcieno longer sees the host's processes and does not run as root. - A native admission policy, evaluated by the API server itself, is bound in deny mode, and not only in warning mode.
- In
production, a Pod whose image is named by a tag is refused, a Pod whose image is pinned by its digest is accepted, and the other namespaces,recettefirst, are not affected. This requirement is blocking.
How do you start the challenge and get graded?
The lab prepares the cluster and the four namespaces, then reads the state of the cluster when you ask for the grade. You start it with dsoxlab run k8s-challenge-faire-refuser-par-admission. Two commands are then used: dsoxlab check k8s-challenge-faire-refuser-par-admission tells you where you stand, criterion by criterion, as many times as you like, and dsoxlab submit k8s-challenge-faire-refuser-par-admission returns the final result. The lab never looks at the commands you typed: it reads the admitted Pods, enters the new Pod to count what it sees, and submits real Pods. In vitrine, it creates nothing. In production and recette, it creates a Pod then removes it at once.
Put it into practice
This lab is the challenge itself. It puts you in front of the situation described above and it is graded on the state of the cluster, as a colleague taking over your work would do.
How is the challenge graded?
The pass mark is 70 points out of 100. Ten requirements of equal weight make up the grade, in the order of the statement. Requirements 4 and 10 are blocking: if one of the two is not met, the challenge fails, whatever the total.
If a criterion resists, dsoxlab check gives its label without saying how to fix it. Reread the lesson that covers its subject, Pod Security Standards or ValidatingAdmissionPolicy, fix it, then run dsoxlab check again.
Key points
- The challenge is a final exercise to do alone and without hints: it explains nothing and grades the state of the cluster, not your commands.
- Requirements 4 and 10 are blocking: the refusal of the non-compliant Pod in
vitrine, and the refusal of images named by a tag inproduction. - A refusal is checked by submitting a Pod, not by reading a configuration: the lab does it for you.
dsoxlab checklists the criteria that are not met;dsoxlab submitreturns the result.