Skip to content
Français
Account: not signed in, sync available My learning
Select theme
Français

Level 5 exam: secure a cluster

By updated

Improve this page

This exam measures whether you can, on your own, harden a kubeadm cluster without breaking the application it hosts: close the API server's profiler, trace Secret reads, have the cluster refuse what breaks a rule, confine workloads, require mutual TLS, close the network, detect a network tool and admit only a signed and scanned image. It is meant for people who are finishing level 5, "Secure the cluster". It runs in a virtual machine, so plan about 150 minutes. You pass it by meeting the seven critical criteria and reaching at least 70 points out of 100. It offers four hints, which cost between 10 and 25 points each, and it teaches nothing new: it checks what the lessons have taught.

What you will learn

  • Say what the exam expects, and on which state of the node and the cluster it grades you.
  • Spot the level lessons to review before you start.
  • Work out what you must pass: the seven critical criteria, then enough others to reach 70 points.
  • Know what a hint costs, and how to take one, to decide whether to ask for one.

What should you be able to do before you start?

No step-by-step guide goes with the exam, and choosing the right objects is part of what it measures. The specification names no Kubernetes object: it describes results. What it asks is taught in level 5, "Secure the cluster", and, for closing the network, in the Networking and exposure module of level 2. It also assumes the kubeadm cluster of level 4 and the basic resources of levels 1 to 3. If a step feels unclear, reread the lesson concerned before you start.

One criterion weighs on the whole exam: the shop must still answer at the end, with its replicas created under the rules you have set. The section "What should you do after the exam?" lists the lessons tied to each criterion.

What does the specification ask for?

The scenario has you take over the kubeadm cluster that hosts a shop. It works, and that is all anyone has ever asked of it. It says what must be true at the end, never how to get there. The lab scenario gives the names that the grader looks for: it is authoritative, so read it in full when you start.

You work on the node k8s-cp.lab, with kubectl and root rights through sudo. Falco runs there and writes its alerts as JSON to /var/log/falco/events.json. The runsc sandbox runtime is known to containerd. The AppArmor and seccomp profiles you write live there, and only there. The tools trivy, cosign and crane are installed, and a local registry answers on localhost:5000: it holds boutique/catalogue:1.21, a copy of the original image, and boutique/outil:1.0, another image, both unsigned. The cluster itself pulls the shop's images from Docker Hub. The catalogue's Dockerfile is in /root/boutique, and your signing keys never leave it.

The inherited state is spread between the control plane and five namespaces, including partenaires, which hosts the client without a sidecar.

  • The boutique namespace accepts any Pod and any image. Its catalogue Deployment (two replicas, reachable at the stable name catalogue-svc) runs on nginxinc/nginx-unprivileged:1.21, an image named by a tag, unsigned and riddled with flaws. Next to it, the Pod outil-ancien was started with every privilege.
  • In the invoicing namespace, facturation, workloads share the machine's kernel freely. Its Pod export-comptable sends the entries to the accounting firm through a channel that is already open, and nobody would notice a download tool starting in it.
  • In the commandes namespace, an Istio mesh accepts plaintext traffic: from the partenaires namespace, transporteur, without a sidecar, reads what the order tracking service suivi serves to the cart panier.
  • In the paiement namespace, caisse is the legitimate client of the ledger grand-livre, the payments database (HTTP, port 80), and everyone else, the advertising tracker publicite included, reaches everything, outside the namespace too.
  • On the control plane, the API server exposes its profiler, a CIS audit fails on several points, and nothing traces who reads what.

The specification comes down to nineteen requirements, each graded by one criterion.

  • The API server's profiler no longer answers, and the API still answers.
  • A new CIS audit of the control plane counts fewer failures than at the start, and its profiling checks pass on every component they target.
  • The API server runs with auditing on, its policy and its log living on the node.
  • Reads of the cluster's Secrets are recorded in full, and everything else as metadata only.
  • In the boutique namespace and only there, a Pod that breaks the restricted security standard is refused, and a compliant Pod is accepted.
  • In boutique as well, a Pod whose image is named by a tag is refused by the cluster itself, and one whose image is pinned by its digest is accepted. The other namespaces are untouched.
  • outil-ancien no longer exists. A Pod named outil does the same job (it sleeps), without any of its flaws, and no longer sees the host's processes.
  • In facturation, with the image busybox:1.37 on k8s-cp.lab, a Pod consultation, which displays the invoices, can read its file system but cannot put anything in /dev/shm, the refusal coming from an AppArmor profile loaded in enforce mode.
  • In facturation, a Pod numerotation, which assigns invoice numbers, runs under a local seccomp profile that refuses the chown family and allows everything else.
  • The commandes namespace requires mutual TLS: transporteur no longer reaches suivi, panier still does.
  • The paiement namespace denies inbound and outbound traffic by default for all its Pods. Only caisse reaches grand-livre, on port 80, and names still resolve.
  • In facturation, a Pod rendu, which builds the invoices from received documents, runs in the sandbox runtime and reads a kernel different from the machine's.
  • A network or download tool (wget, curl, nc and the like) started in a container of facturation raises an alert from a Falco rule named outil-reseau-en-facturation, with priority WARNING, and the same tool started in another namespace raises none.
  • The rules shipped with Falco remain intact.
  • The catalogue references its image by the digest that the node actually runs, an image of nginxinc/nginx-unprivileged other than the original.
  • Its copy in the local registry, localhost:5000/boutique/catalogue, is signed. The public key is published in the boutique namespace, and verification with it accepts this image and refuses boutique/outil:1.0.
  • This production image carries strictly fewer critical vulnerabilities than the original.
  • The findings of the static analysis of the Dockerfile are gone, and it still builds an nginx image that serves the shop's pages.
  • The shop still answers at catalogue-svc, with all its replicas available, created under the hardenings above.

