This challenge checks that you can, on your own, let only pinned, scanned and signed images into a cluster. It is meant for people who have just followed the lessons on the supply chain, starting from the lesson Scanning Kubernetes images. It runs in a dsoxlab virtual machine, on a kubeadm cluster with Kubernetes 1.37, and takes about 60 minutes. It gives no hints and teaches nothing new: it checks what the lessons and their guided labs have already let you practice.
What you will learn
The lab queries the node's runtime, runs the static analysis and the vulnerability scans again, verifies the signatures and submits two Pods to admission. It checks that you can:
- Make an image referenced by its digest rather than by its tag, with the digest the node runs.
- Fix a Dockerfile until the static analysis reports nothing, without changing what the application does.
- Sign an image, push the signature to the registry and publish the public key in the cluster.
- Replace a vulnerable image with one that carries strictly fewer critical vulnerabilities.
- Make the cluster refuse, at creation, an image whose signature does not verify.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right tools is part of what it checks. Everything it asks for is taught in four lessons:
- Scanning Kubernetes images: read a scan report and compare two images.
- Kubernetes supply chain security: pin an image by digest and analyse a Dockerfile.
- Signing and verifying an image with Cosign: sign with Cosign and verify with the public key.
- Kyverno: write a policy that refuses at admission.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The delivery team wants the cluster to run only images that are pinned, scanned and signed. Today, none of that holds. You are on the control plane, with kubectl and sudo. In the livraison namespace:
- the Deployment
vitrinerunsnginx:1.27-alpine, named by its tag; - the Deployment
boutiquerunsnginx:1.21, an image from 2021; - a local registry answers at
localhost:5000on the control plane. It holdslocalhost:5000/appli/web:1.0, the image the team wants to deliver, andlocalhost:5000/appli/outil:1.0, another image. Neither is signed.
On the node, the application inventaire has its Dockerfile in /root/inventaire/. It builds and runs, and a static analysis rejects it. The tools cosign, crane and trivy are installed on the node. Kyverno 1.19.2 is installed in the cluster, with no policy: it reaches the local registry at the same address, localhost:5000.
The statement says what must be true at the end, never how to get there:
vitrinereferences its image by its digest, and not by a tag.- It is still the requested image,
nginx:1.27-alpine, and not another version. - The declared digest is the one the node runs, and both replicas run. This requirement is blocking.
- The static analysis findings on the Dockerfile are gone, and the image still does the same thing: a Node image that runs
server.js. - A public key is published in the cluster, in a ConfigMap named
cosign-pub-keyinlivraison, under the keycosign.pub. The private key stays on the node. - The signature of
appli/web:1.0is pushed to the registry, next to the image. - The published key accepts the signed image and refuses the other.
boutiqueno longer runs on its original image, and still runs nginx.- The new image carries strictly fewer critical vulnerabilities than the old one, according to a new scan. This requirement is blocking.
- The cluster refuses at creation a Pod whose image from the local registry is not signed, and accepts the signed image. This requirement is blocking.
How do you start the challenge and get graded?
The lab starts from the situation described above, then reads the state of the cluster when you ask for the grade. You start it with dsoxlab run k8s-challenge-livrer-une-image-verifiee. Two commands are then used: dsoxlab check k8s-challenge-livrer-une-image-verifiee lists the criteria that are not met and gives the grade, and dsoxlab submit k8s-challenge-livrer-une-image-verifiee returns the final result. The grade never looks at the commands you typed: it asks the node's runtime what runs, runs the static analysis and the scans again, verifies the signatures with the key taken from the ConfigMap, then submits two Pods to admission without creating them.
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 3, 9 and 10 are blocking: if one of the three is not met, the challenge fails, whatever the total.
If a requirement resists, dsoxlab check gives its label without saying how to fix it. Reread the lesson that teaches the operation concerned, 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 3, 9 and 10 are blocking: the digest the node runs, an image that carries fewer critical vulnerabilities, and a cluster that refuses the unsigned image.
- The declared digest must be the one the node runs, not just any valid digest.
dsoxlab checklists the criteria that are not met;dsoxlab submitreturns the result.