Skip to content

Kubernetes Trust Boundaries and Data Flow: KCSA practice questions

A trust boundary is a point where data or control passes between parts of a system that trust each other to different degrees, and threat modelling Kubernetes starts by drawing them.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Kubernetes Trust Boundaries and Data Flow covers in KCSA

A trust boundary is a point where data or control passes between parts of a system that trust each other to different degrees, and threat modelling Kubernetes starts by drawing them. The CNCF Financial Services User Group threat model, for example, began with workshops that walked through each component of the architecture with the STRIDE methodology to find security issues at the trust boundaries of the platform, using a reference cluster of one master node backed by etcd and three worker nodes.

The central boundary is the API server. Kubernetes follows a hub-and-spoke API pattern: all API usage from nodes and from the Pods they run terminates at the API server, and none of the other control plane components are designed to expose remote services. Every request crosses the same sequence of checks. TLS protects the transport, authentication modules identify the caller or the request fails with status 401, authorization modules decide whether the action is permitted or the request fails with 403, and admission controllers may modify or reject requests that create, modify, delete or connect to objects, though they do not act on requests that only read them.

Traffic from nodes to the control plane is secured by default. Kubelets should hold the cluster's public root certificate and a client certificate, and Pods receive a root certificate and a service account bearer token so they can reach the API server through the kubernetes Service in the default namespace. The reverse direction is weaker. Connections from the API server to the kubelet, used for logs, attach and port-forwarding, do not verify the kubelet's serving certificate unless --kubelet-certificate-authority is set, and connections through the API server proxy to nodes, Pods and Services are plain HTTP by default. SSH tunnels that once protected these paths are deprecated; the Konnectivity service replaces them, with agents in the node network opening connections to a server in the control plane network.

Some data flows skip the API server's controls entirely, and the documentation lists them so they can be restricted. Direct access to etcd on TCP 2379 is neither subject to admission control nor recorded in audit logs, and a certificate from any CA that etcd trusts grants full access to its data; only the API server and backup tooling need that port. The kubelet API, typically on TCP 10250, can disclose Pod details and logs and execute commands in every container on the node, again outside admission and audit. Static Pods are loaded by the kubelet from a directory or URL the API server does not manage, and one that fails admission control still runs on its node. Access to the container runtime socket lets an attacker start or control containers directly.

Inside the cluster, namespaces are the usual tenancy line, but they are not strong on their own. A Pod can run as any ServiceAccount in its namespace and mount the Secrets, ConfigMaps and volumes there, so the RBAC good-practices guide advises treating boundaries within a namespace as weak and placing resources that need different levels of trust in separate namespaces.

Key points

  • Admission controllers see create, update, delete and connect requests, never plain reads.
  • Without --kubelet-certificate-authority, API server to kubelet connections are open to man-in-the-middle attacks.
  • Direct etcd (2379) and kubelet API (10250) access both bypass admission control and audit logging.
  • Konnectivity agents dial out from the node side; SSH tunnels are deprecated.

Three sample questions

15 KCSA questions on Kubernetes Trust Boundaries and Data Flow, 15 with explanations. How practice works

Question 1

Which of the following actions in Kubernetes cross trust boundaries and potentially introduce security risks? (Select all that apply)

Select all that apply.

  1. A.Communicating between pods within the same namespace
  2. B.Mounting hostPath volumes into pods
  3. C.Using service accounts across different namespaces
  4. D.Pulling container images from public registries

Correct answers: B, C, D

Mounting hostPath volumes allows pods to access the host filesystem, crossing the boundary between container and host, which poses significant security risks. Using service accounts across namespaces can bypass namespace isolation, potentially escalating privileges. Pulling images from public registries introduces risks from untrusted or malicious images. Pod-to-pod communication within the same namespace is generally within the same trust boundary and less risky.

Sources: Kubernetes Official Documentation - Security Best Practices, CNCF Cloud Native Security Whitepaper

Question 2

In the STRIDE threat modeling framework, what does the letter 'S' represent?
  1. A.Spoofing
  2. B.Scanning
  3. C.Snooping
  4. D.Sniffing

Correct answer: A

In STRIDE, a widely used threat modeling framework, 'S' stands for Spoofing, which refers to an attacker pretending to be someone or something else to gain unauthorized access. The other options like scanning, snooping, and sniffing are related to security but are not part of the STRIDE categories.

Sources: Microsoft STRIDE Threat Model, OWASP Threat Modeling

Question 3

In the STRIDE threat modeling framework, what does 'Repudiation' refer to?
  1. A.Unauthorized access
  2. B.Denial of an action or event
  3. C.Data leakage
  4. D.Service unavailability

Correct answer: B

'Repudiation' in STRIDE refers to the ability of an attacker or user to deny having performed an action or event, which can hinder accountability and auditing. It is distinct from unauthorized access (spoofing), data leakage (information disclosure), and service unavailability (denial of service).

Sources: Microsoft STRIDE Threat Model, OWASP Threat Modeling

Practice this topic

Focus mode keeps every question on Kubernetes Trust Boundaries and Data Flow until you leave it. 10 free guest answers, then a free account; no credit card.

Or open KCSA practice across all topics.

Sources

The explanation above was checked against these official documents.

Frequently asked questions

Is it safe to use the API server proxy to reach a Pod over an untrusted network?

No. Those connections default to plain HTTP. Prefixing https: to the target name encrypts them, but the endpoint certificate is not validated and no client credentials are sent, and the documentation says they are not currently safe over untrusted or public networks.