SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
KCSA practice

KCSA sample questions — 25 answered and explained

25 KCSA sample questions written to the official Kubernetes and Cloud Native Security Associate (KCSA) exam guide, grouped by exam domain and weighted like the real exam. Each shows the correct answer, why every other option is wrong, and the lesson that teaches it. None of them repeat the examples on the other KCSA practice pages.

Looking for KCSA dumps? There isn’t a safe one: leaked exam questions break the CNCF certification agreement and can cost you the certification. These questions are original, in the exam’s format, with every answer explained.

On this page
25
answers included
Full bank
387
on the practice page
Domains
6
weighted like the exam
Free, no account
5/day
a free account allows 10 a day

Domain 1: Overview of Cloud Native Security

14% of the KCSA exam, so 4 of the 25 questions on this page.

Question 1Overview of Cloud Native Security

A cluster runs on a managed Kubernetes service whose provider operates the control plane. Its worker nodes are virtual machines launched from the team's own launch template in an auto-scaling group the team created. A kernel flaw that enables container escape is announced. What should the team expect?

Choose one.

  • a
    The provider patches the control plane and the nodes, and the team needs to restart its workloads

    That holds for node pools the provider manages. Nodes launched from the team's own template and auto-scaling group are self-managed, so their kernel stays vulnerable until the team acts.

  • b
    The provider patches the control plane, and the team must roll its nodes onto a fixed node image Correct

    The kernel runs on worker nodes the team launched from its own template, so building a fixed node image and rolling the nodes onto it is the team's job; the provider covers only the hosts it operates.

  • c
    The team upgrades the cluster's Kubernetes version, and that upgrade rolls a fixed kernel onto the nodes

    A control plane version upgrade does not touch self-managed nodes. Their operating system and kernel come from the team's launch template, which the team must update separately.

  • d
    The team patches the control plane and the nodes, because it chose to manage the node group itself

    Managing the nodes does not hand the team the control plane: in a managed service the provider operates and patches it, and the team has no access to those hosts.

The concept

The shared-responsibility split can differ inside one cluster: managed control plane, customer-managed nodes.

Why that’s the answer

Three facts combine. First, the kernel belongs to the worker nodes, not to the control plane. Second, nodes launched from the team's own launch template in its own auto-scaling group are a self-managed node group, so the team owns their patching even though the provider owns the control plane. Third, upgrading the cluster's Kubernetes version changes the control plane but does not replace the operating system of self-managed nodes. The tempting near-twin assumes the provider patches nodes, which is true for provider-managed node pools but not here.

How to reason it out
  1. Place the vulnerability: the Linux kernel on the worker nodes.
  2. Work out who operates those nodes: launched from the team's own template, so self-managed.
  3. Assign the fix to that party, and remember that a control plane upgrade does not reach self-managed nodes.

Exam tip: Responsibility follows who operates each part: managed control plane is the provider's, self-managed nodes are yours.

KCSA: The 4Cs of Cloud Native Security, Infrastructure Security and Security Controls — the lesson that teaches this.

Question 2Overview of Cloud Native Security

A new cluster's Kubernetes API endpoint is reachable from any address on the internet. Which change follows the recommended practice for infrastructure security?

Choose one.

  • a
    Allow the endpoint from any address but move it to a non-default port

    Changing the port hides nothing from scanners; the endpoint is still reachable from the whole internet.

  • b
    Allow the endpoint from any address but require clients to use HTTPS

    The API server already serves TLS; requiring HTTPS does not reduce who can reach it on the network.

  • c
    Allow the endpoint only from the IP ranges that administer the cluster Correct

    Kubernetes guidance says the control plane should not be publicly reachable and should be limited by network ACLs to the addresses needed to administer it.

  • d
    Allow the endpoint only from the IP ranges of the cluster's own Pods

    That blocks the administrators and CI pipelines, which connect from outside the Pod address ranges.

The concept

Network access to the API server is a Cloud-layer control: keep the control plane off the public internet and allow only the administrative sources.

Why that’s the answer

The recommended infrastructure control is a network allow list (or a private endpoint) so only the addresses that administer the cluster can connect. Port changes and TLS do not shrink the reachable population. Restricting to Pod ranges is a near-twin that restricts the wrong set of sources: it locks out the administrators and CI systems the cluster actually needs.

How to reason it out
  1. Identify the problem: the endpoint is reachable by everyone.
  2. The fix must reduce who can connect at the network level.
  3. Allow only the administrative sources.

Exam tip: Keep the API endpoint off the internet; allow only the networks that administer the cluster.

KCSA: The 4Cs of Cloud Native Security, Infrastructure Security and Security Controls — the lesson that teaches this.

Question 3Overview of Cloud Native Security

A cluster already requires authentication and RBAC on every API request. An engineer argues that also limiting which networks can reach the API endpoint adds nothing. Which response is correct?

Choose one.

  • a
    It adds nothing, because unauthenticated requests are rejected before reaching any handler

    Requests still reach the server and its authentication code; a network allow list removes that exposure for everyone outside the allowed ranges.

  • b
    It adds nothing, because RBAC already denies anonymous users access to every resource

    RBAC acts only after a request arrives. A stolen valid credential passes RBAC, and network restriction is what stops it being used from anywhere.

  • c
    It adds a layer, because flaws or stolen credentials are only usable from allowed networks Correct

    Network restriction is defence in depth: a leaked token or an API server vulnerability can then only be exploited from the allowed networks.

  • d
    It adds a layer, because a network allow list replaces the need for RBAC on the endpoint

    Network restriction complements RBAC; anyone on an allowed network still needs to be authorised, so RBAC stays required.

The concept

Network access controls on the API server and API authentication/authorization are separate layers; each covers failures of the other.

