SyntaxPilot
Courses/Cybersecurity Fundamentals/Lesson 68
Video coming soonThis lesson’s video is being made

Start with the notes below; the video appears here as soon as it is on YouTube.

Cybersecurity Fundamentals · Lesson 68 of 90

Kubernetes security

Kubernetes architecture (control plane, API server, etcd, kubelet)Kubernetes RBACservice accountsnamespacesnetwork policiesPod Security Standards (privileged, baseline, restricted)admission controllersKubernetes Secrets and encryption at restruntime security (Falco concept)CIS Kubernetes Benchmarkservice mesh and mTLS

These are the notes for Cybersecurity Fundamentals (defensive), episode 68. In episode 67 we locked down a single container. Real systems run thousands of containers on hundreds of machines, managed by Kubernetes. This episode explains how Kubernetes works and then secures it piece by piece: who may use it, what programs inside it may do, which pods may talk to which, how pods are checked before they start, where secrets live, and how attacks are caught while they run. Every term is defined the first time it appears; the Glossary collects them.

Scope. Defensive and educational only. Every program is a small toy simulation; no real cluster is touched; passwords and keys are fake; 203.0.113.9 is an address reserved for documentation. Samples were run on 13 Nov 2026 in the SyntaxPilot compiler (Python 3.13).

Step 1: how Kubernetes works

Real-life example: an airport. The control tower decides who lands where (control plane); every message goes over the tower's radio (API server); the flight records book holds the truth (etcd); ground crew at each gate service the planes (kubelet on each node); the planes carry passengers (pods).

  • Container orchestrator: software that decides where containers run, restarts them when they crash, scales them up and down, and connects them. Kubernetes (often written K8s) is the most widely used one.
  • Cluster: the whole group of machines Kubernetes manages.
  • Node: one machine (physical or virtual) in the cluster that runs workloads.
  • Pod: the smallest thing Kubernetes runs: one or more containers that are scheduled together and share a network address.
  • Control plane: the brain of the cluster. The Kubernetes documentation lists its parts:
  • kube-apiserver (API server): "The core component server that exposes the Kubernetes HTTP API." Every request, from people, tools, nodes and the control plane's own parts, goes through it.
  • etcd: "Consistent and highly-available key value store for all API server data." It holds the cluster's whole state, including Secrets.
  • kube-scheduler: "Looks for Pods not yet bound to a node, and assigns each Pod to a suitable node."
  • kube-controller-manager: "Runs controllers to implement Kubernetes API behavior" (loops that keep the real state matching the desired state).
  • On every node:
  • kubelet: "Ensures that Pods are running, including their containers."
  • kube-proxy: "Maintains network rules on nodes to implement Services."
  • Container runtime: "Software responsible for running containers" (for example containerd).
  • API (application programming interface): a defined way for programs to make requests; here, an HTTP API (episode 21).
  • First rule: protect the API server (strong authentication, never exposed openly to the internet, audit logging) and etcd (encrypted, reachable only by the API server and cluster admins). Whoever controls them controls everything.

Step 2: who may do what, RBAC

  • Authentication vs authorization (episode 2): proving who you are vs deciding what you may do. RBAC is authorization.
  • cluster-admin: a built-in role with full power everywhere. Giving it to every developer means one stolen laptop can delete production.

Demo 1: a toy RBAC check

# A toy Kubernetes RBAC check: is THIS user allowed THIS verb on THIS resource here?
roles = {   # Role: a list of allowed (verbs, resources)
  "dev-editor":   [({"get", "list", "create", "delete"}, {"pods", "deployments"})],
  "prod-viewer":  [({"get", "list"}, {"pods", "deployments"})],
}
bindings = [  # RoleBinding: who gets which role, in which namespace
  ("neha", "dev-editor", "dev"),
  ("neha", "prod-viewer", "prod"),
]
def allowed(user, verb, resource, ns):
    return any(u == user and n == ns and verb in verbs and resource in res
               for u, role, n in bindings for verbs, res in roles[role])

for req in [("neha", "delete", "pods", "dev"),
            ("neha", "delete", "pods", "prod"),
            ("neha", "get", "secrets", "prod"),
            ("ravi", "get", "pods", "dev")]:
    print(f"{' '.join(req):30}", "ALLOW" if allowed(*req) else "DENY (403 Forbidden)")

Output:

