Exam Information
Free practice questions with explanations
Linux Foundation CKS Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 11
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Cluster Hardening
A platform team runs a multi-tenant cluster where CI pipelines deploy workloads using a ServiceAccount named deployer in the namespace team-ci. The pipeline only needs to create and update Deployments and read ConfigMaps in team-ci. During an audit, the team finds that the deployer ServiceAccount is bound to the built-in cluster-admin ClusterRole through a ClusterRoleBinding created months ago during a troubleshooting session. The auditors require least privilege without breaking the pipeline, and the change must be auditable and reversible. Which action should the administrator take FIRST?
Correct Answer: CExplanationA ClusterRoleBinding grants access across every namespace, so removing it and replacing it with a namespaced Role and RoleBinding narrows scope to team-ci exactly as required. Running kubectl auth can-i with --as system:serviceaccount:team-ci:deployer confirms the new permissions before the pipeline is affected. Editing the built-in cluster-admin ClusterRole is wrong because it is managed by the API server and changes would affect every other cluster-admin subject. Disabling token automounting stops the pipeline from authenticating at all and does not address the excessive binding. A new cluster-wide ClusterRole still grants more reach than the pipeline needs, violating least privilege.
-
2 Question 2 Single choice Cluster Setup
A financial services company runs a Kubernetes cluster where a namespace payments hosts a PostgreSQL pod that should accept connections only from pods labelled app=api in the same namespace, on TCP port 5432. The namespace has no existing NetworkPolicies, so all traffic is currently allowed. The security lead also wants to ensure that pods in other namespaces cannot reach the database even if they know its IP. The CNI in use is Calico, which enforces standard NetworkPolicy objects. Which configuration meets these requirements with the least risk of breaking unrelated traffic?
Correct Answer: CExplanationNetworkPolicies are additive allow-lists once a pod is selected, so a default-deny ingress policy in payments isolates every pod there, and a targeted allow rule then opens only TCP 5432 from app=api pods in the same namespace. Because the policy uses a podSelector with no namespaceSelector, cross-namespace sources are excluded. Allowing ingress from any namespace is wrong because it contradicts the requirement that other namespaces be blocked. A deny-egress policy in default has no effect on ingress to payments and does not isolate the database. Allowing all ports and adding a blocking policy is wrong because NetworkPolicies have no deny rules to override allows, so the broad allow would remain in effect.
-
3 Question 3 Single choice Minimize Microservice Vulnerabilities
A SaaS vendor hosts customer workloads on a shared cluster. One tenant runs an image-processing service that executes untrusted user-uploaded files through a native library. The security team is concerned that a kernel exploit triggered from within a container could escape to the node and read other tenants' data. Migrating to dedicated clusters per tenant is too costly, and the workload must keep using the standard container runtime interface. The team wants an isolation layer that interposes a user-space kernel between the container and the host kernel, with a RuntimeClass selecting it only for this workload. Which approach best fulfils the requirement?
Correct Answer: DExplanationgVisor provides a user-space kernel (the Sentry) that intercepts container system calls, and it is exposed to Kubernetes through a RuntimeClass whose handler matches the containerd runsc configuration. Setting runtimeClassName on only that pod keeps other tenants on the default runtime and avoids the cost of separate clusters. Seccomp RuntimeDefault reduces the syscall surface but still runs the workload on the host kernel, so it is weaker than a user-space kernel. Dropping capabilities does not stop kernel exploits reached through allowed syscalls. Kata Containers would also isolate the workload, but hostNetwork true undermines the isolation goal and conflicts with the requirement to keep tenant networking separated.
-
4 Question 4 Single choice Monitoring, Logging and Runtime Security
A cluster audit policy is configured on the kube-apiserver with --audit-policy-file and --audit-log-path. Security engineers want to detect when any user executes commands inside pods using kubectl exec, and they need the request body (the command) recorded, while avoiding logging the full bodies of all high-volume read requests such as list and watch on secrets, which would expose secret data and flood storage. Which audit policy rule is the MOST appropriate?
Correct Answer: DExplanationKubernetes exec is a create request against the pods/exec subresource, and the Request audit level records the request body containing the command without recording response payloads. Setting list and watch on secrets to None prevents secret data from being written while still letting other rules apply. Metadata for pods/exec omits the command, so the required detail is lost. Recording RequestResponse for all resources would expose secrets and create excessive volume. Targeting the log subresource with get is the wrong verb and subresource, so it does not detect exec activity.
-
5 Question 5 Single choice Supply Chain Security
A company runs a registry allow-list enforced by an admission webhook that only admits images from registry.corp.example.com. A developer proposes building a new service image on a minimal base and pushing it to the internal registry, but the image is built from a Dockerfile that uses FROM ubuntu:latest and installs build tools that remain in the final image. Compliance requires minimal base footprint, reproducible builds, and that the image pass vulnerability scanning before deployment. Which change to the build process BEST meets these requirements?
Correct Answer: CExplanationA multi-stage build keeps compilers and build dependencies out of the final layers, which shrinks the attack surface, and pinning the base by digest makes builds reproducible. Scanning the pushed image before deployment satisfies the compliance gate, and the image still lives on the allow-listed registry hostname. Deleting tools in a final RUN step leaves them in earlier layers, so the image is still large. Pulling ubuntu:latest from Docker Hub and pushing it inherits an unpinned, large base and bypasses the goal of minimal footprint. Removing the allow-list violates supply chain policy and shifts detection to runtime, which does not meet the pre-deployment scanning requirement.
-
6 Question 6 Multiple choice System Hardening
A platform engineer is hardening Kubernetes worker nodes running Ubuntu 22.04. The security baseline requires reducing the host attack surface, restricting what containers can do with syscalls, and limiting external network exposure of the node. The node runs kubelet and containerd only and no local services need to listen on external interfaces. Which TWO actions are appropriate? (Choose two.)
Correct Answer: A, CExplanationRemoving or masking unneeded host services and packages directly shrinks the attack surface the node exposes. Loading a custom AppArmor profile and applying it to containers restricts file and capability access at the kernel level, which is a recognised hardening control. Enabling anonymous auth on the kubelet lets unauthenticated callers reach it, which violates the baseline. Exposing the read-only port on all interfaces widens external access and is unauthenticated. Disabling seccomp removes a syscall restriction, which is the opposite of the stated goal.
-
7 Question 7 Single choice Cluster Hardening
A cluster operator is reviewing how workloads authenticate to the API server. A batch job in namespace reports runs as the default ServiceAccount, and the operator sees that the default ServiceAccount in that namespace has been granted a RoleBinding to a Role allowing get and list on secrets, added by a previous engineer for a debugging task. The batch job does not call the Kubernetes API at all. The operator wants to minimise exposure while preserving the namespace for other workloads. Which combination of actions is the MOST appropriate?
Correct Answer: AExplanationRemoving the RoleBinding eliminates the excessive secret access, and disabling token automounting on both the default ServiceAccount and the batch pod stops a token being mounted for a workload that never calls the API. This keeps the namespace and its default ServiceAccount in place for other workloads. Deleting the default ServiceAccount is risky because the namespace controller recreates it, and it does not remove the binding for future pods. Leaving the binding in place only sidesteps the problem for one pod and keeps the excessive permission live. Enabling automounting increases exposure rather than reducing it.
-
8 Question 8 Single choice Cluster Setup
A cluster operator is reviewing kube-apiserver and kubelet configuration against the CIS Kubernetes benchmark for a production cluster. The findings include that the kubelet's anonymous authentication is enabled, that the kubelet read-only port is reachable, and that the kube-apiserver is started without the --anonymous-auth=false flag. The operator must remediate these without interrupting running workloads and needs to verify the result against the benchmark checks. Which remediation is the MOST appropriate?
Correct Answer: BExplanationThe kubelet configuration field authentication.anonymous.enabled set to false disables anonymous access, and readOnlyPort 0 disables the insecure read-only port, both of which map to CIS checks. Setting --anonymous-auth=false on kube-apiserver addresses the API server finding, and rolling restarts one member at a time keep the cluster available. Simultaneous restarts risk control-plane outage, which is a constraint the operator must respect. Firewalling alone leaves the insecure configuration in place and fails the benchmark. Granting system:anonymous read access deliberately extends unauthenticated access, which the remediation is meant to remove.
-
9 Question 9 Single choice Minimize Microservice Vulnerabilities
A team manages a database credential used by a payments service. The credential is stored in a Kubernetes Secret and mounted as an environment variable. During a review, the team discovers that the credential appears in plain text in the output of kubectl describe pod for several pods, and in the kubelet logs for a crash-looping container. The team wants to stop exposing the value through pod specs and logs while keeping the service functional and avoiding a full cluster re-architecture. Which change BEST addresses the exposure?
Correct Answer: AExplanationEnvironment variables sourced from a Secret are copied into the pod spec's container environment and are commonly echoed in describe output and crash logs, whereas a Secret mounted as a read-only volume is delivered as a file that the application reads directly. This reduces exposure in the pod object and logs and requires only an application change to read a file. Base64 is encoding, not encryption, so it gives no confidentiality. ConfigMaps are the wrong object for credentials and are not encrypted at rest by default. Logging the credential through a sidecar is the opposite of the goal.
-
10 Question 10 Multiple choice Monitoring, Logging and Runtime Security
A security team is investigating a suspected compromise in a production namespace. A pod's container shows a shell process spawned from the application binary, and the team suspects an attacker is writing a file into the container's filesystem to persist access. The team needs runtime detection that can surface syscall-level behaviour and immutability violations without modifying the application image. Which TWO approaches are appropriate for detecting this activity at runtime? (Choose two.)
Correct Answer: A, BExplanationFalco uses kernel instrumentation to observe execve and file-write syscalls, so rules that match a shell spawned from the application binary or writes outside expected paths surface the activity at syscall level. A read-only root filesystem enforces immutability at runtime, and blocked writes show up as denied operations that investigators can correlate. A HEALTHCHECK only runs what its command specifies and does not observe arbitrary processes. Kubelet verbosity does not feed container process events into the API server audit log. Disabling seccomp weakens the workload and does not provide recording of syscalls for detection.
-
11 Question 11 Single choice Supply Chain Security
A security engineer must enforce that only signed images from approved registries run in a production namespace. The cluster uses a validating admission policy engine with a signature verification capability, and images are signed with cosign by the CI pipeline. A team proposes validating only the image tag, since tags are immutable in their registry policy. The engineer notes that tags can be re-pointed unless the registry enforces immutability, and the workloads reference images by tag. Which enforcement design is MOST appropriate?
Correct Answer: BExplanationA tag can be re-pointed to different content, so signature verification must bind to a digest, and requiring digest references means the admitted content is exactly what was signed. Combining this with a registry prefix allow-list enforces both provenance and origin at admission time. A semantic version pattern is only a string check and says nothing about content. Checking only the hostname ignores signature integrity, so a compromised but trusted registry or a re-pointed tag passes. Build-time verification alone is bypassable by anyone who can create workloads directly, so admission-time enforcement is needed.
These are 11 of the 64 questions in the full CKS pack.
Get All 64 QuestionsGet all 64 questions & answers
Full access options for Linux Foundation CKS
Self-study
PDF Version
- 64 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 64 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 64 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the CKS Exam (Certified Kubernetes Security Specialist) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.