More Info:
The kubelet read-only port exposes cluster data without authentication and should be disabled by setting readOnlyPort to 0.Risk Level
HighAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every worker node, check how kubelet is started:
Inspect the output to see whether
--config=/var/lib/kubelet/config.yamlis used and whether a--read-only-portflag is present. -
If using the kubelet config file
/var/lib/kubelet/config.yaml(common with kubeadm), edit it on every worker node and setreadOnlyPortto0:IfreadOnlyPortis not present, add it under the top-level fields (align indentation with other keys): -
If kubelet is using a systemd unit flag instead of (or in addition to) the config file, edit
/etc/systemd/system/kubelet.service.d/10-kubeadm.confon every worker node and ensure--read-only-port=0is set in the kubelet arguments (either inKUBELET_SYSTEM_PODS_ARGSor the relevantKUBELET_*variable):If no--read-only-portis present, append it to the kubelet options line, for example: -
Reload systemd and restart kubelet on every worker node (this will temporarily disrupt workloads on that node while kubelet restarts):
-
Verify on every worker node that kubelet no longer exposes a nonzero read-only port:
Confirm that:
- There is no
--read-only-portflag with a value other than0, and - If present as a flag, it is
--read-only-port=0.
If relying solely on the config file, you may additionally confirm the setting:
- There is no
Using kubectl
Using kubectl
kubectl cannot change the kubelet’s
readOnlyPort setting because it is controlled by host-level configuration on each worker node (/var/lib/kubelet/config.yaml and/or the systemd unit kubelet.service). To remediate this finding, make the changes directly on every worker node as described in the Manual Steps section.Automation
Automation