Why that’s the answer

Authentication and RBAC decide what a request may do once it arrives. Limiting network access decides who can send a request at all. If a credential leaks or an API server flaw is found, the attacker can only use it from an allowed network. The near-twin distractor gets the value right but the reasoning wrong: network restriction does not replace RBAC.

How to reason it out
  1. Separate 'who can reach the endpoint' from 'what an authenticated request may do'.
  2. Consider failure cases: stolen credentials, server vulnerabilities.
  3. Network restriction limits those cases to allowed networks, without replacing RBAC.

Exam tip: Network allow lists and RBAC are layers, not substitutes: one limits who can connect, the other what they can do.

KCSA: The 4Cs of Cloud Native Security, Infrastructure Security and Security Controls — the lesson that teaches this.

Question 4Overview of Cloud Native Security

A team is writing network ACLs for its worker nodes. Which inbound traffic does the Kubernetes infrastructure guidance say the nodes should accept?

Choose one.

  • a
    Connections from the control plane on the needed ports, with Service traffic dropped at the node

    Dropping all Service traffic breaks every NodePort and LoadBalancer Service the team publishes; the guidance allows that traffic in.

  • b
    Connections from hosts across the whole virtual network, on the ports the nodes listen on

    Allowing the whole network on the node ports lets any host in it reach the kubelet API, which only the control plane should be able to call.

  • c
    Connections from the control plane on the needed ports, plus NodePort and LoadBalancer Service traffic Correct

    The guidance: nodes accept connections from the control plane on the specified ports, and connections for Services of type NodePort and LoadBalancer; ideally they are not on the public internet.

  • d
    Connections from the other worker nodes, with control plane traffic sent through a Service

    The control plane must reach each node's kubelet directly; that traffic is not routed through a Kubernetes Service.

The concept

Network access to nodes is a Cloud-layer control: allow the control plane on the required ports and the Service traffic you publish, and keep nodes off the internet where possible.

Why that’s the answer

Nodes need two kinds of inbound traffic: the control plane talking to the kubelet on the required ports, and the traffic for Services the team deliberately publishes through NodePort or LoadBalancer. Each distractor gets one part wrong: dropping all Service traffic breaks published Services, allowing the whole network on the node ports exposes the kubelet API to any host, and routing control plane traffic through a Service misunderstands how the API server reaches the kubelet.

How to reason it out
  1. List what must reach a node: control plane traffic and published Service traffic.
  2. Restrict the control plane path to the control plane's addresses.
  3. Reject anything that blocks published Services or opens the kubelet to arbitrary sources.

Exam tip: Nodes accept the control plane on the required ports and the Services you publish; nothing else.

KCSA: The 4Cs of Cloud Native Security, Infrastructure Security and Security Controls — the lesson that teaches this.

Domain 2: Kubernetes Cluster Component Security

22% of the KCSA exam, so 6 of the 25 questions on this page.

Question 5Kubernetes Cluster Component Security

A company's managed Kubernetes API endpoint is reachable from the internet. Administrators connect from one office network over the internet, and CI runners use fixed egress IP addresses. The team wants to reduce the endpoint's attack surface without adding a VPN and without changing how kubectl authenticates. What should they do?

Choose one.

  • a
    Allowlist the office and CI egress address ranges on the public endpoint Correct

    Limiting which source addresses can reach the public endpoint shrinks the attack surface, keeps both groups connected without a VPN, and leaves authentication and RBAC exactly as they are.

  • b
    Apply a default-deny NetworkPolicy in kube-system that admits office and CI ranges

    NetworkPolicy, even with ipBlock rules for those ranges, controls traffic to and from Pods; it does not filter internet clients reaching the managed API endpoint.

  • c
    Disable anonymous requests on the cluster's public API server endpoint

    This removes one class of request without changing kubectl authentication, but the endpoint stays reachable from the whole internet, so its attack surface is largely unchanged.

  • d
    Make the API endpoint private, reachable from inside the cluster's VPC network

    A private endpoint removes internet exposure, but the office and CI runners connect over the internet, so they would need a VPN or similar link that the team has ruled out.

The concept

Limiting network reachability of the API server is a separate layer from authentication and authorization; both should be applied.

Why that’s the answer

The requirement is about who can reach the endpoint, not what authenticated callers may do. A private endpoint would be the strongest reduction, but the stated constraint rules out adding a VPN, and the clients are outside the VPC. Allowlisting the known source ranges on the public endpoint removes the rest of the internet while kubectl credentials and RBAC are untouched. NetworkPolicy governs Pod traffic, and disabling anonymous requests leaves the endpoint reachable by everyone.

How to reason it out
  1. Identify the goal: reduce reachability, not permissions.
  2. Rule out controls that act on Pods or on which requests are authenticated.
  3. Check each reachability option against the no-VPN constraint.
  4. Choose source-range allowlisting on the public endpoint.

Exam tip: Keep the API server off the open internet: allowlist source ranges, or use a private endpoint when clients can reach it privately.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Question 6Kubernetes Cluster Component Security

An attacker who compromised one worker node uses its kubelet credential to taint or relabel other Node objects, so that sensitive workloads are pushed onto the compromised node. The API server runs --authorization-mode=Node,RBAC. Which API server setting stops a kubelet from modifying Node objects other than its own?

Choose one.

  • a
    Adding Node to the front of --authorization-mode

    The Node authorizer is already enabled and permits node write requests; the per-object restriction comes from the NodeRestriction admission plugin.

  • b
    Adding PodNodeSelector to --enable-admission-plugins

    PodNodeSelector limits which node selectors Pods in a namespace may use; it does not stop a kubelet from editing other Node objects.

  • c
    Adding TaintNodesByCondition to --enable-admission-plugins

    TaintNodesByCondition adds NotReady and NoSchedule taints to newly created Nodes; it does not restrict which Node objects a kubelet may change.

  • d
    Adding NodeRestriction to --enable-admission-plugins Correct

    The NodeRestriction admission plugin limits a kubelet to modifying its own Node object and Pods bound to it, and restricts which labels it may set.

