skip to content

In a Kubernetes hardening benchmark, how do you tell an item that removes a technique from one that only narrows it?

level: middleimportance: should knowfreq 50%

answer

  1. name the technique before the item
  2. what does it consume?
  3. can the adversary substitute anything?
  4. asking for slightly less means narrowing
  5. four buckets, one count each

basics

~20 s

Name the technique, name what it consumes, then ask whether that thing still exists after the item is applied. If the adversary can substitute something or simply ask for slightly less, the item narrows. If there is no remaining path without first obtaining something new, it removes.

solid answer

~50 s

I apply one test per item: what does the technique consume, and does it still exist afterwards? Disabling anonymous authentication on the node agent is a removal — an unauthenticated caller on the node network has no path to the exec endpoint at all, and there is nothing to substitute; they must first obtain a credential, which is a different technique with its own cost. Requiring workloads to run as a non-root user is a narrowing — an adversary who already has code running in the container keeps the mounted service-account credential and outbound network access, and only loses the root-only actions inside that container. Then there are two more buckets people forget: items that remove nothing any adversary does, like ownership on control-plane files in an estate whose control plane you cannot log into, and items your distribution's default already satisfied for several releases. All four count the same toward the percentage.

code

text · 8 lines
text
item                                  what the adversary loses            verdict
------------------------------------  ----------------------------------  ---------------------------
node agent: anonymous auth disabled   unauthenticated exec on that node   REMOVES (must get a credential first)
workloads must run as non-root        root-only actions in the container  NARROWS (token + egress intact)
ownership 0600 on control-plane file  nothing, on a control plane you     REMOVES NOTHING HERE
                                      do not operate
setting shipped as default, 3 releases nothing, it was never otherwise    ALREADY SATISFIED (cost 0)
...

go deeper

for a junior

Know the two clear cases: switching off an unauthenticated path takes the technique away, while forcing a container to run as a non-root user only limits what an intruder can do once inside it.

for a middle

Be ready to run the test aloud on an item you are handed — name the technique, name what it consumes, then say whether anything substitutes. Interviewers are listening for that ordering, not for the standard's section numbers.

for a senior

Demonstrate that the verdict depends on the estate and the adversary's starting position, and that you keep a named list of the items you treat as load-bearing for your own clusters rather than deferring to the standard's ordering.

for a principal

Own how that sort is kept honest across many teams: who is allowed to declare an item non-applicable for an estate, and how you stop the sort from becoming a way to argue away work nobody wants to do.

## The test Every item in a hardening standard can be sorted with the same three-step test, and it is worth doing out loud in an interview because it shows you reason about the adversary rather than the list. 1. **Name the technique.** Not "attacks" — a specific thing somebody does: run a command inside a container on a node without holding any credential; use a container's own identity to talk to the cluster API; schedule a workload that mounts the host filesystem. 2. **Name what it consumes.** Every technique consumes something: a reachable unauthenticated endpoint, a credential that was handed to the process, an admission path that accepts the object being asked for. 3. **Ask whether that thing still exists after the item is applied, and whether anything substitutes for it.** If nothing substitutes and the adversary must first obtain something they do not have, the item **removes**. If they keep going at slightly higher cost, or by asking for slightly less, it **narrows**. ## Removal, worked The node agent on each Kubernetes node serves an HTTPS API that can list the pods on that node, stream container logs and execute commands inside containers. Left with anonymous authentication enabled and a permissive authorization mode, that API answers a caller who presents nothing at all. An adversary who can route to the node's port has, at that point, command execution inside every container on the node. Turn anonymous authentication off and the technique has no remaining path. There is no weaker variant of "present nothing" — the caller must first acquire a credential the API will accept, which is a different technique, with its own prerequisite and its own cost. This is what load-bearing means: the item removes the thing the technique cannot substitute. Note also that this is the item most likely to already pass, because common provisioning tooling ships it disabled. Load-bearing and already-satisfied are not opposites; the item is still the roof, you simply did not build it. ## Narrowing, worked An item requiring containers to run as a non-root user reads like a big change and often is not. Consider an adversary who already has code executing in a container. What do they lose? The root-only actions inside that container: installing packages, writing to system paths in the image, some privileged operations against the runtime. What do they keep? Everything the technique they care about consumes — the service-account credential mounted into the pod, the ability to make outbound connections, the ability to read whatever the application could read. The technique "use this workload's own identity against the cluster API" is untouched, because it never needed root. That is narrowing: the adversary pays a little more, or asks for slightly less, and continues. The same shape shows up whenever a policy constrains a *request* rather than an *ability*. A workload owner who is told they may not have a privileged container frequently comes back with a request for the narrower thing they actually needed, it is admitted, and the technique that mattered survives the negotiation. ## The two buckets nobody counts - **Removes nothing any adversary does.** Items about file ownership on control-plane nodes are meaningful if you run those nodes and meaningless if your control plane is operated by somebody else and you have no shell on it. Items about naming, paths or optional components you never installed are in the same bucket. They exist because the standard must apply to every reader. - **Already satisfied by the shipped default.** These pass on day zero. They are worth keeping, because a default can change and drift is real, but they are not a change in exposure and must not be presented as one. ## Why the sort matters Because the score does not do it for you. The list is unweighted: a removal, a narrowing, an irrelevance and a freebie each contribute one item. Any conversation that starts from the percentage rather than from the sort will get the estate's priorities wrong in whichever direction the arithmetic happens to point. ## The trap in the test Be careful about declaring removal from the item's wording rather than from the adversary's position. "Turn off automatic mounting of the service-account credential into pods" sounds like a removal, and it is one for an adversary whose whole plan was to read that credential out of the filesystem. It is nothing at all if the identity in question was never granted anything useful, and it is only a narrowing if the same workload obtains a credential another way. The verdict is a property of the item *and* the estate *and* the adversary's starting position — never of the item alone.

  • Give an item that is a removal in one estate and an irrelevance in another.
    Ownership and permissions on control-plane configuration files. If you run your own control-plane nodes, that item constrains what an adversary with a shell on one of them can rewrite. If your control plane is operated for you and nobody on your side has a shell there, the same item removes nothing you were exposed to — and it still passes or fails as one item.
  • Does turning off automatic mounting of a workload's service-account credential remove a technique?
    It depends on what that identity could do. For an adversary whose plan was to read the credential out of the pod's filesystem and call the cluster API, it removes the path. If the identity was granted nothing useful, it removes nothing that mattered; if the workload obtains a credential by another route, it only narrows. The verdict belongs to the item plus the estate, never the item alone.
  • Why is 'the adversary just asks for slightly less' the signature of a narrowing?
    Because the control is constraining a request rather than an ability. A workload owner refused a privileged container usually returns with the narrower capability or mount they actually needed, is admitted, and the technique survives. A removal has no such negotiation available — there is no weaker version of presenting no credential at all.

saying these in an interview costs you the question

  • Sorts items by the standard's own severity wording
  • Calls any policy that blocks something a removal
  • Forgets that shipped defaults pass without any work
  • Judges the item without naming the technique first
  • Assumes non-root execution stops a workload-identity technique

context