CertGrid
Cloud Native Certification

CKS: Certified Kubernetes Security Specialist Practice Exam

Validates skills in securing container-based applications and Kubernetes platforms across build, deployment, and runtime - cluster/system hardening, microservice security, supply chain, and runtime monitoring.

Start with a free CKS practice test, then work through 614 exam-style questions with full answer explanations, and use MCQ readiness practice to check concepts and command decisions before hands-on lab work.

Free account: a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full bank and timed mock exams. No credit card required to start.

614
Practice pool
Hands-on lab
Real exam
120 min
Real exam time
67%
Passing score

CertGrid MCQ practice: 50 questions. The real CKS exam is hands-on and performance-based. CertGrid provides a fixed 50-question MCQ practice session to test concepts, command decisions, and troubleshooting readiness. Practice in a real Kubernetes cluster before booking.

Objective-mapped practice, aligned to current exam objectives · Reviewed Oct 2026 · Independent practice platform.

What the CKS exam covers

Free CKS practice test questions

A sample of 10 questions with answers and explanations. A free account includes a fixed set of 20 practice questions for this exam, retryable anytime. Paid access unlocks the full 614-question bank.

  1. Question 1Cluster Setup

    You must benchmark a kubeadm cluster against the CIS Kubernetes Benchmark and get a list of failing controls. Which tool and invocation is standard for this on a control-plane node?

    • Akubectl audit cis --node master
    • Btrivy cluster --benchmark cis
    • Ckubeadm check cis
    • Dkube-bench run --targets masterCorrect
    ✓ Correct answer: D

    kube-bench, from Aqua Security, runs the CIS Kubernetes Benchmark checks on the node where it runs and prints PASS, FAIL, WARN or INFO for each numbered control. Its documentation selects benchmark sections with the run subcommand and --targets, for example kube-bench run --targets master,node. On a control-plane node, --targets master evaluates the API server, controller manager, scheduler and control-plane file settings, and the FAIL lines are the failing controls (kube-bench flags-and-commands docs).

    Why the other options are wrong
    • Akubectl has no audit subcommand and no built-in CIS benchmark feature; CIS checks come from a dedicated tool such as kube-bench.
    • Btrivy cluster --benchmark cis is not valid Trivy syntax. Trivy can produce CIS compliance reports for a live cluster with trivy k8s --compliance=k8s-cis-1.23, using a node-collector job, but that is a different command from the one shown.
    • Ckubeadm has no check cis subcommand; kubeadm bootstraps and upgrades clusters and does not run CIS Benchmark checks.
  2. Question 2Minimize Microservice Vulnerabilities

    After enabling encryption-at-rest with an aescbc provider, existing Secrets are still stored unencrypted in etcd. Which command rewrites them so encryption takes effect?

    • Akubectl encrypt secrets --all-namespaces, which walks every Secret and rewrites it through the configured encryption provider
    • Betcdctl defrag, which rewrites the etcd datastore so existing Secrets are re-encoded under the new encryption provider
    • Ckubectl get secrets --all-namespaces -o json | kubectl replace -f -Correct
    • Dkubectl rollout restart secrets --all-namespaces, which triggers each Secret to be rewritten so encryption applies
    ✓ Correct answer: C

    Kubernetes encryption at rest applies the encryption provider only when a Secret is written to etcd. Secrets that existed before encryption was enabled remain stored in their original (plaintext or previously-encrypted) form. To bring them under the new encryption provider, you must force a write by reading each Secret and replacing it. The command kubectl get secrets --all-namespaces -o json | kubectl replace -f - reads all Secrets in JSON and re-applies them, causing each one to be re-serialised and written through the active encryption provider.

    Why the other options are wrong
    • AThere is no kubectl encrypt subcommand; re-encrypting existing Secrets is done by reading and re-writing them so the API server persists them through the new provider
    • Betcdctl defrag reclaims disk space in etcd and does not re-encode object values, so it does not cause existing Secrets to be re-encrypted
    • Drollout restart applies to workload controllers like Deployments and DaemonSets, not to Secrets, which have no rollout, so it does not rewrite Secret data in etcd
  3. Question 3Minimize Microservice Vulnerabilities

    After rotating the aescbc key in your EncryptionConfiguration (adding the new key first and keeping the old key second), what additional step ensures all stored Secrets are re-encrypted with the new key?

    • ARestart the kube-apiserver so it re-reads etcd and re-encrypts stored Secrets
    • BForce a rewrite of all Secrets, e.g., kubectl get secrets -A -o json | kubectl replace -f -Correct
    • CRun kubectl rollout restart on every Deployment that mounts a Secret
    • DSwap the key order so the old key is listed first again to trigger a rewrite
    ✓ Correct answer: B

    Encryption only occurs on write, so existing Secrets retain whatever key encrypted them until they are written again. Reading and replacing all Secrets (e.g., kubectl get secrets --all-namespaces -o json | kubectl replace -f -) forces re-encryption under the new key. Only after this can the old key be safely removed.

    Why the other options are wrong
    • Athe API server re-encrypts a Secret only when that object is written; a restart re-reads and decrypts existing objects but does not rewrite them, so they stay encrypted under the old key
    • Crestarting Deployments re-reads Secrets into pods but never writes the Secret objects back to etcd, so their stored encryption key is unchanged
    • Dthe first key in the list is the one used for encryption on write, so putting the old key first would re-encrypt with the old key, the opposite of the goal
  4. Question 4Minimize Microservice Vulnerabilities

    You label a namespace with pod-security.kubernetes.io/warn: restricted and pod-security.kubernetes.io/enforce: baseline. A user creates a Pod that satisfies Baseline but violates Restricted. What happens?

    • AThe Pod is created, and the user sees a warning about the Restricted violationCorrect
    • BThe Pod is rejected because the strictest configured level always wins
    • CThe Pod is created silently with no warning because enforce overrides warn
    • DThe API server returns an error because conflicting levels cannot be set on one namespace
    ✓ Correct answer: A

    PSA modes are independent and can target different levels on the same namespace. Here enforce is baseline, so a Baseline-compliant Pod is admitted. The warn mode is set to restricted, so the API server returns a warning message about the Restricted violation without blocking. This dry-run pattern lets teams preview a stricter level before flipping enforce to it.

    Why the other options are wrong
    • BModes are evaluated independently; the strictest does not automatically block unless enforce is set to it.
    • Cwarn is not overridden by enforce; the warning is still emitted.
    • DSetting different levels for enforce, warn, and audit on one namespace is valid and common.
  5. Question 5Monitoring, Logging and Runtime SecuritySelect all that apply

    Which audit stages can the kube-apiserver emit an audit event at? (Choose three.)

    • ARequestReceivedCorrect
    • BResponseStartedCorrect
    • CResponseCompleteCorrect
    • DRequestValidated
    ✓ Correct answer: A, B, C

    The four defined stages are RequestReceived (event is generated as soon as the handler receives the request), ResponseStarted (headers sent but body not yet, relevant for long-running requests like watches), ResponseComplete (response body fully sent), and Panic (events generated when a panic occurs). RequestValidated is not a real audit stage. Policies can suppress specific stages globally via omitStages or per rule.

    Why the other options are wrong
    • DRequestValidated is not a Kubernetes audit stage; the real fourth stage is Panic.
  6. Question 6Cluster Hardening

    A developer must be able to read and update ConfigMaps in namespace dev, and must get no other access in dev or in any other namespace. Which RBAC setup meets this?

    • AA Role in dev allowing get, list and update on configmaps, bound with a RoleBinding in devCorrect
    • BA ClusterRole allowing get, list and update on configmaps, bound with a ClusterRoleBinding
    • CA RoleBinding in dev that grants the developer the built-in edit ClusterRole in dev only
    • DA Role in dev allowing get, list and update on configmaps, bound with a ClusterRoleBinding
    ✓ Correct answer: A

    A Role is namespaced, and a RoleBinding grants permissions only inside its own namespace, so a Role in dev with get, list and update on configmaps, bound in dev, gives exactly the access required. The RBAC good-practices guide says to assign permissions at the namespace level where possible and to use RoleBindings rather than ClusterRoleBindings. A ClusterRoleBinding can reference only a ClusterRole, and the built-in edit role covers far more than ConfigMaps, including Secrets (Kubernetes RBAC docs).

    Why the other options are wrong
    • BA ClusterRoleBinding grants the ClusterRole in every namespace, so the developer could read and update ConfigMaps outside dev, which the requirement forbids.
    • Cedit allows read and write on most namespaced objects, including Secrets and running pods as any ServiceAccount, which is far more than ConfigMap access.
    • DA ClusterRoleBinding can reference only a ClusterRole; a roleRef pointing at a namespaced Role is rejected, so this binding cannot be created.
  7. Question 7Minimize Microservice Vulnerabilities

    An attacker with a shell must not be able to drop tools anywhere in a container's filesystem, yet the app must still write temporary files to /tmp. Which configuration meets both?

    • AreadOnlyRootFilesystem: true alone, since the runtime keeps /tmp as a writable tmpfs
    • BreadOnlyRootFilesystem: true, plus an emptyDir volume mounted at /tmpCorrect
    • CreadOnly: true on every volumeMount, plus an emptyDir volume mounted at /tmp
    • DallowPrivilegeEscalation: false, plus an emptyDir volume mounted at /tmp
    ✓ Correct answer: B

    readOnlyRootFilesystem true mounts the container's root filesystem read-only, so nothing can be written into the image's directories, and that includes /tmp unless a volume is mounted there. Mounting an emptyDir volume at /tmp then gives the application exactly the scratch space it needs. Read-only volume mounts protect only the volumes themselves, and no_new_privs stops setuid elevation, so neither makes the root filesystem read-only (Kubernetes security context and volumes docs).

    Why the other options are wrong
    • A/tmp is part of the root filesystem unless a volume is mounted there, so a read-only root alone leaves the app unable to write its temporary files.
    • CreadOnly on volumeMounts protects the mounted volumes only; the root filesystem stays writable, so tools can still be dropped there.
    • Dno_new_privs blocks setuid elevation but leaves the root filesystem writable, so files can still be written wherever the user has permission.
  8. Question 8Supply Chain Security

    Which pair are the two widely used SBOM standards?

    • ASPDX and CycloneDXCorrect
    • BOpenVEX and CSAF
    • Cin-toto and SLSA
    • DOCI and Notation
    ✓ Correct answer: A

    The CNCF supply chain paper states that there are two well-known SBOM specifications, SPDX and CycloneDX, and common generators such as syft emit both. OpenVEX and CSAF carry vulnerability exploitability statements and advisories, in-toto and SLSA describe attestations and build provenance, and OCI and Notation concern image formats and signatures. These neighbouring formats travel with SBOMs but are not inventories themselves (CNCF supply chain paper).

    Why the other options are wrong
    • BOpenVEX and CSAF express vulnerability status and advisories, such as not_affected statements, rather than a component inventory.
    • Cin-toto is an attestation framework and SLSA defines build provenance; neither is a component inventory format.
    • DOCI defines image and artifact formats and Notation signs them; an SBOM can be stored as an OCI artifact but is not defined by either.
  9. Question 9Monitoring, Logging and Runtime Security

    A container process empties files under /var/log to hide its activity. Which event does Falco's stable Clear Log Activities rule match?

    • AA log file opened for writing with the O_TRUNC flagCorrect
    • BA log file opened for writing with the O_APPEND flag
    • CA log file renamed with the rename or renameat calls
    • DA log file opened for reading by an untrusted process
    ✓ Correct answer: A

    In falco_rules.yaml Clear Log Activities is open_write and access_log_files and evt.arg.flags contains O_TRUNC, minus trusted logging images; its description says it detects clearing of critical access log files done to erase evidence. Opening with O_TRUNC sets the length to zero, which is what a shell redirect onto a log file does. Source: falcosecurity/rules falco_rules.yaml.

    Why the other options are wrong
    • BO_APPEND adds to the end of the file, which is normal logging; it removes no content.
    • CRenaming moves the file rather than emptying it; the rule's condition is an open with O_TRUNC, not a rename.
    • DReading a log file does not change it; the rule looks for writes that truncate the file.
  10. Question 10Minimize Microservice Vulnerabilities

    Using Kyverno, you want any pod that omits securityContext.runAsNonRoot to have runAsNonRoot: true added at admission, rather than being rejected. Which rule type does this?

    • AA validate rule with failureAction: Enforce
    • BA mutate rule with a patchStrategicMergeCorrect
    • CA generate rule with synchronize: true
    • DA verifyImages rule with mutateDigest: true
    ✓ Correct answer: B

    Kyverno mutate rules modify matching resources at admission using an RFC 6902 JSON Patch or a strategic merge patch, so they can add runAsNonRoot when it is absent. Validate rules only accept or reject, generate rules create or synchronize other resources, and verifyImages with mutateDigest rewrites image tags to digests. Sources: kyverno.io Mutate Resources; Verify Images; Validate Resources.

    Why the other options are wrong
    • AA validate rule only checks the pod; with Enforce it rejects pods that lack the field instead of adding it.
    • CGenerate rules create or keep in sync other resources, such as a NetworkPolicy; they do not change the submitted pod.
    • DverifyImages does mutate pods, but only to convert image tags to digests; it does not add securityContext fields.