The concept

The Node authorizer grants kubelets node and Pod write permissions; the NodeRestriction admission plugin narrows those writes to the kubelet's own Node and its bound Pods.

Why that’s the answer

Authorization works on verbs and resources, so the Node authorizer permits a kubelet to update nodes. Narrowing that to its own Node object - and blocking self-assigned labels in the protected node-restriction.kubernetes.io/ prefix - is done by the NodeRestriction admission plugin, enabled with --enable-admission-plugins. Reordering the authorizer list changes nothing because the Node authorizer is already present, and the other admission plugins deal with Pod node selectors and taints on new Nodes rather than with who may edit a Node.

How to reason it out
  1. Note that Node,RBAC is already enabled.
  2. Recall which admission plugin limits a kubelet to its own Node and bound Pods.
  3. Rule out plugins that act on Pod placement or on newly created Nodes.
  4. Pick NodeRestriction.

Exam tip: Node authorizer + NodeRestriction admission together contain a compromised kubelet.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Question 7Kubernetes Cluster Component Security

A team is configuring how the kube-apiserver connects to its etcd cluster. Which configuration protects this connection as recommended by the Kubernetes documentation?

Choose one.

  • a
    Plain TCP on a private subnet, with etcd trusting connections from that subnet

    Network location alone does not authenticate the client or encrypt the traffic, which carries every Secret in the cluster.

  • b
    Mutual TLS, with the API server presenting a client certificate that etcd verifies Correct

    Strong credentials such as TLS client certificates, plus etcd verifying them, protect the data in transit and ensure only the API server can connect.

  • c
    One-way TLS, with etcd presenting a server certificate and not checking clients

    This encrypts the traffic but lets any client that can reach the port read or write the whole keyspace.

  • d
    Mutual TLS, with etcd skipping verification of the client certificate it receives

    Without verifying client certificates against a trusted CA, the TLS handshake would not stop an arbitrary client.

The concept

The API server should reach etcd over mutual TLS: it presents a client certificate (--etcd-certfile/--etcd-keyfile), verifies etcd with --etcd-cafile, and etcd requires client certificate authentication.

Why that’s the answer

etcd holds the full cluster state, so the connection must be both encrypted and authenticated in both directions. Mutual TLS gives encryption and lets etcd accept only the API server's certificate. The near-twins each drop one half: one-way TLS authenticates only the server, and accepting any client certificate authenticates no one.

How to reason it out
  1. Recall that etcd holds every object, including Secrets.
  2. Require both encryption and client authentication.
  3. Choose mutual TLS with client-certificate verification.

Exam tip: API server to etcd: mutual TLS, client certificates verified.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Question 8Kubernetes Cluster Component Security

A kube-apiserver connects to kubelets to serve kubectl exec and kubectl logs. Kubelets reject anonymous requests and use the self-signed serving certificates they generate by default. A penetration tester shows the API server would accept a forged kubelet endpoint on the node network. Which change closes this gap without breaking exec and logs?

Choose one.

  • a
    Bootstrap CA-signed kubelet serving certificates, then set --kubelet-certificate-authority to that CA Correct

    Kubelets must first present serving certificates from a CA (serverTLSBootstrap plus approved kubelet-serving CSRs); the API server then verifies each kubelet against that CA and rejects an impostor.

  • b
    Set --kubelet-certificate-authority to the cluster CA and keep each kubelet's self-signed serving certificate

    The self-signed certificates are not issued by the cluster CA, so the API server would reject every real kubelet and exec and logs would stop working.

  • c
    Bootstrap CA-signed kubelet serving certificates and leave the API server's kubelet flags unchanged

    The kubelets now hold verifiable certificates, but without --kubelet-certificate-authority the API server still does not check them, so a forged endpoint is still accepted.

  • d
    Disable anonymous kubelet requests and rotate the API server's kubelet client certificate and key

    Both strengthen how the API server proves itself to kubelets; neither makes the API server verify the kubelet, and anonymous requests are already rejected.

The concept

The API server-to-kubelet connection has two directions of trust: the kubelet client certificate authenticates the API server, while --kubelet-certificate-authority makes the API server verify the kubelet's serving certificate - which only works if that certificate was issued by a CA.

Why that’s the answer

Two facts combine here. First, the API server does not verify a kubelet's serving certificate unless --kubelet-certificate-authority is set, so an attacker on the path can impersonate a kubelet and capture exec sessions or logs. Second, a kubelet's default serving certificate is self-signed, so pointing that flag at the cluster CA alone makes every real kubelet fail verification. The kubelets need CA-issued serving certificates first (serverTLSBootstrap: true, with their kubelet-serving CSRs approved and signed by the controller manager), and then the API server can verify them. Rotating the client certificate or disabling anonymous access hardens the other direction, which was already sound.

How to reason it out
  1. Separate 'API server proves itself to kubelet' from 'API server verifies kubelet'.
  2. Recall that the API server verifies kubelets only when --kubelet-certificate-authority is set.
  3. Recall that default kubelet serving certificates are self-signed and would fail that check.
  4. Choose CA-signed kubelet serving certificates followed by the CA flag.

Exam tip: Give kubelets CA-signed serving certificates, then set --kubelet-certificate-authority so the API server checks them.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Question 9Kubernetes Cluster Component Security

