Free practice · No sign-up required

Certified Kubernetes Security Specialist free practice test

15 questions with answer explanations. Choose an answer below to begin.

Question 1 of 15

Which control plane component validates and configures cluster state?

Show hint

Understand the role of API server in cluster operations and security

0/15 answered · Bookmark questions to review later. Focus the practice area to use keys 1–9 and Enter.

Learn by doing

Put your answers into practice

Use official documentation and hands-on labs to work through topics you missed.

Explore all study resources →
Kubernetes application examples

Application examples from the Kubernetes project for practicing manifests and application behavior in a cluster.

Try it: Use a disposable cluster. Read a simple application's manifests, predict which Pods its Service selects, then change a label and use kubectl to diagnose the resulting connectivity problem.

Source is free. A local cluster uses your computer; hosted clusters may incur charges.

Kubernetes official tutorials

Guided tutorials for learning Kubernetes behavior and building practical skills beyond multiple-choice recall.

Try it: Complete a basic application tutorial. Repeat the task without the walkthrough, then explain the difference between declared configuration and observed cluster state.

Documentation is free. Your chosen cluster environment may have costs.

All questions and explanations

Prefer to read at your own pace? Work through each question below, then open its answer to check your reasoning. You can link directly to a question or print this reference.

  1. Which control plane component validates and configures cluster state?

    1. etcd

    2. kube-apiserver

    3. kube-scheduler

    4. cloud-controller-manager

    Show answer and explanation

    Correct answer

    • kube-apiserver

    The kube-apiserver exposes the Kubernetes API and is the primary control plane component for validating and applying configuration changes. It ensures only authorized and valid requests update the cluster state.

  2. What is the purpose of a NetworkPolicy resource?

    1. To define allowed communication between pods

    2. To manage persistent storage access

    3. To control image registry authentication

    4. To schedule pods across nodes

    Show answer and explanation

    Correct answer

    • To define allowed communication between pods

    A NetworkPolicy specifies how groups of pods are allowed to communicate with each other and other network endpoints. It uses label selectors to define allowed ingress and egress traffic.

  3. Which practice helps reduce the impact of a container breakout?

    1. Running containers as root

    2. Using the host network namespace

    3. Enabling read-only root filesystems

    4. Granting wide hostPath mounts

    Show answer and explanation

    Correct answer

    • Enabling read-only root filesystems

    Setting a read-only root filesystem prevents attackers from modifying application binaries or configuration inside the container. This limits persistence options in case of a container escape.

  4. What does a PodSecurity admission controller enforce?

    1. Pod creation based on security contexts and standards

    2. Node resource allocation

    3. Image vulnerability scanning

    4. Secret encryption at rest

    Show answer and explanation

    Correct answer

    • Pod creation based on security contexts and standards

    PodSecurity admission controllers apply policies that restrict pod configurations based on security standards. They can enforce rules around run as non-root, read-only filesystems, and restricted capabilities.

  5. Which RBAC element defines what actions can be performed on which resources?

    1. Role or ClusterRole

    2. ServiceAccount

    3. Binding

    4. TokenRequest

    Show answer and explanation

    Correct answer

    • Role or ClusterRole

    Roles and ClusterRoles contain rules that specify API groups, resources, and verbs (like get, list, create). Bindings associate these rules with users or service accounts.

  6. Why should you avoid using the default service account for pods?

    1. It typically has permissions that are broader than needed

    2. It cannot mount persistent volumes

    3. It prevents containers from starting

    4. It disables network access

    Show answer and explanation

    Correct answer

    • It typically has permissions that are broader than needed

    The default service account is often bound to broader permissions than necessary. Using dedicated service accounts with minimal permissions limits the scope of compromised credentials.

  7. What is a secure method to inject sensitive configuration into a container?

    1. Using Kubernetes Secrets mounted as environment variables or volumes

    2. Embedding secrets in container images

    3. Storing secrets in ConfigMap without encryption

    4. Hardcoding values in pod spec

    Show answer and explanation

    Correct answer

    • Using Kubernetes Secrets mounted as environment variables or volumes

    Kubernetes Secrets can be mounted as files or exposed as environment variables, keeping sensitive data out of image layers and source control. Ensure Secrets are encrypted at rest where possible.

  8. Which feature helps ensure only signed images are deployed?

    1. ImagePolicy webhook

    2. Horizontal Pod Autoscaler

    3. Ingress controller

    4. CoreDNS

    Show answer and explanation

    Correct answer

    • ImagePolicy webhook

    An ImagePolicy webhook validates image references against policies, such as requiring image signatures or allowing only from approved registries. This prevents unauthorized or tampered images from running.

  9. What is a recommended practice for etcd security?

    1. Enable client certificate authentication and encryption at rest

    2. Expose etcd directly to the public internet

    3. Use the same certificate for all cluster components

    4. Disable authentication for performance

    Show answer and explanation

    Correct answer

    • Enable client certificate authentication and encryption at rest

    etcd stores all cluster state and should be protected with client certificate authentication and encryption at rest. Limiting access to the API server and etcd members reduces attack surface.

  10. Question 10

    Link to question

    Which admission controller helps prevent privilege escalation?

    1. PodSecurity

    2. NodeRestriction

    3. AlwaysPullImages

    4. ServiceAccount

    Show answer and explanation

    Correct answer

    • NodeRestriction

    The NodeRestriction admission controller limits what kubelet can do, including preventing pods from escalating privileges on the node. It enforces constraints like preventing host path mounts unless allowed.

  11. Question 11

    Link to question

    What is the primary benefit of using a dedicated Kubernetes namespace for sensitive workloads?

    1. It enables logical isolation for applying role-based access controls and network policies

    2. It automatically encrypts all data at rest

    3. It removes the need for network policies

    4. It increases node compute capacity

    Show answer and explanation

    Correct answer

    • It enables logical isolation for applying role-based access controls and network policies

    Namespaces provide a scope for RBAC and network policy enforcement, allowing finer control over who can access and communicate with resources. They do not inherently encrypt data or add compute.

  12. Question 12

    Link to question

    Which configuration helps protect API server access?

    1. Using short-lived client certificates and restricting source IPs

    2. Allowing unauthenticated anonymous requests

    3. Disabling audit logging

    4. Enabling insecure port without firewall rules

    Show answer and explanation

    Correct answer

    • Using short-lived client certificates and restricting source IPs

    Protecting the API server involves using short-lived certificates, enabling authentication, and restricting network access. Disabling audit logging or allowing unauthenticated access weakens security posture.

  13. Question 13

    Link to question

    What is a secure alternative to running pods in the host network namespace?

    1. Using a hostPath volume for all application data

    2. Letting containers share the host PID namespace

    3. Using a dedicated network namespace with controlled ingress/egress

    4. Mapping all host devices into the pod

    Show answer and explanation

    Correct answer

    • Using a dedicated network namespace with controlled ingress/egress

    Sharing the host network namespace exposes the pod to the host network stack and increases risk. Using the default pod network with NetworkPolicy allows controlled communication while isolating traffic.

  14. Question 14

    Link to question

    Which action helps detect unauthorized changes to critical system components?

    1. Periodically reviewing audit logs

    2. Disabling role-based access control

    3. Using the latest unstable Kubernetes version

    4. Allowing all egress traffic

    Show answer and explanation

    Correct answer

    • Periodically reviewing audit logs

    Audit logs record actions taken within the cluster and are essential for detecting suspicious activity or policy violations. Regular review supports timely incident response.

  15. Question 15

    Link to question

    What is the primary function of the Kubernetes API server audit log?

    1. To record all requests to the API server for security analysis

    2. To store application container logs

    3. To manage etcd backup operations

    4. To schedule workloads across nodes

    Show answer and explanation

    Correct answer

    • To record all requests to the API server for security analysis

    The audit log records all requests to the API server, providing a critical security mechanism for monitoring and forensic analysis.

