Lesson 1 of 13 · 12m
The API Server Decides Everything
Every cluster action is one HTTPS request through authentication, RBAC authorization, and admission — and a kubeconfig is a credential bundle, not a config file.
Every action is one HTTPS request
There is no "cluster shell." There is no daemon you log into that then decides things. Every change to a Kubernetes cluster is an HTTPS request to kube-apiserver on port 6443, carrying an identity and a verb on a resource. kubectl get pods is GET /api/v1/namespaces/default/pods. A controller scaling a Deployment is PATCH to the same API. Even the kubelet — the agent on each node — reports pod status by calling the API server like any other client.
The request walks a fixed pipeline. Authentication comes first: the API server resolves who sent the request — a client certificate's subject, a bearer token verified through the TokenReview API, OIDC claims from --oidc-issuer-url, or a webhook token authenticator. Authorization comes next: for each request the API server asks "may this identity do this verb on this resource in this namespace?" The answer comes from --authorization-mode, which on every sane cluster is RBAC,Node — Node mode handles what kubelets may write, and it's deliberately narrow: a kubelet credential can update its own Node object and the pods scheduled to it, nothing else. A stolen kubelet cert cannot read your secrets. RBAC handles everything else — including nonResourceURLs like /healthz, /version, and /metrics, which is why kubectl get --raw /metrics is itself an RBAC-checked call.
Kubernetes has no users
The mental model to attack first: the cluster does not have a user list. There is no kubectl create user. Identity arrives with each request — a certificate's CN= and O= fields, a service account JWT's claims, an OIDC sub. This is why a kubeconfig file is not "a config." It is a bundle of bearer credentials. Whoever copies it is that identity. The standard kubeconfig planted by kubeadm authenticates with a client certificate in O=system:masters, and the cluster-admin ClusterRoleBinding grants that group * verbs on * resources — unrestricted control of the cluster, no password, no expiry, no MFA. Treat kubeconfig files like private keys, because they are.
RBAC itself is four objects. Role and ClusterRole are lists of rules: {apiGroups, resources, verbs, resourceNames}. RoleBinding and ClusterRoleBinding attach those rules to subjects — a User, Group, or ServiceAccount. A RoleBinding in namespace payments can reference a ClusterRole and grant it only inside payments; a ClusterRoleBinding applies cluster-wide, including to cluster-scoped resources like nodes.
Check before you grant
The tool nobody uses enough is kubectl auth can-i. It answers the question the API server will answer:
kubectl auth can-i create deployments -n payments --as=deploy-bot
kubectl auth can-i --list -n payments --as=system:serviceaccount:payments:ci
kubectl auth can-i get secrets --as=intern --all-namespaces--as impersonates any user or service account — itself gated by the impersonate verb, covered next lesson. can-i --list shows the full effective permission set for an identity, which is the fastest way to audit what a service account actually gained from its three RoleBindings.
To see who holds real power, read the bindings, not the roles:
kubectl get clusterrolebindings -o wide | grep cluster-admin
kubectl get rolebindings -ADefault installs ship useful aggregated ClusterRoles — admin, edit, view — which merge labeled sub-roles. view reads most things but notably excludes secrets; that exclusion is deliberate and is the difference between "can see the deployment" and "can read every credential in the namespace."
One more pattern worth knowing: a RoleBinding referencing a ClusterRole grants that cluster-defined role within the binding's namespace only. It's how you hand a tenant "admin in their box" — full power inside team-a, nothing anywhere else — without writing a Role that duplicates the ClusterRole's rules.
What to actually do
- Grant
admin/edit/viewor purpose-built Roles; never bindcluster-adminoutside bootstrap break-glass. - Audit bindings quarterly: who has
cluster-admin, who has*wildcards, who canimpersonate. - Prefer OIDC or service accounts over client certificates, so identity has an issuer you can revoke.
The API server decides everything. Your job is to make sure it decides against the right list.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
A 257-Byte Password Is the Key: Inside the OpenSSH musl Bypass
CVE-2026-123158 lets an attacker log into a locked account on musl-based systems like Alpine by sending a password nobody set. The trigger is one number, 257, and the reason is a C library returning a single asterisk. I reproduced the exact boundary against musl 1.2.4 and read the fix.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.