KCSA
Free KCSA practice questions
10 questions from our KCSA practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, Overview of Cloud Native Security
A company processes sensitive workloads from two business units that must not be able to affect each other even if a container escape occurs. Which isolation approach gives the STRONGEST separation?
- AApply the restricted Pod Security Standard to both namespaces and require read-only root filesystems
- BRun each business unit in its own cluster, or at least on dedicated node pools with sandboxed runtimes Correct answer
- CAssign each business unit a separate ResourceQuota and a PriorityClass so that they cannot starve each other
- DGive each business unit its own namespace with a default-deny NetworkPolicy and separate RBAC roles
Answer and explanation: A container escape gives access to the node, so separating units by cluster (or at least by dedicated nodes, ideally with sandboxed runtimes such as gVisor or Kata) is what keeps one unit from reaching the other. Namespaces, network policy and RBAC are logical controls that share nodes and the kernel. Pod Security Standards reduce escape likelihood but do not contain one, and quotas address resource fairness only.
Question 2 of 10, Kubernetes Cluster Component Security. Choose 2.
Which TWO controller manager settings are recommended hardening steps by the CIS Kubernetes Benchmark? (Choose two.)
- ASet --bind-address=0.0.0.0 so that health checks from any network can reach the controller manager
- BSet --profiling=false to disable the profiling endpoint that is not needed in production Correct answer
- CSet --use-service-account-credentials=true so that each controller uses its own service account Correct answer
- DSet --service-account-private-key-file to the cluster CA certificate instead of a dedicated key
- ESet --authorization-always-allow-paths to every path so that metrics scraping never fails
Answer and explanation: Using per-controller service account credentials gives each controller only the RBAC permissions it needs, and disabling profiling removes an unnecessary endpoint that could leak information. Binding to all interfaces widens exposure; the benchmark recommends 127.0.0.1. The service account signing key must be a private key, not the CA certificate, and always-allowing every path bypasses authorization.
Question 3 of 10, Kubernetes Cluster Component Security. Choose 2.
Which TWO statements about static pods are correct from a security perspective? (Choose two.)
- AThey are created by the kubelet from files on the node and are not admitted through the API server's admission chain Correct answer
- BThey are always restricted by Pod Security Admission because the mirror pod is validated on creation
- CThey can only reference ConfigMaps and Secrets from the kube-system namespace in the cluster
- DWrite access to the static pod directory on a node lets an attacker run arbitrary pods on that node Correct answer
- EThey are scheduled by kube-scheduler, which applies node affinity before the kubelet starts them
Answer and explanation: The kubelet runs static pods directly from its manifest directory, so they do not depend on the API server and its admission controls for execution; whoever can write that directory can run pods on the node. Mirror pods may be rejected but the kubelet still runs the static pod. Static pods are not scheduled by the scheduler and cannot reference API objects such as ConfigMaps or Secrets at all.
Question 4 of 10, Kubernetes Security Fundamentals
During an incident review, an engineer filters audit events for a kubectl port-forward session that was still open when the logs were exported. Besides RequestReceived, which stage value would those events show?
- AResponseComplete
- BRequestReceived
- CResponseStarted Correct answer
- DPanic
Answer and explanation: Long-running requests such as port-forward, exec, watch or followed logs emit a ResponseStarted event once headers are sent, and ResponseComplete only when the stream ends, so an open session shows RequestReceived and ResponseStarted. ResponseComplete would appear only after the session closed, and Panic is generated only when the API server panics while handling the request.
Question 5 of 10, Kubernetes Security Fundamentals
A namespace is labeled pod-security.kubernetes.io/enforce=restricted. A developer applies a Deployment whose pod template runs as root. What happens?
- AThe Deployment object is created, but its ReplicaSet cannot create the pods because they are rejected Correct answer
- BThe pods are created and a warning is written to the audit log because enforce only records violations
- CThe pods are created but the kubelet silently changes them to run as a non-root user with UID 1000
- DThe Deployment object is rejected immediately by the API server with a pod security violation error
Answer and explanation: The enforce mode of Pod Security Admission checks Pod objects, so a Deployment is accepted and the failure appears when its ReplicaSet tries to create pods. The warn and audit modes also evaluate workload templates, which is why combining them with enforce gives earlier feedback. Enforce does not merely log, and the kubelet never rewrites the user a container runs as.
Question 6 of 10, Kubernetes Threat Model
In 2018, attackers found an unprotected Kubernetes Dashboard in a cloud account and used it to run cryptomining pods. Which control would have MOST directly prevented this initial access?
- ARunning the dashboard with a read-only root filesystem so that miners could not be installed
- BKeeping the dashboard private and requiring authentication with a least-privilege account Correct answer
- CApplying a ResourceQuota so that cryptomining pods could not exceed their CPU limit allowance
- DEncrypting Secrets at rest so that the cloud keys stored in the cluster could not be decrypted
Answer and explanation: The root cause was a dashboard exposed without authentication and running with broad privileges; keeping it private and requiring authenticated least-privilege access closes that entry point. Quotas only limit consumption after access is gained, encryption at rest does not protect values readable through the API, and a read-only dashboard filesystem does not stop it from creating new pods.
Question 7 of 10, Kubernetes Threat Model
An attacker who compromised a node deletes the Kubernetes Events and stops the logging agent to hide their activity. Which control MOST helps the investigation still succeed?
- AShip audit and node logs off-cluster in near real time to write-once storage Correct answer
- BGive the logging agent cluster-admin so that the attacker cannot stop it
- CRun the logging agent with a higher PriorityClass so that it is evicted last
- DIncrease the API server's event TTL so that Events remain stored in etcd for several additional days
Answer and explanation: Streaming logs off the cluster to tamper-resistant storage preserves evidence even if the attacker deletes local data or stops agents. A longer event TTL keeps Events in etcd where the attacker can still delete them, priority affects eviction rather than tampering, and broad permissions for the agent increase risk without preventing it from being stopped on a compromised node.
Question 8 of 10, Platform Security
A cluster's CA certificate created by kubeadm will expire in two months. Which statement is correct about planning its renewal?
- AThe CA never needs renewal because kubeadm creates it without an expiry date by default
- BThe CA can be renewed by restarting the API server, which regenerates it with the same private key
- CCA rotation needs the new CA distributed to all components and clients, so plan a phased rollover Correct answer
- Dkubeadm certs renew renews the CA together with all leaf certificates automatically during each cluster upgrade
Answer and explanation: Replacing the cluster CA affects every component and kubeconfig that trusts it, so it must be rolled out in phases with both CAs trusted during the transition. kubeadm certs renew renews leaf certificates, not the CA, during upgrades. Restarting the API server does not regenerate the CA, and kubeadm's CA does have an expiry (ten years by default).
Question 9 of 10, Platform Security
A platform uses the certificates.k8s.io API to issue client certificates for new administrators. Which signer name should their CertificateSigningRequests use?
- Akubernetes.io/kubelet-serving
- Bkubernetes.io/legacy-unknown
- Ckubernetes.io/kube-apiserver-client-kubelet
- Dkubernetes.io/kube-apiserver-client Correct answer
Answer and explanation: The kubernetes.io/kube-apiserver-client signer issues client certificates that the API server honors for user authentication. kubelet-serving is for kubelet serving certificates, kube-apiserver-client-kubelet is for kubelet client certificates, and legacy-unknown has no guaranteed trust and is not signed by the built-in controller.
Question 10 of 10, Compliance and Security Frameworks
What does policy as code mean in the context of Kubernetes compliance?
- ASecurity rules are written only in PDF documents that the compliance team reviews once a year
- BAuditors write the cluster's application code to embed compliance
- CSecurity rules are written as versioned, machine-enforceable definitions Correct answer
- DDevelopers memorize security rules and apply them during code review
Answer and explanation: Policy as code expresses security and compliance rules in machine-readable form, such as Kyverno, Gatekeeper or ValidatingAdmissionPolicy definitions, stored in version control and enforced automatically. Static documents, memorized rules and auditors writing application code do not provide automated, testable enforcement.