A single misconfigured kubectl command can tear a hole in your cluster’s defenses. That’s why a proper kubectl security review is not optional—it’s critical. Attackers look for weak RBAC rules, exposed kubeconfigs, and over-privileged service accounts. If you don’t check them, they will.
A kubectl security review starts with a full audit of your configuration and access controls. Pull down the current RBAC policies with:
kubectl get clusterrolebindings --all-namespaces -o yaml
Review every binding. Strip cluster-wide privileges from accounts that do not need them. Replace cluster-admin with narrow, namespace-specific roles.
Next, check your kubeconfig files. Are they stored in plaintext? Do they contain long-lived access tokens? Use short-lived credentials and rotate them often. Remove unused contexts from ~/.kube/config to cut attack surface.
Run kubectl auth can-i --list for each service account and user. This reveals the exact verbs and resources available. If you find the ability to create pods with arbitrary images or mount host paths, tighten the policies immediately.