Which kubelet settings matter for security?
AdvancedConceptKubernetes Security
Answer
The kubelet API on port 10250 can exec into any pod on the node, so it must not be open.
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
authentication:
anonymous: { enabled: false }
webhook: { enabled: true }
authorization:
mode: Webhook
readOnlyPort: 0
rotateCertificates: true
protectKernelDefaults: true
Webhook mode delegates authorisation to the API server, and the Node authorizer plus the NodeRestriction admission plugin limit each kubelet to its own node's objects. kube-bench checks all of these.
More on Kubernetes Security
What are the 4Cs of cloud native security?BeginnerWhat happens to a request between `kubectl apply` and etcd from a security point of view?IntermediateExplain Role, ClusterRole, RoleBinding and ClusterRoleBinding.BeginnerHow do you check what a user or service account is allowed to do?BeginnerWhich RBAC permissions are effectively cluster-admin in disguise?AdvancedHow do service account tokens work now, and what is `automountServiceAccountToken`?Intermediate