neha delete pods dev           ALLOW
neha delete pods prod          DENY (403 Forbidden)
neha get secrets prod          DENY (403 Forbidden)
ravi get pods dev              DENY (403 Forbidden)
  • RBAC (role-based access control): permissions are attached to roles, and roles are given to users or groups.
  • Verb: the action: get, list, watch, create, update, patch, delete.
  • Resource: the kind of object: pods, deployments, secrets, configmaps...
  • Role: a list of allowed verbs on resources inside one namespace. RoleBinding: gives a Role to a user, group or service account in that namespace.
  • ClusterRole / ClusterRoleBinding: the same, but for the whole cluster. Hand these out rarely.
  • 403 Forbidden: the HTTP status code for "you are known, but not allowed" (episode 21).
  • Namespace (Kubernetes): a named area that splits one cluster into parts (dev, prod, payments). Roles, policies and quotas apply per namespace. It is not the Linux namespace of episode 67, which isolates a process's view.
  • The Kubernetes documentation warns: "Granting list access to Secrets implicitly lets the subject fetch the contents of the Secrets." Treat list and watch on Secrets like get.

A real Role and RoleBinding (YAML):

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: {namespace: prod, name: prod-viewer}
rules:
- apiGroups: ["", "apps"]
  resources: ["pods", "deployments"]
  verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: {namespace: prod, name: neha-prod-viewer}
subjects:
- kind: User
  name: neha
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: prod-viewer
  apiGroup: rbac.authorization.k8s.io

Demo 2: a stolen service account token

  • Service account: an identity for a program (not a person) running in a pod. Its token (a credential string, like the bearer tokens of episode 31) is placed inside the pod so the app can call the API.
# A pod gets hacked. What can its service account token do with the API?
SECRETS = {"db-password": "Fake-Pa55", "payment-key": "fake-key-123"}
accounts = {   # someone bound 'default' to cluster-admin "to make it work"
  "default, cluster-admin": {"secrets": {"get", "list"}, "pods": {"create"}},
  "shop-sa, least privilege": {"configmaps": {"get"}},
}
def api(account, verb, resource):
    return verb in accounts[account].get(resource, set())

for acct in accounts:
    print(f"token of {acct}:")
    if api(acct, "list", "secrets"):
        print("   list secrets ->", ", ".join(f"{k}={v}" for k, v in SECRETS.items()))
    else:
        print("   list secrets -> 403 Forbidden")
    print("   create pods  ->", "ALLOW" if api(acct, "create", "pods") else "403 Forbidden")

Output:

token of default, cluster-admin:
   list secrets -> db-password=Fake-Pa55, payment-key=fake-key-123
   create pods  -> ALLOW
token of shop-sa, least privilege:
   list secrets -> 403 Forbidden
   create pods  -> 403 Forbidden
  • Least privilege (episode 3): one dedicated service account per app, with only the verbs and resources it needs.
  • automountServiceAccountToken: false: if an app never calls the Kubernetes API, don't put a token in its pod at all.

Step 3: who may talk to whom, network policies

The Kubernetes documentation: "By default, a pod is non-isolated for egress; all outbound connections are allowed" and "non-isolated for ingress; all inbound connections are allowed." "If no policies exist in a namespace, then all ingress and egress traffic is allowed to and from pods in that namespace."

  • Ingress / egress: incoming / outgoing traffic.
  • Flat network: every machine can reach every other; one break-in reaches everything.

Demo 3: a toy network policy check

# Which pod may talk to which? Default Kubernetes: everyone to everyone.
pods = ["frontend", "api", "orders-db", "payroll-db"]
policies = {   # after: default deny + explicit allows (ingress rules)
  "api":       {"frontend"},
  "orders-db": {"api"},
  "payroll-db": set(),          # only the payroll namespace, not shown
}
def can_reach(src, dst, enforce):
    if not enforce: return True               # no NetworkPolicy: all allowed
    return src in policies.get(dst, set())    # default deny for selected pods

for enforce in (False, True):
    print("with default-deny policies:" if enforce else "no policies:")
    for dst in pods[1:]:
        ok = can_reach("frontend", dst, enforce)
        print(f"   hacked frontend -> {dst:10}", "open" if ok else "blocked")

Output:

no policies:
   hacked frontend -> api        open
   hacked frontend -> orders-db  open
   hacked frontend -> payroll-db open