Read all flashcards

Recall the answer before opening each card.

Which control plane component validates and configures cluster state?

kube-apiserver. It exposes the Kubernetes API and is the primary component for validating and applying configuration changes securely.

What is the purpose of a NetworkPolicy?

To define allowed communication between pods using label selectors for ingress and egress traffic, enabling micro-segmentation.

Which container hardening practice reduces the impact of a container breakout?

Enabling a read-only root filesystem prevents attackers from modifying binaries or configuration, limiting persistence.

What does the PodSecurity admission controller enforce?

It enforces pod creation based on security contexts and standards (privileged, baseline, restricted) to restrict risky configurations.

Which RBAC element defines allowed actions on resources?

Role or ClusterRole. They contain rules specifying API groups, resources, and verbs like get, list, create.

Why should you avoid using the default service account?

It typically has broader permissions than needed, so using dedicated service accounts with minimal privileges limits compromise scope.

What is a secure method to inject sensitive configuration?

Use Kubernetes Secrets mounted as environment variables or volumes, avoiding embedding in images or source control.

Which feature ensures only signed images are deployed?

ImagePolicy webhook validates images against policies like requiring signatures or approved registries.

What is a recommended practice for etcd security?

Enable client certificate authentication and encryption at rest, and restrict network access to only necessary components.

