skip to content

Your admission rule needs data from other cluster objects: should the engine get a standing cluster-wide read?

level: principalimportance: nice to knowfreq 30%

answer

  1. two channels: pushed and pulled
  2. requests carry no cluster state
  3. ship the data as configuration
  4. detective check with its own credential
  5. is the rule worth the credential

basics

~20 s

Only if the rule is worth the credential. An admission request carries no other object, so the engine must fetch state itself, and a standing cluster-wide read turns the enforcement plane into a cross-namespace reader and an escalation target.

solid answer

~50 s

Start by naming the two privilege channels the engine already has: the push, meaning every object body its match rules cause the API server to send it, and the pull, meaning whatever its own credentials let it fetch. Rules that need context — an approved-image list, an ownership registry, what else exists in the namespace — create pressure to widen the pull, because an admission request carries only the object under review. Before granting it, ask whether the data can ship as rule configuration the engine already holds, accepting some staleness; whether a live read can be scoped to specific resources and namespaces, read-only; and whether the check belongs at admission at all rather than in a detective check that runs afterwards with its own credentials. Then weigh what the rule actually prevents against a single deployment that can read the cluster and inject into every matched workload.

go deeper

for a junior

Remember the core fact behind the question: an admission request contains the object being reviewed and little else, so a rule needing other objects has to get that data from somewhere the engine already has.

for a middle

Be able to distinguish the two channels — what the API server pushes because of the match, and what the engine pulls with its own credentials — and explain why the first is unaffected by the second.

for a senior

Show how you would scope a real request: enumerate what each rule needs, prefer data shipped as configuration, keep live reads read-only and resource-scoped, and say what staleness you accept.

for a principal

Own the call. Weigh what a rule prevents against making the enforcement plane a cross-namespace reader, decide what moves to a detective check, and be explicit about who owns and reviews a workload with this much reach.

## Two channels, not one An in-cluster policy engine holds power along two independent paths: - **Push** — every object body the API server sends it because its match rules selected the request. This is unaffected by the engine's own permissions and is bounded only by the match. - **Pull** — whatever the engine's own API credentials let it fetch on its own initiative. Most reviews only look at the second, because that is the one that appears in a configuration file. The first is invisible unless someone reads the match rules as a privilege statement. ## Why the pull channel keeps growing An admission request carries the object under review, the previous version on an update, and who asked — and nothing else. No other object, no cluster state, no history. So the moment a rule needs context, it cannot be answered from the request. "Is this image on the organisation's approved list?" "Does this team already own this hostname?" "Has this namespace exhausted its allocation?" Every one of those pushes an author toward giving the engine a client and a read role, and because it is tedious to enumerate what each rule needs, the read granted is usually broad. The result is a single deployment that receives every matched object body *and* can read the rest of the cluster on demand. Compromise it and you have both. And it is the component least likely to be questioned, because it is the component that does the questioning. ## A decision framework **1. Can the data travel with the rules instead of being queried?** An approved-registry list, an ownership map, a set of exempted namespaces — these change slowly. Delivered as configuration the engine already holds, the rule needs no read at all. The cost is staleness: ask how long a wrong answer is tolerable. For most policy inputs, minutes or hours is fine. **2. If it must be live, how narrow can the read be?** Read-only, specific resource types, specific namespaces where possible, never write. A rule that needs one resource type does not justify a credential that reads everything. **3. Does the check belong at admission at all?** Admission is the wrong place for anything requiring a broad view of the cluster: it is synchronous, it is on the critical path of every matched request, and the request gives it no context by design. The same check running after the fact — reading state on its own schedule, reporting rather than blocking — can hold its own scoped credential and does not put a cluster-wide reader in the request path. You trade prevention for detection, which is sometimes the right trade and should be an explicit one. **4. What does the rule actually prevent?** This is the question that usually settles it. If the rule closes a path an attacker realistically takes, the credential may be worth it. If it enforces a convention, it is not worth turning the enforcement plane into a cross-namespace reader. ## The organisational layer Whoever operates this engine holds a cluster-wide read and, if it mutates, a cluster-wide injection primitive. That should place it in the same review category as any other highly privileged workload: named owners, a change process for what it enforces, a supply chain for its own image, and an upgrade path someone is accountable for. It also argues for splitting responsibilities — the component that detects drift should not be the component that can cause it. One framing to keep out of the discussion: that narrowing the match, or the read, is about performance. It is occasionally true and always beside the point. Both are the boundary of what a single compromised deployment can reach, and they should be argued and reviewed on those terms.

  • Why can't the rule just read the other object from the admission request?
    Because it is not there. The request carries the object under review, its previously stored version on an update, the requester's identity and a few request attributes — no other object, no cluster state, no history. Anything comparative has to come from data the engine already holds or from a call it makes itself.
  • A team asks for the engine to hold a cluster-admin-equivalent credential so the rules just work. What do you say?
    No, and explain the compounding: it already receives every object its match selects, so adding broad read and write means compromising one deployment compromises the cluster in both directions. Enumerate what each rule genuinely needs, grant read-only on those resource types, and drop rules whose cost outweighs what they prevent.
  • How do you decide between blocking at admission and checking afterwards?
    By what the check needs and what a miss costs. If it is decidable from the request and a violation is unacceptable in the cluster, block. If it needs a broad view of state, run it as a separate reader afterwards with its own scoped credential and accept detection instead of prevention — an explicit trade, recorded, not a silent gap.

saying these in an interview costs you the question

  • Treats the engine as plumbing rather than a privileged workload
  • Grants broad read because it made rule authoring easier
  • Believes an admission request can query cluster state by default
  • Argues narrow match rules are only a performance concern
  • Never considers moving the check out of the request path

context