An attacker copies the private key that the kube-apiserver uses to sign service account tokens. What can the attacker now do?

Choose one.

  • a
    Mint tokens for any service account and act with its RBAC permissions Correct

    The API server trusts any token signed with this key, so the attacker can forge tokens for any service account, including highly privileged ones.

  • b
    Decrypt service account token Secrets that etcd stores with encryption at rest

    Encryption at rest uses keys from the EncryptionConfiguration or a KMS, not the service account signing key.

  • c
    Sign client certificates that the API server maps to a user or group

    Client certificates are signed by the cluster CA key; the service account key signs tokens, not certificates.

  • d
    Read the service account tokens already mounted into running Pods

    The signing key does not give access to node filesystems or Pod volumes, so it cannot read tokens already mounted in Pods; what it does is let the attacker mint new tokens.

The concept

The service account signing key is a root of trust: whoever holds it can forge tokens for any service account.

Why that’s the answer

Service account tokens are JWTs that the API server accepts if their signature verifies against a trusted public key. Holding the private key therefore means forging tokens for any service account, with whatever RBAC permissions it has. The near-twins confuse it with the cluster CA key (certificates) and the encryption-at-rest keys (etcd data).

How to reason it out
  1. Recall what the key signs: service account tokens.
  2. Recall that the API server trusts any token with a valid signature.
  3. Conclude the attacker can impersonate any service account.

Exam tip: Protect the service account signing key like the cluster CA key - it can forge any identity it signs for.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Question 10Kubernetes Cluster Component Security

An operator is reviewing kube-apiserver flags for service account tokens. One file must be readable only by the API server process, while the other could safely be shared with external systems that verify the tokens. Which pairing is correct?

Choose one.

  • a
    --service-account-signing-key-file holds the private key; --service-account-key-file holds the public key Correct

    The signing key file is the private key used to issue tokens; the key file lists the public keys used to verify them.

  • b
    --service-account-key-file holds the private key; --service-account-signing-key-file holds the public key

    This reverses the flags: the key file is used for verification, and the signing key file holds the private key.

  • c
    --tls-private-key-file holds the private key; --service-account-signing-key-file holds the public key

    --tls-private-key-file is the private key of the API server's own TLS serving certificate, and the signing key file holds a private key, not a public one.

  • d
    --service-account-signing-key-file holds the private key; --tls-cert-file holds the public key

    --tls-cert-file is the API server's own TLS serving certificate; tokens are verified against the keys in --service-account-key-file.

The concept

kube-apiserver signs tokens with the private key in --service-account-signing-key-file and verifies them with the key(s) listed in --service-account-key-file.

Why that’s the answer

Only the signing key can mint tokens, so it must be locked down to the API server. --service-account-key-file lists the keys used for verification; it is normally given public keys (it also accepts a private key file, from which the public half is used), and public keys can be published - for example through the OIDC discovery endpoint - so external systems can validate tokens. The near-twin swaps the two flags; the others substitute the API server's own TLS serving certificate or key.

How to reason it out
  1. Ask which operation needs a secret: signing.
  2. Match signing to --service-account-signing-key-file.
  3. Match verification to --service-account-key-file.

Exam tip: Signing key = private, guard it; key file = public, used to verify.

KCSA Control Plane Security: API Server, Controller Manager, Scheduler and etcd — the lesson that teaches this.

Domain 3: Kubernetes Security Fundamentals

22% of the KCSA exam, so 5 of the 25 questions on this page.

Question 11Kubernetes Security Fundamentals

How does a Pod's securityContext relate to the Pod Security Standards?

Choose one.

  • a
    The securityContext sets runtime parameters; the standards define which values the control plane accepts Correct

    A security context configures the Pod and containers at runtime; a profile is a control-plane rule about which security context values are allowed.

  • b
    The standards set runtime parameters; the securityContext defines which values the control plane accepts

    This swaps the roles: the standards never configure the container runtime, they only judge the Pod's settings.

  • c
    The securityContext overrides the standards for a Pod that sets one of its fields explicitly

    Setting a field explicitly does not escape the policy; the explicit value is exactly what admission evaluates.

  • d
    The standards are applied by the kubelet as default securityContext values when each Pod starts

    The standards are not defaults and are not applied by the kubelet; Pod Security Admission validates Pods in the API server.

The concept

Security contexts configure Pods and containers; security profiles such as the Pod Security Standards are control-plane rules about which settings are acceptable.

Why that’s the answer

Kubernetes distinguishes the two explicitly: the securityContext is part of the Pod spec and becomes parameters for the container runtime, while a profile is enforced by the control plane to require or forbid particular values. The swapped twin and the 'defaults applied by the kubelet' option both confuse configuring with validating.

How to reason it out
  1. Ask which of the two is part of the Pod manifest.
  2. Ask which one is evaluated by the control plane at admission.
  3. Choose the statement that keeps configuring and validating separate.

Exam tip: securityContext configures; Pod Security Standards judge.

KCSA Pod Security Standards and Pod Security Admission — the lesson that teaches this.

Question 12Kubernetes Security Fundamentals

In a namespace, no Pod may be blocked and developers must see no messages, but the security team wants every Pod that violates Restricted recorded for later review. Which namespace label meets this?

Choose one.

  • a
    pod-security.kubernetes.io/warn: restricted

    warn sends a user-facing warning to the client, which the developers must not see, and keeps no record.

  • b
    pod-security.kubernetes.io/audit: restricted Correct

    audit allows the Pod and adds an annotation to its event in the API server audit log, invisible to the developer.

  • c
    pod-security.kubernetes.io/enforce: restricted

    enforce rejects violating Pods, which breaks the requirement that nothing is blocked.

  • d
    pod-security.kubernetes.io/audit: privileged

    Nothing ever violates Privileged, so this records no violations at all.