Which admission controller prevents privilege escalation?

NodeRestriction limits kubelet capabilities, preventing pods from escalating privileges on the node.

What is the primary benefit of dedicated namespaces for sensitive workloads?

Logical isolation for applying RBAC and network policies, enabling finer control over access and communication.

Which configuration helps protect API server access?

Using short-lived client certificates and restricting source IPs reduces the attack surface.

What is a secure alternative to running pods in host network namespace?

Use a dedicated pod network with NetworkPolicy for controlled ingress/egress, avoiding host stack exposure.

Which action helps detect unauthorized changes to critical components?

Periodically reviewing audit logs records all API requests, enabling detection of suspicious activity.

What is the primary function of the API server audit log?

To record all requests to the API server for security analysis, monitoring, and forensic investigation.

How does a read-only root filesystem limit a container breakout?

It prevents writing to the filesystem, stopping attackers from modifying binaries or dropping persistence mechanisms.

What type of resource does a ClusterRole apply to?

ClusterRole applies cluster-wide to any resource, including non-namespaced ones like nodes, and can be used in any namespace via RoleBinding.

What is the risk of sharing the host network namespace?

The pod can access host network services and potentially sniff traffic or bypass network policies, increasing compromise risk.

How can you enforce encryption for Secrets at rest?

Configure encryption provider in the API server with --encryption-provider-config to encrypt Secret data in etcd.

What is the effect of a default-deny-all NetworkPolicy?

It blocks all ingress and egress traffic to selected pods until explicit allow rules are added, enforcing zero-trust networking.

Active recall deck

Practice Certified Kubernetes Security Specialist with real flashcards

Read the prompt, commit to an answer, then flip the card. Move through the deck at your own pace and repeat any topic that does not come back quickly.

20 free cards

Card 1 of 20

1 reviewed this session

Connect the concepts

Your Certified Kubernetes Security Specialist study mind map

Open a branch to connect a topic with its practice questions and explanations. Use the map to choose your next review topic.

Certified Kubernetes Security Specialist15 questions in this practice set
Understand the role of API server in cluster operations and security(1)
Implement network segmentation using Kubernetes network policies(1)
Apply least privilege and hardening measures at the container level(1)
Use built-in admission controls to enforce security best practices(1)
Design role-based access control rules for namespace and cluster-level permissions(1)
Apply least privilege by using dedicated service accounts for workloads(1)
Manage sensitive application data using native Kubernetes mechanisms(1)
Enforce image provenance and integrity verification(1)
Protect cluster data store with strong authentication and encryption(1)
Restrict kubelet capabilities to reduce node-level risk(1)
Use namespaces to organize and isolate workloads for security controls(1)
Harden API server access and communication(1)
More practice connections(3)
Exam-focused analysis

What this CKS practice set measures

This is an analysis of the practice bank, not a claim about the vendor's live exam blueprint. Use it to identify the knowledge, judgment, and recall patterns exercised here, then verify your coverage against the current official exam guide.

Control Plane & API Security

The practice bank emphasizes that the kube-apiserver is the central component for validating and configuring cluster state. Protecting it requires short-lived client certificates and network restrictions. Etcd, which stores all cluster data, must be secured with client certificate authentication and encryption at rest. Audit logging records all API requests and is essential for detecting unauthorized changes. The NodeRestriction admission controller helps prevent privilege escalation on nodes. Understanding these components' security roles is critical.

  • kube-apiserver validates and configures cluster state
  • Protect API server with short-lived certificates and source IP restrictions
  • etcd requires client certificate auth and encryption at rest
  • Audit logs record all API requests for forensic analysis
  • NodeRestriction prevents kubelet privilege escalation

Pod & Container Hardening

The practice bank addresses reducing container breakout impact by enabling read-only root filesystems. This limits attackers from modifying binaries or configurations. PodSecurity admission controllers enforce standards like run-as-non-root and restricted capabilities. Avoiding host network namespace is recommended; using dedicated pod networks with NetworkPolicy provides controlled ingress/egress. These measures implement least privilege at the container and pod level.

  • Read-only root filesystem limits persistence after breakout
  • PodSecurity admission enforces security context standards
  • Avoid host network namespace; use NetworkPolicy for isolation
  • Dedicated service accounts minimize permission scope
  • Secrets should be mounted as files or env vars, not in images

