Skip to main content

More Info:

The —peer-cert-file and —peer-key-file arguments must be set so that etcd peer-to-peer traffic is served over TLS. Without them, replication traffic containing all cluster state and secrets travels unencrypted between etcd nodes.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every etcd (control plane) node, back up the current manifest and list existing etcd certs:
  2. If you already have dedicated peer cert/key files, note their paths (for example /etc/kubernetes/pki/etcd/peer.crt and /etc/kubernetes/pki/etcd/peer.key). If not, generate them following your PKI process or, as a simple local CA example, run:
  3. Edit the etcd static pod manifest on every etcd node to add the peer TLS flags, using the correct cert paths from step 2:
    In the spec.containers[0].command list, ensure these entries exist (adjust paths if different in your environment):
    Do not remove any existing TLS or cluster-related flags.
  4. Still in /etc/kubernetes/manifests/etcd.yaml, if your etcd cluster uses peer CA verification, confirm a matching --peer-trusted-ca-file is set and that the file exists:
    Save and exit the editor. The kubelet will automatically restart the etcd static pod when the manifest changes; this temporarily restarts etcd on that node.
  5. If you have multiple etcd nodes, repeat steps 1–4 on each etcd node, using the correct peer certificate and key for that node and ensuring any cluster-related flags (e.g., --initial-cluster, --initial-advertise-peer-urls, --initial-cluster-state) remain consistent with your existing etcd cluster configuration.
  6. On every etcd node, verify the process now includes the peer cert and key flags:
    Confirm the output contains both --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt and --peer-key-file=/etc/kubernetes/pki/etcd/peer.key with the expected paths.
kubectl cannot be used to configure etcd’s --peer-cert-file and --peer-key-file flags because they are set in the static Pod manifest on the host filesystem. Make the changes directly in /etc/kubernetes/manifests/etcd.yaml on every etcd node as described in the Manual Steps section.