The concept

Pod Security Admission has three modes: enforce rejects, audit records an annotation in the audit log, warn returns a warning to the user.

Why that’s the answer

Only audit mode both allows the Pod and records the violation without telling the client. warn is the near-twin that tells the user instead of recording; enforce blocks; and an audit label at the Privileged level never fires. Audit annotations appear only if the cluster has API server audit logging enabled.

How to reason it out
  1. Note the three requirements: no blocking, no user messages, a record kept.
  2. Map each mode to its effect.
  3. Pick audit at the Restricted level.

Exam tip: enforce blocks, warn tells the user, audit tells the audit log.

KCSA Pod Security Standards and Pod Security Admission — the lesson that teaches this.

Question 13Kubernetes Security Fundamentals

A namespace has only the label pod-security.kubernetes.io/warn: baseline. A developer creates a Pod that sets hostPID: true. What happens?

Choose one.

  • a
    The Pod is created and kubectl displays a warning about the violation Correct

    warn mode allows the Pod and returns a user-facing warning that kubectl prints.

  • b
    The Pod is rejected and kubectl displays an error about the violation

    Rejection is enforce mode's behaviour; this namespace sets only warn.

  • c
    The Pod is created and the violation is recorded in the audit log instead

    That is audit mode's behaviour; warn mode tells the user instead.

  • d
    The Pod is created after hostPID is changed to false by the controller

    Pod Security Admission never mutates a Pod; it only allows, rejects, warns or annotates.

The concept

warn mode allows a violating Pod and returns a warning to the client that made the request.

Why that’s the answer

hostPID: true violates Baseline, but the namespace only warns, so the API server admits the Pod and sends back a warning that kubectl displays. Rejection would need enforce, an audit annotation would need audit, and Pod Security Admission does not rewrite fields.

How to reason it out
  1. Identify which mode the label sets.
  2. Recall what warn does with a violation.
  3. Confirm that Pod Security Admission does not modify Pods.

Exam tip: warn = allowed plus a visible warning.

KCSA Pod Security Standards and Pod Security Admission — the lesson that teaches this.

Question 14Kubernetes Security Fundamentals

A namespace has these labels: enforce: baseline, warn: restricted and audit: restricted (all under pod-security.kubernetes.io/). A developer creates a Pod whose only issue is that it runs as user ID 0. What is the result?

Choose one.

  • a
    The Pod is rejected, because the strictest level set on the namespace applies to each mode

    Each mode is evaluated independently at its own level; enforce is set to Baseline, which allows user ID 0.

  • b
    The Pod is created with a kubectl warning but no audit annotation, as audit follows enforce

    Audit is evaluated on its own; it does not depend on the enforce result.

  • c
    The Pod is rejected by warn mode, because the Pod violates the Restricted level set for it

    warn never rejects; it returns a warning and lets the Pod through.

  • d
    The Pod is created, kubectl shows a warning, and the audit log event gets an annotation Correct

    The Pod passes the Baseline enforce check, but violates Restricted, so warn and audit both fire.

The concept

A namespace can set a different level for each mode, and each mode is evaluated independently.

Why that’s the answer

Running as root breaks only Restricted's non-root controls. enforce is at Baseline, so the Pod is admitted. warn and audit are at Restricted, so the developer sees a warning and the audit event carries a violation annotation. This combination (enforce one level, warn and audit the next level up) is the documented way to prepare for tightening a namespace.

How to reason it out
  1. Check the Pod against the enforce level: Baseline allows user ID 0.
  2. Check it against warn and audit: Restricted forbids user ID 0.
  3. Apply each mode's own effect independently.

Exam tip: Enforce the level you have, warn and audit the level you want next.

KCSA Pod Security Standards and Pod Security Admission — the lesson that teaches this.

Question 15Kubernetes Security Fundamentals

Which namespace label makes the built-in Pod Security admission controller reject Pods that do not meet the Baseline profile?

Choose one.

  • a
    pod-security.kubernetes.io/enforce: baseline Correct

    The label key names the mode (enforce) and the value names the level (baseline).

  • b
    pod-security.kubernetes.io/baseline: enforce

    Level and mode are swapped; the key names the mode and the value names the level.

  • c
    pod-security.kubernetes.io/enforce-version: baseline

    The -version label takes a Kubernetes minor version or latest, not a profile level.

  • d
    pod-security.kubernetes.io/warn: baseline

    warn admits violating Pods with a warning; it does not reject them.

The concept

Pod Security Admission is configured per namespace with labels of the form pod-security.kubernetes.io/<MODE>: <LEVEL>.

Why that’s the answer

The mode (enforce, audit or warn) is part of the label key and the level (privileged, baseline or restricted) is the value. An optional pod-security.kubernetes.io/<MODE>-version label pins which Kubernetes version's definition of the level is used.

How to reason it out
  1. Recall the label format: mode in the key, level in the value.
  2. Check which mode rejects Pods.
  3. Pick enforce: baseline.

Exam tip: pod-security.kubernetes.io/<mode>: <level>, plus an optional <mode>-version.

KCSA Pod Security Standards and Pod Security Admission — the lesson that teaches this.

Domain 4: Kubernetes Threat Model

16% of the KCSA exam, so 4 of the 25 questions on this page.

Question 16Kubernetes Threat Model

An attacker who gains root on a worker node wants a Pod that the kubelet keeps running even if the API server is unreachable. Where would the attacker place a manifest?

