Description
Check the serving certificate kube-apiserver or kubelet actually presents over HTTPS. When file paths are omitted, the component may generate a self-signed certificate or obtain one through its configured issuance process.
Potential impact
A client that skips certificate verification can connect to the wrong server. An expired certificate or mismatched private key can also prevent legitimate connections.
Remediation
For manually managed files, set --tls-cert-file and --tls-private-key-file and restrict access to the key. For kubelet, also check the TLS settings in its configuration file. If issuance is automatic, verify approval and renewal. Test that clients connect over HTTPS, trust the issuing CA and verify both the server name and certificate validity.
Examples
The excerpts show Kubernetes 1.6.0 API server arguments. Use a supported version in production.
Before
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
command: ["kube-apiserver"]
args: []
After
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
command: ["kube-apiserver"]
args: ["--tls-cert-file=someFile.txt", "--tls-private-key-file=someFile.txt"]
The second excerpt uses someFile.txt as a placeholder for both paths. Supply the actual PEM server certificate and its matching private key.