Question 816 of 997
Monitoring, Logging and Runtime SecuritymediumMultiple ChoiceObjective-mapped

Immediate Pod Network Isolation — Label and NetworkPolicy

This CKS practice question tests your understanding of monitoring, logging and runtime security. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are responding to a security incident where a pod named `compromised-pod` in namespace `default` is suspected of being used for cryptocurrency mining. You need to immediately isolate the pod from the network while preserving evidence. Which command sequence should you use?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "which command"

    Why it matters: Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

  • Clue: "immediately / without restart"

    Why it matters: Time or reboot constraint — the correct answer must take effect right away without requiring a reboot or reload.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

kubectl run temp-pod --image=busybox --restart=Never -- /bin/sh -c 'kubectl label pod compromised-pod isolated=true' && kubectl apply -f networkpolicy.yaml that selects pod with label isolated=true and denies all traffic

Option B describes the correct conceptual approach: label the pod and apply a deny-all NetworkPolicy. However, the command as written is invalid because the busybox container does not have kubectl installed. In practice, you would run 'kubectl label pod compromised-pod isolated=true' directly from your terminal, then apply the NetworkPolicy. Despite the command flaw, the underlying method is the standard containment technique for pod network isolation.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • kubectl cordon <node-of-compromised-pod>

    Why it's wrong here

    Cordoning a node prevents new pods from being scheduled but does not isolate existing pods; the compromised pod retains network access. This is incorrect.

  • kubectl run temp-pod --image=busybox --restart=Never -- /bin/sh -c 'kubectl label pod compromised-pod isolated=true' && kubectl apply -f networkpolicy.yaml that selects pod with label isolated=true and denies all traffic

    Why this is correct

    This option correctly identifies the need to label the pod and apply a deny-all NetworkPolicy. The command sequence is impractical (busybox lacks kubectl), but the concept is what the exam tests. In a real scenario, you would label the pod directly and then apply the policy.

    Clue confirmation

    The clue words "which command&quot;, &quot;immediately / without restart" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • kubectl delete pod compromised-pod && kubectl describe pod compromised-pod

    Why it's wrong here

    Deleting the pod destroys the running container and filesystem, losing forensic evidence. It does not isolate the network for any remaining artifacts.

  • kubectl exec compromised-pod -- killall miner-process

    Why it's wrong here

    Executing killall inside the pod stops the miner process but does not prevent it from restarting, and it does not cut off network communication to mining pools. Network isolation is required.

Common exam traps

Common exam trap: answer the scenario, not the keyword

In the CKS exam, a common trap is confusing node-level controls (cordon, drain) with pod-level network isolation (NetworkPolicy). Candidates may think cordoning a node isolates the pod, or that deleting the pod is sufficient containment, but deleting destroys forensic evidence.

Detailed technical explanation

How to think about this question

NetworkPolicies in Kubernetes use iptables or eBPF (depending on the CNI plugin) to enforce rules at the pod network interface. A policy with `podSelector: matchLabels: {isolated: 'true'}` and empty `ingress`/`egress` rules (or `- {}` to deny all) creates a default-deny stance for that pod, overriding any allow-all default. In a real-world incident, you would also capture a memory dump and collect logs before applying the policy, but the immediate isolation step is critical to prevent data exfiltration or further resource abuse.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A security administrator must allow nursing staff to reach a patient records server while blocking access from the guest Wi-Fi VLAN. After applying an extended ACL, traffic is still blocked from nursing workstations. The ACL was applied outbound instead of inbound on the wrong interface. Questions like this test ACL direction and placement rules.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related CKS practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free CKS practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this CKS question test?

Monitoring, Logging and Runtime Security — This question tests Monitoring, Logging and Runtime Security — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: kubectl run temp-pod --image=busybox --restart=Never -- /bin/sh -c 'kubectl label pod compromised-pod isolated=true' && kubectl apply -f networkpolicy.yaml that selects pod with label isolated=true and denies all traffic — Option B describes the correct conceptual approach: label the pod and apply a deny-all NetworkPolicy. However, the command as written is invalid because the busybox container does not have kubectl installed. In practice, you would run 'kubectl label pod compromised-pod isolated=true' directly from your terminal, then apply the NetworkPolicy. Despite the command flaw, the underlying method is the standard containment technique for pod network isolation.

What should I do if I get this CKS question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "which command", "immediately / without restart". Tests specific CLI syntax. Recall the exact command and its required context — near-synonyms and partial matches are common distractors.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More CKS practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.