More Info:
Binding the kube-proxy metrics service to localhost prevents the metrics endpoint from being reachable across the network. This limits exposure of operational data to the local node only.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify how kube-proxy is started (systemd vs. manifest)
- Run on: every worker node
- From the output, note whether kube-proxy is started via:
- a systemd unit referencing a config file (e.g.
/etc/kubernetes/proxy.conf), or - a static pod manifest (e.g.
/etc/kubernetes/manifests/kube-proxy.yaml).
- a systemd unit referencing a config file (e.g.
- The remaining steps assume the config file
/etc/kubernetes/proxy.confis in use; if not, adjust to the actual kube-proxy config file or manifest used on that node.
-
Edit the kube-proxy configuration to bind metrics to localhost
- Run on: every worker node
- Open the config file:
- In the
metricsBindAddressfield underkubeProxyConfiguration, set it to localhost if it is set to another address, or add it if missing: - Remove any non-localhost setting such as
0.0.0.0:10249or a specific node IP.
-
If kube-proxy is launched via command-line flags, ensure flags do not override localhost binding
- Run on: every worker node
- Check the kube-proxy process command for a
--metrics-bind-addressflag: - If you see a flag binding to a non-localhost address (for example
--metrics-bind-address=0.0.0.0:10249), edit the systemd unit or launch script shown in the command line (for example/etc/systemd/system/kube-proxy.service), and either:- change it to:
or
- remove the flag entirely so the default
127.0.0.1:10249from the config file applies.
- change it to:
- After editing a systemd unit file, reload systemd:
-
Restart kube-proxy to apply changes
- Run on: every worker node
- If kube-proxy is managed by systemd:
- If kube-proxy runs as a static pod from a manifest, saving the edited manifest or config file usually causes the kubelet to automatically restart the pod. No extra command is needed, but be aware that editing a manifest used by kubelet will restart kube-proxy on that node.
-
Verify that metrics are now bound to localhost
- Run on: every worker node
- Confirm in the command line or implied configuration that:
--metrics-bind-addressis either absent or set to127.0.0.1:10249, and- there is no binding of the metrics service to a non-localhost address.
Using kubectl
Using kubectl
kubectl cannot modify kube-proxy’s host-level configuration or the
/etc/kubernetes/proxy.conf file where the metrics binding is set; this must be fixed directly on every worker node. See the Manual Steps section for how to edit the configuration and restart kube-proxy safely.Automation
Automation

