Security
How a request is authenticated, then authorised by RBAC, then admitted — plus the workload side: ServiceAccount tokens, securityContext and Pod Security Standards, and how Secrets are really protected. Most compromises start with one over-broad binding.
part ofKubernetesoverview, primer and where to startread it →on this pageshowhide
explore
- AuthN, AuthZ, and Admission Flow5 questions
- RBAC4 questions
- Service Accounts and Workload Identity4 questions
- securityContext and Pod Security Standards4 questions
- Policy Enforcement via Admission5 questions
- Secrets Access Hygiene5 questions
- User Access & Kubeconfig5 questions
- API Audit Logging4 questions
- Cluster Hardening Baseline5 questions
questions
page 2 of 2Kubernetes runs mutating admission controllers before validating ones. Why is that ordering necessary, and what must the author of a mutating admission webhook keep in mind because of it?
basics
~20 sMutation must finish before validation so that validators judge the final object — otherwise a webhook could inject a sidecar that a validator already approved the spec without. Mutating webhook authors must therefore assume other webhooks also mutate, run in unspecified order, may be re-invoked, and must produce a schema-valid object with idempotent patches and no side effects on dry-run.
A scan finds etcd's client port 2379 on your Kubernetes control-plane nodes reachable from the worker subnet. What is at risk, and how do you lock it down?
basics
~20 sDirect etcd access bypasses Kubernetes authentication, RBAC and admission, so a caller can read or rewrite every object, including Secrets. Require client and peer certificates signed by a dedicated etcd CA, and firewall 2379 and 2380 to control-plane hosts only.
You are asked to move existing production namespaces to the Kubernetes restricted Pod Security Standard without breaking running workloads. How do you sequence that migration, and how do you diagnose workloads that stop being admitted?
basics
~20 sTurn on warn and audit at restricted first, collect violations across a full deploy cycle including CronJobs, fix manifests (non-root UID, drop ALL, no escalation, seccomp, emptyDir for writable paths), verify with server-side dry-run, then set enforce per namespace with a pinned version. Diagnose rejections from ReplicaSet/Job events, which name the violated fields.
Kubernetes refuses to let a user create a Role granting permissions they do not themselves hold, unless they have the escalate verb. Explain that privilege-escalation prevention rule, what the bind verb does, and how it shapes delegating RBAC administration to teams.
basics
~20 sWhen you create or update a Role or ClusterRole, the API server checks that you already hold every permission in it; otherwise it rejects the write. Creating a binding likewise requires holding the role's permissions, or the bind verb on that role. The escalate verb waives the first check. This stops namespace admins from minting themselves cluster power.
You must introduce a cluster-wide rule that rejects Pods running as UID 0 across dozens of teams' namespaces in a running cluster. How do you roll that out without breaking production workloads, and how do you handle the teams that legitimately cannot comply?
basics
~20 sNever start at deny. Ship the rule in audit/warn mode first, measure violations per namespace from the reports, give owners a deadline and help, then enforce namespace by namespace starting with low-risk ones. Handle exceptions as explicit, labelled, time-boxed, individually-reviewed exclusions — not by weakening the global rule.
On a busy Kubernetes cluster, how do you balance audit coverage against API server latency and audit volume, and how do you choose between the log and webhook audit backends and their modes?
basics
~20 sBudget volume through the policy: drop or thin high-rate system traffic, omit RequestReceived, keep bodies only for rare writes. Then choose backend modes by what must win when the sink fails: blocking protects completeness, batch protects latency and may drop events.
You inherit a 3-control-plane, 27-worker self-managed Kubernetes cluster that fails many kube-bench control-plane and kubelet checks. How do you plan and sequence hardening without causing an outage?
basics
~20 sRank kube-bench failures by what an attacker gains, find who depends on each open setting before closing it, roll changes one control-plane node and small kubelet waves at a time, and bake the result into provisioning.
For a platform hosting many teams' workloads, how would you decide between native Kubernetes Secrets with encryption at rest and an external secret manager such as HashiCorp Vault or a cloud secret manager, integrated through the External Secrets Operator or the Secrets Store CSI driver?
basics
~20 sDecide on what native Secrets cannot do: fine-grained non-Kubernetes access policy, automatic rotation and dynamic short-lived credentials, cross-cluster single source of truth, and secret-level audit. If you need those, use an external manager; External Secrets Operator syncs into Secret objects for compatibility, the CSI driver mounts files and skips the object entirely.
You own human access to a 38-node Kubernetes cluster shared by several teams. How do you choose between client certificates and OIDC, and what break-glass path do you keep?
basics
~20 sUse an OIDC identity provider for daily access, with prefixed groups bound by RBAC and short-lived tokens, because leavers and movers are handled centrally. Keep an independent, short-lived or sealed client certificate as an alerted break-glass path.
Why can a single Kubernetes API request produce several audit events, and why do audit Policies often omit the RequestReceived stage?
basics
~20 skube-apiserver can emit one audit event per stage - RequestReceived, ResponseStarted for long-running calls, ResponseComplete, and Panic - all sharing one auditID. ResponseComplete already carries the outcome, so omitting RequestReceived roughly halves volume for ordinary requests.
With the Kubernetes Node authorizer enabled, what does the NodeRestriction admission plugin additionally enforce, and which compromised-node attack does it blunt?
basics
~20 sNodeRestriction checks the content of a kubelet's writes. A kubelet may change only its own Node and pods bound to it, may not change its taints, and may not set node-restriction.kubernetes.io/ labels, so a stolen node cannot pull sensitive workloads onto itself.
showing 31–41 of 41