with default-deny policies:
   hacked frontend -> api        open
   hacked frontend -> orders-db  blocked
   hacked frontend -> payroll-db blocked
  • NetworkPolicy: a Kubernetes object that acts like a firewall for pods: which pods (selected by labels) may receive traffic from which pods, namespaces or IP ranges, on which ports.
  • Default deny: a policy that selects all pods (podSelector: {}) and allows nothing, so every path must be allowed explicitly. This is microsegmentation (episode 24).
  • Label: a key-value tag on an object (app: frontend) used to select it.
  • Catches from the documentation: your cluster "must use a network plugin that supports NetworkPolicy enforcement", or policies are ignored; and "a default deny-all egress policy also blocks DNS traffic", so allow DNS explicitly.

The default-deny policy from the Kubernetes documentation, and one allow rule:

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-all
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata: {name: api-from-frontend}
spec:
  podSelector: {matchLabels: {app: api}}
  ingress:
  - from:
    - podSelector: {matchLabels: {app: frontend}}
    ports:
    - {protocol: TCP, port: 8080}

Step 4: checking pods at the gate

RBAC decides who may create a pod. It does not look inside the pod. A user allowed to create pods could create a privileged one.

Demo 4: a toy admission controller

# A toy admission controller: check each pod BEFORE it is stored and started.
def restricted(pod):        # a few checks from the 'restricted' standard
    c = pod["securityContext"]
    problems = []
    if c.get("privileged"):                  problems.append("privileged=true")
    if pod.get("hostNetwork"):               problems.append("hostNetwork=true")
    if not c.get("runAsNonRoot"):            problems.append("runAsNonRoot must be true")
    if c.get("capabilities_drop") != ["ALL"]: problems.append("must drop ALL capabilities")
    if c.get("seccomp") not in ("RuntimeDefault", "Localhost"):
        problems.append("seccomp must be RuntimeDefault")
    return problems

pods = {
  "debug-tool": {"hostNetwork": True, "securityContext": {"privileged": True}},
  "shop":       {"securityContext": {"runAsNonRoot": True, "capabilities_drop": ["ALL"],
                                     "seccomp": "RuntimeDefault"}},
}
for name, pod in pods.items():
    p = restricted(pod)
    print(f"{name}: " + ("ADMITTED" if not p else "REJECTED"))
    for x in p: print("   -", x)

Output:

debug-tool: REJECTED
   - privileged=true
   - hostNetwork=true
   - runAsNonRoot must be true
   - must drop ALL capabilities
   - seccomp must be RuntimeDefault
shop: ADMITTED
  • Admission controller: code inside the API server's request path that inspects a request after authentication and authorization and before the object is stored. Validating admission says yes or no; mutating admission can change the request (for example add default settings).
  • Pod Security Standards (Kubernetes documentation):
  • Privileged: "Unrestricted policy, providing the widest possible level of permissions."
  • Baseline: "Minimally restrictive policy which prevents known privilege escalations": no privileged pods, no host namespaces (hostNetwork, hostPID, hostIPC), seccomp not Unconfined, only a limited set of added capabilities.
  • Restricted: "Heavily restricted policy, following current Pod hardening best practices": everything in Baseline plus runAsNonRoot: true, drop ALL capabilities (only NET_BIND_SERVICE may be added back), seccomp RuntimeDefault or Localhost, allowPrivilegeEscalation: false.
  • hostNetwork: the pod uses the node's own network instead of its own; it can see and bind the node's interfaces.
  • securityContext: the part of a pod spec that holds security settings.
  • The standards are enforced per namespace by an admission controller; use baseline everywhere and restricted wherever you can.

A pod that passes the restricted standard:

apiVersion: v1
kind: Pod
metadata: {name: shop, namespace: prod}
spec:
  serviceAccountName: shop-sa
  automountServiceAccountToken: false
  securityContext:
    runAsNonRoot: true
    seccompProfile: {type: RuntimeDefault}
  containers:
  - name: shop
    image: registry.example/shop@sha256:<digest>
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities: {drop: ["ALL"]}
    resources:
      limits: {memory: "512Mi", cpu: "1"}

Step 5: Secrets and encryption at rest

  • Secret (Kubernetes): an object for holding small sensitive values (passwords, tokens, keys) that pods can use as files or environment variables.

Demo 5: base64 is not encryption

# A Kubernetes Secret's data is base64. Is that protection?
import base64
secret = {"kind": "Secret", "metadata": {"name": "db"},
          "data": {"password": base64.b64encode(b"Fake-Pa55").decode()}}
print("stored value:", secret["data"]["password"])
print("decoded:     ", base64.b64decode(secret["data"]["password"]).decode())

