CKS System Hardening Practice Question
Which TWO of the following are effective measures to harden the Kubernetes API server against unauthorized access?
⚠ Common exam trap
CNCF often tests the distinction between preventive controls (like admission controllers and authentication) and detective controls (like audit logging), so candidates mistakenly select audit logging as a hardening measure when it only detects, not prevents, unauthorized access.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable the NodeRestriction admission controller
The NodeRestriction admission controller limits the Node and Pod objects a kubelet can modify, preventing compromised nodes from accessing or modifying resources beyond their own. This is a key hardening measure because it enforces the principle of least privilege directly within the API server's admission chain, reducing the blast radius of a node compromise.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Enable the NodeRestriction admission controller
Why this is correct
The NodeRestriction admission controller enforces that a kubelet may only modify the Node object it is assigned to, and cannot alter sensitive labels such as kubernetes.io/role or any label with a node.kubernetes.io/ prefix, nor request the node.k8s.io/v1 Node API for other nodes. This directly reduces the attack surface of a compromised worker node by preventing label-based privilege escalation or denial-of-service via node object corruption, working in tandem with Node authorization to enforce the principle of least privilege for node identity.
- ✗
Set --anonymous-auth=true to allow all users
Why it's wrong here
Setting --anonymous-auth=true makes the kube-apiserver accept unauthenticated requests, attributing them to the synthetic system:anonymous user. While RBAC might restrict this user, any unauthenticated attacker who can reach the API server endpoint (e.g., via a misconfigured NetworkPolicy, a compromised pod, or a public ingress) gains the ability to enumerate endpoints, read resources if RBAC allows, or potentially exploit additional misconfigurations. This flag should be false in production, forcing every request to carry valid credentials, otherwise authentication becomes a mere formality and the cluster's security boundary collapses.
- ✗
Enable audit logging to detect unauthorized attempts
Why it's wrong here
Audit logging is a detective control that records a chronological trail of API requests, including who made them, what they accessed, and the outcome. It does not intercept or block malicious actions at execution time; if an attacker has already passed authentication and authorization, they can still perform their actions before any log-based alert triggers. Hardening measures must be preventive, such as NodeRestriction for limiting node privileges or client TLS certificates for establishing identity, while audit logs serve only for post-incident analysis and compliance, not as a barrier against the initial threat.
- ✗
Disable all authentication mechanisms and rely on network policies
Why it's wrong here
Disabling all authentication mechanisms and relying solely on network policies fundamentally misunderstands the threat model: network policies filter pod-to-pod and pod-to-service traffic at the CNI layer, but they do not police who can issue HTTP requests to the kube-apiserver, which is a workload itself often exposed on a cluster-facing port. Without authentication, every request to the API server is effectively anonymous, so any process with network access—including a compromised pod in a different namespace or a rogue container on a host—can call admin endpoints. Network policies also cannot distinguish between legitimate and malicious API verbs, making this an unworkable substitute for identity-based security.
- ✓
Configure the API server to use TLS certificates for client authentication
Why this is correct
Configuring the API server with --client-ca-file enables mutual TLS (mTLS), which requires every client to present a certificate signed by a trusted CA. This provides cryptographic, non-repudiable identity for users, service accounts, and especially kubelets, and is far more resistant to theft than static bearer tokens or passwords. Combined with RBAC, mTLS ensures that even if a network-level attacker can reach the API server, they cannot complete the handshake without a valid certificate, effectively making the API server invisible to unauthorized clients and forming the foundational authenticity layer of all in-cluster communication.
Quick reference
AAA Protocol Comparison
| Protocol | Port(s) | Encryption | Transport | Primary Use |
|---|---|---|---|---|
| RADIUS | 1812 / 1813 | Password only | UDP | Network access control |
| TACACS+ | 49 | Full packet | TCP | Device administration |
| Diameter | 3868 | Full session | TCP / SCTP | Carrier / mobile networks |
| 802.1X | — | EAP-based | Layer 2 | Port-based access control |
TACACS+ encrypts the entire packet; RADIUS only encrypts the password field — a key exam distinction.
Go deeper
Related to this question
Learn chapter
Supply Chain Security: Secrets Management and Encryption
Key term
OPA Gatekeeper
OPA Gatekeeper is a Kubernetes admission controller that enforces custom security and compliance policies on resources before they are created or updated in a cluster.
Key term
API Server Security
API Server Security refers to the practices, configurations, and controls that protect the Kubernetes API server from unauthorized access, data breaches, and malicious attacks.
About these practice questions
Courseiva writes every CKS question from scratch — 845 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.