Skip to main content

More Info:

Verifies that the etcd data directory is owned by etcd:etcd so only the etcd service account can access the cluster datastore.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, identify the etcd data directory:
    From the output, note the value passed to --data-dir. If no --data-dir is present, use /var/lib/etcd/default.etcd as the directory.
  2. On every control plane node, confirm the directory exists (replace the path if different):
    If your --data-dir was different, substitute that exact path in place of /var/lib/etcd.
  3. On every control plane node, ensure the etcd user and group exist:
    If this command fails, create them according to your OS standards before proceeding.
  4. On every control plane node, change ownership of the etcd data directory (substitute the actual data-dir path if different):
  5. On every control plane node, verify the ownership is now correct for the etcd data directory (replace the path with your actual data-dir if needed):
    The output must be:
kubectl cannot modify host-level file ownership such as the etcd data directory on control plane nodes; this must be corrected directly on each control plane node’s filesystem (for example with chown on /var/lib/etcd). See the Manual Steps section for the exact commands to run on the nodes.