# encryption at rest: the API server encrypts before writing to etcd
from hashlib import sha256
key = sha256(b"key held by a KMS, never in etcd").digest()
enc = bytes(b ^ key[i] for i, b in enumerate(b"Fake-Pa55"))  # toy cipher, not real crypto
print("etcd copy stolen:", enc.hex(), "<- useless without the key")

Output:

stored value: RmFrZS1QYTU1
decoded:      Fake-Pa55
etcd copy stolen: 1e4ffdc6b503bc9860 <- useless without the key

(The XOR "cipher" in the toy is only for illustration, not real cryptography.)

  • base64: an encoding (episode 10): a reversible way to write bytes as text. Anyone can decode it; it hides nothing.
  • The Kubernetes documentation: "By default, Secret objects are stored unencrypted in etcd." "You should configure encryption of your Secret data in etcd."
  • Encryption at rest: data is encrypted before it is written to storage, so a stolen disk or backup is useless without the key.
  • KMS (key management service): an external service that holds encryption keys; the API server asks it to unwrap data keys, so the master key never sits in the cluster (envelope encryption, episode 65).
  • Also from the documentation: restrict get, watch and list on Secrets, and "only allow cluster administrators to access etcd". Many teams also keep secrets in an external secrets manager and sync only what each app needs.

Step 6: catching attacks at runtime

  • Runtime security: detecting attacks while workloads run, by watching behaviour (processes, files, network connections), because prevention is never perfect.

Demo 6: a toy runtime detector

# Runtime detection: watch what containers DO, and alert on suspicious events.
events = [   # (container, process, action, target) seen by a kernel sensor
  ("shop",    "python",  "connect", "orders-db:5432"),
  ("shop",    "bash",    "spawn",   "bash -i"),
  ("shop",    "bash",    "read",    "/var/run/secrets/.../token"),
  ("shop",    "curl",    "connect", "203.0.113.9:4444"),
  ("payroll", "java",    "write",   "/tmp/report.csv"),
]
RULES = [
  ("shell in container", lambda e: e[2] == "spawn" and e[1] in ("bash", "sh")),
  ("token read by a shell",
       lambda e: e[2] == "read" and e[3].endswith("token") and e[1] != "python"),
  ("odd outbound connection", lambda e: e[2] == "connect" and ":4444" in e[3]),
]
for e in events:
    for name, match in RULES:
        if match(e): print(f"ALERT {name:23} {e[0]}: {e[1]} -> {e[3]}")
print("normal events:", sum(not any(m(e) for _, m in RULES) for e in events))

Output:

ALERT shell in container      shop: bash -> bash -i
ALERT token read by a shell   shop: bash -> /var/run/secrets/.../token
ALERT odd outbound connection shop: curl -> 203.0.113.9:4444
normal events: 2
  • Falco: graduated in the CNCF (Cloud Native Computing Foundation) on 29 February 2024. The CNCF describes it as "a cloud native security tool designed for Linux systems and the de facto Kubernetes threat detection engine"; it applies rules to kernel events and raises real-time alerts about abnormal behaviour.
  • Kernel event: something a process asks the kernel to do (start a process, open a file, connect), seen by a sensor.
  • Typical rules: a shell started in a container, a sensitive file read, an unexpected outbound connection, a write below /etc. Alerts go to central monitoring for triage.

CIS Kubernetes Benchmark and service mesh

  • CIS Kubernetes Benchmark: a checklist of secure configuration settings for Kubernetes (API server, etcd, kubelet, policies) from the Center for Internet Security (CIS Benchmarks, episode 9). Check clusters against it regularly.
  • Service mesh: a layer that puts a small proxy (a sidecar, running beside each pod, or a per-node proxy) in the path of all pod-to-pod traffic. The proxies handle encryption, identity, retries and traffic rules without changing the app.
  • mTLS (mutual TLS) (episode 22): both sides present certificates, so every connection is encrypted and both ends are identified. A mesh can make every call inside the cluster mTLS: zero trust inside the cluster (episode 35).

The whole chain

  1. Thousands of containers → Kubernetes; guard the API server and etcd.
  2. Everyone is admin → RBAC: Roles, RoleBindings, namespaces.
  3. Pods call the API too → small service accounts, no token when not needed.
  4. Flat pod network → NetworkPolicy, default deny.
  5. Dangerous pods → admission controllers, Pod Security Standards.
  6. Secrets only base64 → encryption at rest with a KMS.
  7. Attacks at runtime → Falco-style detection, CIS Benchmark, service mesh mTLS.