Who this CKS practice exam is for

This practice set is for anyone preparing for the CKS: Certified Kubernetes Security Specialist exam - from first-time candidates building a foundation to experienced Cloud Native practitioners doing a final review before test day. If you learn best by working through realistic questions and reading why each answer is right or wrong, it is built for you.

How to use this CKS practice exam

  1. Start with the free sample questions above to gauge your current baseline.
  2. Read the full explanation on every question, including why each wrong option is wrong.
  3. Track your weak domains and focus your study where you are losing the most marks.
  4. Once you are scoring consistently well, take a timed, full-length mock exam.
  5. Treat your readiness score as knowledge readiness, then validate it with hands-on practice in a real environment before booking the CKS exam.

Related Cloud Native resources

CKS practice exam FAQ

How many questions are in the CKS practice exam on CertGrid?

CertGrid has 614 practice questions for CKS: Certified Kubernetes Security Specialist, covering 6 exam domains. The real CKS exam is a hands-on, performance-based lab exam (120 min). The real CKS exam is hands-on and performance-based. CertGrid provides a fixed 50-question MCQ practice session to test concepts, command decisions, and troubleshooting readiness. Practice in a real Kubernetes cluster before booking. CertGrid's MCQ readiness practice covers 50 questions.

Is CertGrid a hands-on Cloud Native lab simulator?