Network Policies & Access Control

The practice bank covers NetworkPolicy resources that define allowed communication between pods using label selectors. This enables micro-segmentation. For access control, Roles and ClusterRoles define actions on resources (verbs, resources, API groups). Default service accounts often have broader permissions than needed; dedicated service accounts limit blast radius. ImagePolicy webhook ensures only signed images from approved registries are deployed, enhancing supply chain security.

  • NetworkPolicy specifies ingress/egress rules using labels
  • Role/ClusterRole define actions on API resources
  • Avoid default service accounts; use minimal-scope dedicated ones
  • ImagePolicy webhook enforces signed images and registry restrictions
  • Namespaces provide logical isolation for RBAC and network policies

Secrets Management & Monitoring

Sensitive configuration should be injected using Kubernetes Secrets mounted as environment variables or volumes, keeping data out of image layers. For monitoring, periodic review of audit logs detects unauthorized changes to critical components. The practice bank highlights that audit logging records all requests to the API server, providing a trail for security analysis. Namespace isolation via RBAC and network policies further contains sensitive workloads.

  • Use Secrets mounted as files or env vars to avoid embedding in images
  • Encrypt Secrets at rest where possible
  • Regular audit log review detects anomalies
  • Dedicated namespaces for sensitive workloads enable finer controls
  • Audit logs are primary for monitoring API server activity

Study workflow

Turn one CKS attempt into a study plan

  1. 1

    Secure etcd

    Enable client certificate authentication for etcd peers and clients. Encrypt etcd data at rest using the encryption provider configuration. Restrict network access to etcd to only the API server and etcd cluster members. Use firewalls or network policies to limit exposure.

  2. 2

    Enforce Pod Security Standards

    Enable the PodSecurity admission controller in the API server. Define policies using the built-in profiles (privileged, baseline, restricted). Apply policies per namespace using labels like pod-security.kubernetes.io/enforce. Test with dry-run first.

  3. 3

    Configure NetworkPolicy

    Start with a default-deny-all policy for each namespace. Then create ingress and egress rules using podSelector and namespaceSelector. Specify ports and protocols. Use kubectl describe networkpolicy to verify. Test connectivity with temporary debugging pods.

  4. 4

    Implement ImagePolicyWebhook

    Deploy a webhook server that validates image references against a policy. Configure the API server with an admission webhook configuration file. Require signatures via tools like cosign. Use the ImagePolicyWebhook admission controller to reject unsigned images.

  5. 5

    Set Up Audit Logging

    Enable audit logging in the API server with --audit-policy-file and --audit-log-path. Define a policy that logs metadata for all requests or specific resources. Rotate logs using --audit-log-maxbackup and --audit-log-maxsize. Regularly review logs using centralized tools like Falco or ELK.

FAQ

Questions about this CKS practice page

Clear boundaries on what the bank covers, how to use it, and where official vendor information still matters.

What is the difference between Role and ClusterRole in RBAC?+

A Role grants permissions within a specific namespace. A ClusterRole grants permissions cluster-wide, including non-namespaced resources (like nodes) and can be used across namespaces via RoleBinding. Both contain rules with verbs, resources, and API groups.

Why should I avoid running containers as root?+

Running as root inside a container gives the process elevated privileges on the host in case of a breakout. Using a read-only root filesystem and running as non-root limits the damage an attacker can do. PodSecurity standards enforce runAsNonRoot.

How does the NodeRestriction admission controller work?+

NodeRestriction limits the kubelet's ability to modify node and pod objects. It prevents kubelets from setting node status to unschedulable or modifying pods not bound to itself. This reduces the attack surface if a node is compromised.

What is the purpose of an ImagePolicy webhook?+

An ImagePolicy webhook validates container images before they are admitted into the cluster. It can enforce policies like requiring images to be signed, from a trusted registry, or have no critical vulnerabilities. This prevents deployment of malicious or tampered images.

Can NetworkPolicy block all traffic within a namespace?+

Yes, by default all traffic is allowed if no NetworkPolicy selects the pod. To block all traffic, apply a NetworkPolicy that selects all pods and has no ingress or egress rules. This effectively isolates the pod until explicit rules are added.

Keep studying

Build the next review session

Browse another free bank or use the study strategy guide to turn your misses into spaced review.