Common mistakes (and the fix)

Mistake What you see Why Fix
cluster-admin for every developer one stolen laptop deletes production no least privilege namespaced Roles and RoleBindings
list on Secrets "just to see names" the user can read every secret's value list returns contents no list/watch on Secrets for humans
default service account bound to cluster-admin list secrets -> db-password=Fake-Pa55, payment-key=fake-key-123 any hacked pod becomes admin one small SA per app; automount off
no NetworkPolicy hacked frontend -> payroll-db open pods are non-isolated by default default deny, then allow paths
NetworkPolicy with a plugin that doesn't enforce it policies exist but nothing is blocked enforcement needs plugin support use a plugin that enforces NetworkPolicy; test it
default-deny egress without DNS apps fail to resolve names DNS blocked too allow egress to the cluster DNS
no Pod Security admission debug-tool: REJECTED never happens; privileged pods run RBAC doesn't inspect pods enforce baseline everywhere, restricted where possible
treating Secrets as encrypted decoded: Fake-Pa55 base64; etcd unencrypted by default encryption at rest with a KMS; restrict access
API server open to the internet anyone can try to log in huge attack surface private endpoint, VPN or allowlisted IPs, audit logs

Mini project: a mini cluster policy checker

Write one program that loads a small cluster description (users and RoleBindings, service accounts, NetworkPolicies, pods with securityContext) as Python dictionaries and reports: users with cluster-admin, service accounts that can list Secrets, namespaces without a default-deny policy, and pods that fail the restricted standard. Print a summary score per namespace.

Practice

1. Give Ravi read-only access to pods in dev in the RBAC toy.

Solution
roles["dev-viewer"] = [({"get", "list"}, {"pods"})]
bindings.append(("ravi", "dev-viewer", "dev"))

Now ravi get pods dev prints ALLOW, and ravi delete pods dev is still denied.

2. Why is list on Secrets as dangerous as get?

Solution

A list request returns the full objects, including their data. The Kubernetes documentation says granting list access "implicitly lets the subject fetch the contents of the Secrets".

3. Add a policy that lets the API reach DNS (port 53) in the network policy toy.

Solution
egress = {"api": {"orders-db", "kube-dns"}}
def can_send(src, dst): return dst in egress.get(src, set())
print(can_send("api", "kube-dns"))   # True

In real YAML: an egress rule to the DNS pods' namespace on UDP and TCP port 53.

4. Add an allowPrivilegeEscalation check to the admission toy.

Solution
if c.get("allowPrivilegeEscalation", True):
    problems.append("allowPrivilegeEscalation must be false")

Then add "allowPrivilegeEscalation": False to the shop pod so it is still admitted.

5. Write a Falco-style rule for writes below /etc.

Solution
RULES.append(("write below /etc", lambda e: e[2] == "write" and e[3].startswith("/etc/")))
events.append(("shop", "bash", "write", "/etc/cron.d/job"))

6. A pod spec sets hostNetwork: true. Which Pod Security Standards reject it?

Solution

Baseline and Restricted. Only Privileged allows host namespaces.

Quick quiz

A: none, Kubernetes denies by default
B: only traffic on port 443
C: all ingress and egress traffic
D: only traffic inside one node

No NetworkPolicy exists in a namespace. What traffic is allowed between its pods?

Answer

C. By default pods are non-isolated: if no policies exist in a namespace, all ingress and egress traffic is allowed. Add a default-deny policy, then allow only the paths you need.

Interview questions

  1. Which Kubernetes components are most critical to protect, and why? The API server (every request passes through it) and etcd (it stores the whole cluster state, including Secrets).
  2. Role vs ClusterRole? A Role grants permissions in one namespace; a ClusterRole grants them cluster-wide (or for cluster-scoped resources).
  3. What is a service account and how is it abused? An identity for workloads; a stolen token from a hacked pod can call the API with that account's permissions.
  4. What is the default network behaviour between pods? Fully open. NetworkPolicies with default deny restrict it, if the network plugin enforces them.
  5. What is an admission controller? A step in the API server that validates or mutates requests after authorization and before storage.
  6. Name the Pod Security Standards levels. Privileged, Baseline, Restricted.
  7. Are Kubernetes Secrets encrypted? Base64-encoded only, and stored unencrypted in etcd by default; enable encryption at rest (ideally KMS) and restrict access.
  8. What is runtime security in Kubernetes? Detecting malicious behaviour in running containers (for example with Falco rules on kernel events).
  9. What is the CIS Kubernetes Benchmark? A checklist of secure configuration recommendations for cluster components.
  10. Why use a service mesh for security? It gives every service an identity and encrypts all service-to-service traffic with mTLS without changing applications.