No. The real CKS exam is a hands-on, performance-based lab exam. CertGrid provides MCQ-style readiness practice to help you check concepts, commands, troubleshooting choices, and weak domains before doing hands-on labs - it is not a live lab simulator.

What is the passing score for CKS?

The CKS exam passing score is 67%, and you have about 120 min to complete it. CertGrid tracks your readiness across every objective so you know where to focus your hands-on lab practice.

Are these official CKS exam questions?

No. CertGrid is an independent practice platform. We do not provide real or leaked exam questions. Our questions are original and designed to help you practice the concepts, scenarios, and difficulty style of the CKS: Certified Kubernetes Security Specialist exam.

Is there a free CKS practice test?

Yes. You can take a free CKS: Certified Kubernetes Security Specialist practice test straight away: a fixed set of 20 practice questions for this exam, retryable as often as you like, with no credit card required. You get readiness scoring and a weak-domain breakdown on those questions. Paid plans unlock the full 614-question bank, timed mock exams and full-bank domain analytics.

What CertGrid is (and is not)

CertGrid is an independent IT certification practice platform for Azure, AWS, Google, Cisco, Security, Linux, Kubernetes, Terraform, and other certification tracks. It provides objective-mapped practice questions, readiness scoring, weak-domain drills, and explanations to help learners understand what to study next.

Independent & original. CertGrid is an independent practice platform and is not affiliated with or endorsed by the Cloud Native Computing Foundation. Questions are original practice items designed to mirror certification concepts and exam style. CertGrid does not provide official exam questions or braindumps.