Security & multi-tenancyLesson 13 of 13
Viewing the cluster through the 4Cs and a threat model (KCSA·KCNA)
This covers the 4Cs in Overview of Cloud Native Security (14%) and the Kubernetes Threat Model (16%) in the KCSA domains, and ties into the security items within Container Orchestration (28%) in the KCNA. As one attacker starts outside and tries to cross the boundaries one by one, we follow where each threat model item arises and which control stops it.
Attacker positionoutside
Threat itemTrust boundaries & data flow
Control that stopped it-
RequestResponse / report
What you will learn
- How the 4Cs (Cloud, Cluster, Container, Code) wrap each other from the outside in
- Reading the diagram as trust boundaries and data flows
- Where the seven threat model items arise
- Matching controls per boundary: NetworkPolicy, RBAC, Pod Security Standards, Secret encryption, audit logs
Common exam questions
| Situation | What to do / command | Trap |
|---|---|---|
| Asked for the 4C order | From the outside: Cloud → Cluster → Container → Code | Inner layers rely on outer ones. Protecting only the code is not enough |
| A compromised pod reaches other pods | A default-deny NetworkPolicy in the namespace, allowing only needed traffic | By default, all pods can talk to each other |
| Privilege escalation via the pod token | Least-privilege service accounts, automountServiceAccountToken: false | Even pod-create rights are a path to borrowing another account's rights |
| Protecting Secrets | etcd encryption at rest (EncryptionConfiguration) + narrower Secret read RBAC | base64 is not encryption |
| Denial of service | requests and limits, ResourceQuota, API Priority and Fairness | Without limits, one pod can starve its neighbors on the node |
| Tracing persistence and breach paths | Check create and exec requests and their users in the audit log | Audit logs exist only if an audit policy is configured |
To go deeper into each boundary's defenses, continue with the lessons Blocking and Allowing Traffic (NetworkPolicy), Who Can Do What (RBAC), Pod Security Standards and securityContext and Audit Logs.
Try it yourself
kubectl get networkpolicy -A # Default-deny in each namespace?
kubectl get ns -L pod-security.kubernetes.io/enforce # Pod Security Standard per namespace
kubectl auth can-i --list --as=system:serviceaccount:<namespace>:<sa> # What a pod's token can do
kubectl get resourcequota -A # Quotas that cap denial of service
sudo grep -E 'encryption-provider-config|audit-policy-file' /etc/kubernetes/manifests/kube-apiserver.yaml # Secret encryption and audit on? (kubeadm)
Check yourself
Further reading: CNCF certification curriculum · Overview of cloud native security · Multi-tenancy