Glossary

Term Meaning
container orchestrator software that places, restarts, scales and connects containers
Kubernetes (K8s) the most widely used container orchestrator
cluster the group of machines Kubernetes manages
node one machine in the cluster
pod the smallest unit Kubernetes runs: one or more containers sharing a network address
control plane the cluster's brain: API server, etcd, scheduler, controller manager
API a defined way for programs to make requests
API server (kube-apiserver) the component that exposes the Kubernetes HTTP API; every request goes through it
etcd the key-value store holding all cluster data
kube-scheduler assigns new pods to nodes
kube-controller-manager runs controllers that keep real state matching desired state
kubelet the agent on each node that keeps its pods running
kube-proxy maintains network rules on nodes for Services
container runtime the software that actually runs containers
authentication / authorization proving who you are / deciding what you may do
RBAC role-based access control
verb an action in the API: get, list, watch, create, update, delete
resource a kind of object: pods, secrets, deployments
Role / RoleBinding permissions in one namespace / giving them to a subject
ClusterRole / ClusterRoleBinding the same, cluster-wide
cluster-admin a built-in role with full power everywhere
namespace (Kubernetes) a named area that splits a cluster (dev, prod)
403 Forbidden HTTP status: known but not allowed
service account an identity for a program running in a pod
token a credential string that proves identity to the API
automountServiceAccountToken the setting that controls whether a token is put in the pod
ingress / egress incoming / outgoing traffic
flat network a network where everything can reach everything
NetworkPolicy a firewall rule for pods
default deny block everything unless explicitly allowed
microsegmentation fine-grained network rules between individual workloads
label a key-value tag used to select objects
network plugin (CNI) the component that provides pod networking and may enforce policies
admission controller a gate in the API server that validates or mutates requests before storage
validating / mutating admission says yes or no / may change the request
Pod Security Standards Privileged, Baseline and Restricted security levels for pods
hostNetwork a pod using the node's own network
securityContext the security settings in a pod or container spec
Secret (Kubernetes) an object holding small sensitive values
base64 a reversible encoding, not encryption
encryption at rest encrypting data before it is stored
KMS key management service that holds keys outside the cluster
external secrets manager a dedicated service that stores secrets and hands them to apps
runtime security detecting attacks while workloads run
Falco CNCF-graduated runtime threat detection engine using rules on kernel events
kernel event a request a process makes to the kernel, seen by a sensor
CNCF Cloud Native Computing Foundation
CIS Kubernetes Benchmark a checklist of secure Kubernetes settings from the Center for Internet Security
service mesh proxies beside each service that handle traffic, identity and encryption
sidecar a helper container that runs beside the app container in a pod
mTLS mutual TLS: both sides prove identity with certificates

Summary

  • Kubernetes runs containers across a cluster; the API server and etcd are the crown jewels.
  • RBAC with namespaced Roles and RoleBindings; treat list on Secrets as reading them.
  • One small service account per app; no token if the app doesn't need the API.
  • Pods are open by default: start every namespace with a default-deny NetworkPolicy.
  • Admission controllers enforce the Pod Security Standards: baseline everywhere, restricted where possible.
  • Secrets are base64 and unencrypted in etcd by default: enable encryption at rest with a KMS.
  • Watch behaviour at runtime (Falco), check against the CIS Benchmark, and encrypt pod traffic with mesh mTLS.
  • Next episode: endpoint security.

Sources (fetched 13 Nov 2026)

  • Kubernetes docs, Kubernetes Components: https://kubernetes.io/docs/concepts/overview/components/
  • Kubernetes docs, Good practices for Kubernetes Secrets: https://kubernetes.io/docs/concepts/security/secrets-good-practices/
  • Kubernetes docs, Network Policies: https://kubernetes.io/docs/concepts/services-networking/network-policies/
  • Kubernetes docs, Pod Security Standards: https://kubernetes.io/docs/concepts/security/pod-security-standards/
  • CNCF, Cloud Native Computing Foundation Announces Falco Graduation (29 Feb 2024): https://www.cncf.io/announcements/2024/02/29/cloud-native-computing-foundation-announces-falco-graduation/