Choose one.

  • a
    In a ConfigMap that the kubelet reads from the kube-system namespace

    The kubelet does not run Pods from ConfigMaps; that would also depend on the API server being reachable.

  • b
    In the kubelet's static Pod directory on the node's local filesystem Correct

    The kubelet runs every manifest it finds in its configured static Pod path itself, without the API server or scheduler being involved.

  • c
    In a DaemonSet stored in etcd so that it runs on each node

    A DaemonSet is managed by a controller through the API server, so it depends on the control plane being reachable.

  • d
    In the container runtime's image cache on the node's local disk

    Cached images are not run by themselves; something must still ask the runtime to start a container.

The concept

Static Pods are a node-local persistence mechanism.

Why that’s the answer

The kubelet watches a directory (commonly /etc/kubernetes/manifests, set by staticPodPath) and runs any Pod manifest placed there, independently of the API server and scheduler. kubeadm uses this to run the control plane itself. For an attacker with node access it is a way to keep a workload running that the cluster's controllers did not create and cannot remove.

How to reason it out
  1. Note the requirement: runs without the API server.
  2. Recall which node agent can start Pods on its own.
  3. Identify the local path it watches.

Exam tip: Static Pods: manifests on the node's disk, run by the kubelet alone.

KCSA Kubernetes Trust Boundaries, Persistence and Denial of Service — the lesson that teaches this.

Question 17Kubernetes Threat Model

An administrator finds an unfamiliar Pod named metrics-agent-node-3 and runs kubectl delete on it. The deletion succeeds, but the Pod is listed as Running again moments later. No Deployment, ReplicaSet or DaemonSet owns it. What is the most likely explanation?

Choose one.

  • a
    The Pod is protected by a finalizer, so the delete is recorded and then reverted

    A finalizer delays removal and leaves the Pod terminating; it does not make a deleted Pod return as Running.

  • b
    The Pod is managed by a Job on node-3, which keeps restarting it until the task completes

    A Job would be named in the Pod's owner reference, and a Job does not tie its Pod to one node; a Pod named after its node and recreated with no workload owner is a mirror Pod.

  • c
    The Pod uses the default restart policy, so the kubelet restarts it after deletion

    The restart policy restarts containers inside an existing Pod; it does not bring back a deleted Pod object.

  • d
    The Pod is a mirror of a static Pod, and the kubelet on node-3 recreates the mirror Correct

    Deleting a mirror Pod does not stop the static Pod; the kubelet keeps it running from the manifest on disk and recreates its API representation.

The concept

Mirror Pods expose static Pods in the API but cannot control them.

Why that’s the answer

For each static Pod the kubelet creates a read-only mirror Pod on the API server. Deleting the mirror with kubectl does not remove the static Pod; the kubelet keeps it running and recreates the mirror. The only way to remove it is to delete its manifest from the node's static Pod directory, which is why static Pods are a favoured persistence technique after node compromise.

How to reason it out
  1. Note that no controller owns the Pod.
  2. Recall which Pods the kubelet manages from local manifests.
  3. Recall what deleting a mirror Pod actually does.

Exam tip: A Pod that returns with no owner points to a static Pod manifest on the node.

KCSA Kubernetes Trust Boundaries, Persistence and Denial of Service — the lesson that teaches this.

Question 18Kubernetes Threat Model

A tenant was allowed to run Pods with hostPath volumes. An attacker in that tenant mounted the node directory /etc/kubernetes and wrote a file there; now an unowned Pod keeps reappearing on that node after every kubectl delete. The tenant must keep deploying its normal workloads. Which response removes the foothold and stops it being rebuilt the same way?

Choose one.

  • a
    Delete the Pod with --force --grace-period=0, then cordon the node

    Force deletion still only removes the mirror Pod, and cordoning stops new scheduling but not the kubelet's static Pods.

  • b
    Delete the manifest from the node, then remove the tenant's Pod RBAC

    This stops the Pod, but taking away Pod creation entirely breaks the tenant's legitimate workloads when a policy blocking hostPath closes the actual path.

  • c
    Delete the manifest from the node, then add a ResourceQuota to the tenant

    Removing the file stops the static Pod, but a ResourceQuota limits resource amounts and object counts, not hostPath mounts, so the attacker can write a new manifest the same way.

  • d
    Delete the manifest from the node, then enforce Baseline on the tenant Correct

    Removing the file from the static Pod directory stops the kubelet running it, and Baseline Pod Security forbids hostPath volumes so the tenant cannot write there again.

The concept

hostPath write access to the static Pod directory turns a workload into node persistence.

Why that’s the answer

Two facts combine. First, the reappearing Pod is a static Pod: the kubelet runs manifests from its static Pod directory (under /etc/kubernetes/manifests here), and deleting the mirror Pod through the API never stops it, so the file must be deleted on the node. Second, the attacker got there through a hostPath mount; the Baseline Pod Security Standard disallows hostPath volumes, closing that route for the tenant without taking away ordinary Pod creation.

How to reason it out
  1. Recognise the unowned, self-recreating Pod as a static Pod.
  2. Remove it at the source: the manifest on the node.
  3. Find the control that blocks the hostPath route while keeping the tenant working.
  4. Reject options that only touch the API object or only limit resource amounts.

Exam tip: Static Pod persistence is removed on the node; hostPath is the door to close.

KCSA Kubernetes Trust Boundaries, Persistence and Denial of Service — the lesson that teaches this.

Question 19Kubernetes Threat Model

An attacker with permission to create workloads wants a malicious container on every node, including nodes added later by the autoscaler. Which object would achieve that?

Choose one.

  • a
    A DaemonSet whose Pod template tolerates each taint in the cluster Correct

    A DaemonSet runs one Pod on each eligible node and adds Pods automatically to new nodes; broad tolerations widen it to tainted nodes too.

  • b
    A Deployment with one replica for each node currently in the cluster

    A Deployment keeps a replica count; it neither guarantees one Pod per node nor follows new nodes.

  • c
    A StatefulSet with one replica for each node currently in the cluster

    A StatefulSet gives stable identities to a fixed number of replicas, not one per node.

  • d
    A CronJob that runs a Job each minute across the cluster's nodes

    A CronJob starts Jobs on a schedule; their Pods land wherever the scheduler places them, not on every node.

