Skip to main content

More Info:

When makeIPTablesUtilChains is true the kubelet manages iptables rules to ensure correct traffic handling for pods. Enabling it maintains expected network filtering behavior on the node.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Edit the kubelet config file to enable iptables util chains
    • Run on: every worker node
    • Open the config file:
    • In the kubeletConfiguration section, add or modify this field so it reads exactly:
    • Save and exit.
  2. (If present) Remove conflicting command-line flag from kubelet systemd drop-in
    • Run on: every worker node
    • Open the kubelet drop-in file:
    • In the KUBELET_SYSTEM_PODS_ARGS (or any KUBELET_* variable), remove any occurrence of:
    • Save and exit.
  3. Reload systemd units
    • Run on: every worker node
  4. Restart kubelet to apply changes
    • Run on: every worker node
  5. Verify kubelet is running
    • Run on: every worker node
  6. Verify the kubelet now has makeIPTablesUtilChains enabled
    • Run on: every worker node
    • Confirm there is no --make-iptables-util-chains flag in the ps output, and the config file shows makeIPTablesUtilChains: true.
kubectl cannot modify kubelet host-level configuration such as /var/lib/kubelet/config.yaml or systemd unit files on worker nodes. To remediate this finding, you must change the kubelet config and/or systemd unit directly on every worker node; follow the guidance in the Manual Steps section.
Usage:
  • Copy this script to each worker node as root, e.g. /root/fix-kubelet-iptables.sh.
  • Run on every worker node:
Final verification on each worker node: