Description
The kubelet read-only port serves requests without authentication or authorization. Set readOnlyPort: 0 to disable the listener.
Potential impact
Any client that can reach the open port may read node and workload information without credentials.
Remediation
First move dependent monitoring collectors to a TLS endpoint with authentication and authorization. Disable the read-only port in the node’s kubelet configuration or with the legacy --read-only-port=0 flag. Verify that the port is closed and monitoring still works.
Examples
The excerpts change the port from 1 to 0. The foo/bar image is a placeholder. Apply the setting to the kubelet that runs on the node.
Before
yaml
apiVersion: v1
kind: Pod
metadata:
name: command-demo
spec:
containers:
- name: command-demo-container
image: foo/bar
command: ["kubelet"]
args: ["--read-only-port=1"]
After
yaml
apiVersion: v1
kind: Pod
metadata:
name: kubelet-demo
spec:
containers:
- name: kubelet-demo-container
image: foo/bar
command: ["kubelet"]
args: ["--read-only-port=0"]