How do you start the exam and get graded?

The lab prepares the cluster and the full statement, then reads the state of the node and of the cluster again when you ask for your grade. You start it with dsoxlab run k8s-epreuve-securiser-un-cluster. Three commands are then used: dsoxlab hint k8s-epreuve-securiser-un-cluster gives the next hint, which is paid and reduces your scale, dsoxlab check k8s-epreuve-securiser-un-cluster tells you where you stand as many times as you like, and dsoxlab submit k8s-epreuve-securiser-un-cluster returns the verdict. The grade never looks at the commands you typed, only at the final state.

The grader reads the node and the cluster, never your manifests. It replays the CIS audit, reads the audit log after two real requests, submits Pods to admission, writes and runs chown in the Pods, makes real connections, compares kernels, runs wget itself, verifies the signatures with your published key, rescans the images and queries the shop.

Put it into practice

This lab is the exam itself. It puts you in front of the scenario described above and it is validated on the final state of the node and of the cluster, as a colleague taking over your work would.

How is the exam graded?

Nineteen criteria make up the grade, at equal weight: each is worth about 5.3 points out of 100. The pass mark is 70 points. Seven criteria are critical: they must all pass, and failing a single one fails the exam, whatever the total. The seven critical criteria are worth about 36.8 points: with no hint, you must therefore pass all of them, then at least seven of the other twelve to reach 70, that is fourteen criteria in all.

There are four hints, and each covers a different part of the exam. They cost 10, 15, 20 and 25 points. They are given in order: dsoxlab hint always gives the first hint you have not yet taken, and you cannot choose the one that would help you. The cost is taken off the scale before the grade is computed: the grade is the share of criteria passed, applied to that reduced scale.

A hint taken makes the pass mark harder to reach: with the first one, at 10 points, the scale drops to 90 and you need fifteen criteria instead of fourteen. With two hints taken (25 points), the scale drops to 75 and you need eighteen criteria out of nineteen. Taking all four removes 70 points, and the maximum falls to 30. As soon as the hints taken cost more than 30 points in total, 70 points can no longer be reached, even with all nineteen criteria. So take a hint to get unstuck, never as a shortcut.

The table gives each criterion, phrased as a result, and says whether it is critical.

CriterionCritical
P01the API server's profiler no longer answers, and the API still answersyes
P02a new CIS audit counts fewer failures than at the start, and the profiling checks passno
P03the API server runs with auditing on, following the requested policy, and writes its log on the nodeno
P04the log records a Secret read in full and an ordinary read as metadata onlyyes
P05the shop's namespace refuses a Pod that breaks the restricted standard and accepts a compliant Podyes
P06the cluster refuses a Pod whose image is named by a tag and accepts one whose image is pinned, without touching the other namespacesyes
P07the inherited privileged Pod is replaced by a Pod without its flaws, the original no longer exists and the host's processes are no longer visibleno
P08the AppArmor profile is loaded in enforce mode, and the confined Pod can read but no longer write to /dev/shmno
P09the seccomp profile refuses the chown family and allows the rest, and the Pod that declares it runsno
P10the meshed namespace requires mutual TLS, a client without a sidecar is blocked and a mesh client gets throughyes
P11the namespace is closed by default both ways, only the planned flow reaches the database and DNS resolvesno
P12the requested Pod runs in the node's sandbox runtime and reads a different kernel from the machine'sno
P13a network tool started in the protected namespace raises an alert from the requested Falco rule, with its priority, and the same tool started elsewhere does notyes
P14the Falco rules shipped with the package are intact, and the requested detection rule does raise an alertno
P15the shop's deployment references its image by the digest that the node actually runsno
P16the public key is published in the cluster, the image is signed, and verification accepts it and refuses another oneno
P17the production image carries strictly fewer critical vulnerabilities than the original imageno
P18the findings of the static analysis of the Dockerfile are gone and the application still does the same thingno
P19the shop still answers after every hardening, with its replicas availableyes

What should you do after the exam?

If the seven critical criteria pass and the total reaches 70, the level is validated. Otherwise, reread the lesson that teaches the failed criterion, then retake the exam:

Key points

  • The exam is a measurement: it explains nothing again and grades the state of the node and of the cluster, not your manifests or your commands.
  • The seven critical criteria decide the verdict: failing one fails the exam, and the total must also reach 70 points.
  • The shop must answer at the end, with its replicas created under the hardenings: a locked-down cluster that no longer serves anything fails.
  • A hint costs 10, 15, 20 or 25 points, and hints are given in order: you do not choose the one you receive. Beyond 30 points of hints in total, the pass mark is out of reach.
  • dsoxlab check tells you where you stand at will, and only dsoxlab submit returns the verdict.