The concept

Workload controllers can be abused for persistence.

Why that’s the answer

A DaemonSet's controller makes sure an eligible node runs a copy of its Pod, including nodes that join later. That makes it a favoured persistence and reach mechanism for an attacker who can create workloads, especially with tolerations that also cover control plane taints. Audit logs that record DaemonSet creation, and tight RBAC on workload creation in kube-system, are the counters.

How to reason it out
  1. Note the requirement: every node, including future ones.
  2. Recall which controller is node-scoped rather than replica-scoped.
  3. Discard replica-count and schedule-based controllers.

Exam tip: One per node, including new ones: that is a DaemonSet.

KCSA Kubernetes Trust Boundaries, Persistence and Denial of Service — the lesson that teaches this.

Domain 5: Platform Security

16% of the KCSA exam, so 4 of the 25 questions on this page.

Question 20Platform Security

A CI pipeline signs every image it builds, but a developer still deploys an unsigned image from a public registry and it runs without complaint. What is missing?

Choose one.

  • a
    A registry scanner that checks the image for known vulnerabilities before Pods run

    Scanning finds CVEs; it does not check whether the image was signed by the pipeline.

  • b
    An admission policy that verifies image signatures before Pods are admitted Correct

    Signing only creates evidence; a policy such as Kyverno verifyImages or the Sigstore policy-controller must check it at deploy time for unsigned images to be blocked.

  • c
    An imagePullSecret that holds the registry credentials the pipeline used to push

    Pull credentials let the kubelet fetch private images; they do not reject unsigned public ones.

  • d
    A provenance attestation that the pipeline generates and attaches to each build

    More evidence from the pipeline does not help when nothing in the cluster checks for it.

The concept

Signing without verification enforces nothing.

Why that’s the answer

Kubernetes runs any image a Pod references unless something rejects it. To make signatures matter, an admission controller (a policy engine such as Kyverno or OPA Gatekeeper with an external data provider, or the Sigstore policy-controller) must verify the signature against the trusted identity or key and deny Pods that fail.

How to reason it out
  1. Notice the image ran despite having no signature.
  2. Ask which component decides whether a Pod is admitted.
  3. Choose deploy-time verification.

Exam tip: Sign in CI, verify at admission; one without the other does nothing.

KCSA Supply Chain Security, Image Registries and Admission Control — the lesson that teaches this.

Question 21Platform Security

An admission policy verifies the signature of the image tag a Pod references and then admits the Pod unchanged. Later the tag is re-pushed with an unsigned image, and Pods rescheduled onto new nodes run it. Which change closes this gap while keeping signature checks?

Choose one.

  • a
    Have the policy also set imagePullPolicy so each start pulls the verified tag

    Pulling on every start fetches the re-pushed tag even sooner, so it makes the gap wider.

  • b
    Have the policy also require AlwaysPullImages so the kubelet checks credentials

    AlwaysPullImages protects private images from tenants without credentials; it still pulls whatever the tag points to.

  • c
    Have the policy rewrite each admitted Pod's image to the digest it verified Correct

    Pinning the admitted Pod to the verified digest means every later pull fetches exactly the signed content, whatever happens to the tag.

  • d
    Have the registry rescan the verified tag each night for new vulnerabilities

    A nightly scan looks for CVEs, not signatures, and leaves a window in which the unsigned image runs.

The concept

Verify the tag, run the digest.

Why that’s the answer

Two facts combine: tags are mutable pointers, and admission checks the Pod once, when it is created. If the Pod keeps a tag, the kubelet resolves it again at every pull, so a re-pushed tag bypasses the earlier check. Signature-verifying policies therefore resolve the tag and mutate the Pod to the verified digest (Kyverno verifyImages does this by default with mutateDigest; the Sigstore policy-controller also resolves tags to digests). Forcing more pulls without pinning makes things worse.

How to reason it out
  1. Note admission saw the tag only once.
  2. Recall that a tag can point to different content later.
  3. Pin the admitted Pod to the exact content that was verified.

Exam tip: Signature policies should pin Pods to the verified digest.

KCSA Supply Chain Security, Image Registries and Admission Control — the lesson that teaches this.

Question 22Platform Security

A Pod's image is in a private registry that requires a login. How does the Pod spec give the kubelet the registry credentials it needs to pull the image?

Choose one.

  • a
    It sets the registry username and password as env variables on the container

    Container environment variables reach the application after it starts; the kubelet does not use them to pull the image.

  • b
    It mounts a ConfigMap holding the registry login into the container filesystem

    Files mounted into the container exist only after the image has been pulled, and a ConfigMap is not meant for credentials.

  • c
    It lists a Secret of type kubernetes.io/dockerconfigjson under imagePullSecrets Correct

    imagePullSecrets names Secrets holding registry credentials; the kubelet uses them when it pulls that Pod's images.

  • d
    It adds an annotation with the registry token to the Pod's metadata section

    Kubernetes has no annotation that supplies pull credentials, and annotations are not protected like Secrets.

The concept

Pull credentials go in imagePullSecrets.

Why that’s the answer

The kubelet pulls images before any container starts, so credentials must reach the kubelet, not the application. A Pod lists one or more Secrets of type kubernetes.io/dockerconfigjson (or the older dockercfg) in spec.imagePullSecrets; nodes can also get credentials from a kubelet credential provider plugin or node-level configuration.

