Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Secure a Kubernetes cluster: CIS, admission, runtime and CKS

  • 10 min

By updated

Improve this page

A working Kubernetes cluster is not automatically a secure one. By default, Kubernetes does not apply enough hardening for production: pods can often talk to each other freely, Secrets are not encrypted at rest without dedicated configuration, and overly broad permissions granted to ServiceAccounts quickly expose sensitive resources.

This page opens level 5 of the Kubernetes course, "Secure the cluster", which has you harden a cluster end to end in six modules: Understand the threats, Harden the platform, Identities, access and nodes, Confine and admit Pods, Secrets, encryption and supply chain, then Detect at runtime. It is also the first lesson of the first module, Understand the threats, which teaches you to reason about what an attacker can do with a cluster before installing any tool. The level is aimed at administrators who already know the basic objects, kubectl and cluster administration (kubeadm, etcd), and it largely extends the 6 domains of the CKS certification (Certified Kubernetes Security Specialist).

Why secure the cluster at this point of the course?

You can only harden well what you know how to install and operate. Level 5 therefore comes after the installation, administration and operation of the cluster: you already have a running cluster, and you know what it contains. It also comes after the module on workload security, which lays the least-privilege foundation with the Security Context, the ServiceAccounts and RBAC. Here, we add the layers that prevent and detect what those rights alone do not block.

The thread follows defense in depth: each layer assumes the previous one can be bypassed. This is why the level does not read as a catalog of tools, but as a stack that goes from the attacker and the platform towards the container, then towards what happens during execution.

What are the six modules of level 5?

Each module has its own introduction. They follow one another in this order: understand what you defend, harden the platform, master identities, confine the Pods, protect secrets and images, then detect what gets through anyway.

ModuleWhat it teaches you to do
Understand the threatsdescribe the layers to protect, the trust boundaries and the attack scenarios
Harden the platformmeasure hardening with the CIS Benchmark, harden Linux, SSH, sudo and the firewall
Identities, access and nodesapply least privilege to identities, harden the nodes, restrict access to the API server
Confine and admit Podslimit each Pod (AppArmor, seccomp, Pod Security Standards) and reject at admission what is not compliant
Secrets, encryption and supply chainencrypt exchanges and Secrets, sign and scan images
Detect at runtimetrace API access, detect abnormal behavior, isolate sensitive workloads

The last module ends with the level 5 trial, which measures these skills on a kubeadm cluster.

What does the Understand the threats module cover?

The module starts with the framework. The 4Cs of cloud native security describe the layers to protect (code, container, cluster, cloud), and the lesson on securing the infrastructure under the cluster recalls that the cluster is worth no more than the machines that carry it.

It then teaches you to reason like an attacker. Trust boundaries and threat modeling say where a compromise changes privilege level. The attack scenarios in a cluster walk through concrete paths, the lesson on persistence shows what an attacker leaves behind, and the one on denial of service shows how a cluster gets exhausted. The following modules teach you to defend against them.

Which topics are covered outside this level?

Two security topics live elsewhere in the course, because they belong to broader subjects. The filtering of traffic between pods belongs to the Network Policies, covered with cluster networking: the principle is a default deny-all, then explicitly allowed flows. Secrets have their own lesson on Kubernetes Secrets.

To widen the view beyond Kubernetes, the page on container security covers the subject for any container engine.

Does this level prepare you for the CKS certification?

It covers a large part of it: cluster hardening, workload security, supply chain, runtime and audit. The CKS assumes you have passed the CKA (or have equivalent experience). The CKS path details the exam domains and the strategy, and the comparison of CKA, CKAD and CKS helps you choose according to your profile.

Key takeaways

Kubernetes security rests on defense in depth, and each module of level 5 answers a specific risk:

  • Threats: you describe what an attacker can reach before choosing a tool.
  • Platform: the CIS Benchmark gives the state of play, then Linux, SSH, sudo and the firewall get hardened.
  • Identities and nodes: least privilege applies to identities, nodes and access to the API server.
  • Pods and admission: AppArmor, seccomp and Pod Security Standards limit each pod, VAP, Kyverno or Gatekeeper block non-compliant resources before they are created.
  • Secrets and supply chain: pod-to-pod encryption, Secrets encrypted at rest, provenance and image scanning.
  • Detection: audit logs enabled, Falco or Tetragon, sandboxes for sensitive workloads.