How to reason it out
  1. Note who pulls the image: the kubelet, before the container starts.
  2. Find the Pod field meant for the kubelet's pull credentials.
  3. Reject options that reach only the running container.

Exam tip: imagePullSecrets is how a Pod hands registry credentials to the kubelet.

KCSA Supply Chain Security, Image Registries and Admission Control — the lesson that teaches this.

Question 23Platform Security

A Pod in namespace team-b sets imagePullSecrets to regcred and stays in ImagePullBackOff with an authentication error from the private registry. The Secret regcred exists in namespace team-a and works there. What is the most likely cause?

Choose one.

  • a
    Pull Secrets are resolved in the Pod's namespace, and team-b has no regcred Correct

    imagePullSecrets is resolved in the Pod's namespace, so a Secret in team-a is never found and the pull goes out without credentials.

  • b
    Pull Secrets in another namespace, such as team-a, need a RoleBinding first

    Pull Secrets are read by the kubelet for the Pod; no RoleBinding for the Pod is involved.

  • c
    The Pod needs to name the Secret as team-a/regcred to use it from team-a

    imagePullSecrets takes only a Secret name; there is no namespace-qualified form, so a Secret in another namespace can never be referenced.

  • d
    Pull Secrets for Pods in team-b need the type Opaque to hold a password

    Pull Secrets use the kubernetes.io/dockerconfigjson type; Opaque is not the expected type.

The concept

Secrets are namespaced, including pull Secrets.

Why that’s the answer

Every reference from a Pod to a Secret, including imagePullSecrets, is resolved in the Pod's own namespace. A Secret with the same name in another namespace is invisible, so the kubelet pulls without credentials and the registry rejects it. Creating regcred in team-b (ideally with credentials scoped to what team-b needs) fixes it.

How to reason it out
  1. Note the Secret works in team-a but not team-b.
  2. Recall that Secrets are namespace-scoped objects.
  3. Conclude the reference cannot cross namespaces.

Exam tip: A Pod can only reference Secrets in its own namespace.

KCSA Supply Chain Security, Image Registries and Admission Control — the lesson that teaches this.

Domain 6: Compliance and Security Frameworks

10% of the KCSA exam, so 2 of the 25 questions on this page.

Question 24Compliance and Security Frameworks

A kube-bench report marks several checks as [WARN] rather than [PASS] or [FAIL]. What does a WARN result usually mean?

Choose one.

  • a
    The check is a manual one, so a person needs to verify the setting Correct

    kube-bench reports manual recommendations, which it cannot decide automatically, as WARN so that someone reviews them.

  • b
    The setting fails at Level 2 but still passes the Level 1 profile

    kube-bench reports each check against the benchmark version it runs; it does not use WARN to mean a partial pass between levels.

  • c
    The setting passes today but fails in the next benchmark release

    kube-bench has no notion of future benchmark versions; it checks only the version it selected for the cluster.

  • d
    The node could not be reached, so kube-bench skipped this check on it

    kube-bench runs on the node it checks; an unreachable node would not produce a report for that node at all.

The concept

kube-bench result types.

Why that’s the answer

kube-bench runs the CIS checks for a chosen benchmark version and prints PASS, FAIL, WARN or INFO for each. Recommendations that the benchmark marks as manual, or whose outcome cannot be decided automatically, are reported as WARN with remediation text, and need a human to confirm. A clean run therefore still leaves WARN items to review.

How to reason it out
  1. Recall that some CIS recommendations are marked Manual.
  2. A tool cannot decide those, so it flags them for review.
  3. Map that review flag to WARN.

Exam tip: kube-bench WARN = check it yourself.

KCSA Compliance Frameworks, Threat Modeling and Supply Chain Compliance — the lesson that teaches this.

Question 25Compliance and Security Frameworks

A team wants kube-bench to check the kubelet configuration files and process flags on each worker node of a running cluster. How is kube-bench normally run for this?

Choose one.

  • a
    As a Deployment that asks the API server for each node's kubelet flags and files

    The API server does not expose a node's kubelet config files or process arguments, so a Pod that only talks to the API cannot run these checks.

  • b
    As an admission webhook that inspects each Node object when the node registers

    Node objects carry status and labels, not the kubelet's files and flags, and a webhook only sees API requests.

  • c
    As a kubectl plugin that reads the node settings from each Node's status fields

    kube-bench needs host-level access; Node status shows capacity and conditions, not file permissions or process flags.

  • d
    As a Job on the node with hostPID and the host's config paths mounted read-only Correct

    kube-bench inspects files and running processes on the host itself, so its Job uses the host PID namespace and mounts directories such as /etc/kubernetes and /var/lib/kubelet.

The concept

kube-bench checks the host, so it must run with host access.

Why that’s the answer

CIS node checks look at file ownership and permissions and at the arguments of the running kubelet. kube-bench therefore runs on the host, usually as a Kubernetes Job (one per node type) with hostPID: true and hostPath mounts of the Kubernetes and kubelet directories, or directly as a binary on the node. Anything that only sees API objects cannot read those details.

How to reason it out
  1. Ask what is being checked: files and processes on the host.
  2. Ask what can see them: something running on that host.
  3. Pick the option with host PID and host paths, not API-only access.

Exam tip: Node CIS checks need host access: kube-bench Job with hostPID and host mounts.

KCSA Compliance Frameworks, Threat Modeling and Supply Chain Compliance — the lesson that teaches this.

Keep going with KCSA

KCSA practice by domain

KCSA sample questions: your questions

No. Real exam questions are confidential. These are original questions written to the skills in the official KCSA exam guide, so they test the same knowledge in the same style without being copies of the exam.

Source

The domains and weights on this page come from the official KCSA exam guide.