TMA-KUBERNETES-1.1.12
Ensure that the etcd data directory ownership is set to etcd:etcd
ÉlevéeNiveau 1Automatiséekubernetes
Description
Ensure that the etcd data directory ownership is set to etcd:etcd. Runs on etcd/control-plane nodes; the data directory comes from etcd --data-dir (default /var/lib/etcd).
Méthode de vérification
Méthode d'audit: Commande shell
shell
set -f
a=$(ps -eo args 2>/dev/null | grep -E '^([^ ]*/)?etcd( |$)' | head -n 1)
[ -n "$a" ] || a=$(cat /etc/kubernetes/manifests/etcd.yaml 2>/dev/null | tr '\n' ' ')
d=$(printf '%s\n' "$a" | tr ' "' '\n\n' | sed -n 's/^--data-dir=//p' | tail -n 1); d=${d:-/var/lib/etcd}
[ -d "$d" ] || exit 1
o=$(stat -Lc %U:%G "$d") || exit 1
if [ "$o" = "etcd:etcd" ]; then echo compliant; else echo "noncompliant: $d $o"; fi- Sortie attendue
compliant
Méthode de correction
Méthode de correction: Recommandation ou correctif d'infrastructure
On the etcd server node, get the etcd data directory, passed as an argument --data-dir, from the below command: ps -ef | grep etcd Run the below command (based on the etcd data directory found above). For example, chown etcd:etcd /var/lib/etcd
Propriétés
- Systèmes d'exploitation
- Tous
- Étiquettes
- kubernetescontrol-planeetcdfile-permissions
- Référence
- CIS Kubernetes Benchmark v2.1.0 - 1.1.12 Ensure that the etcd data directory ownership is set to etcd:etcd
Vérifier cet hôte
Exécutez cette commande sur une machine que vous êtes autorisé à auditer. L'analyse est en lecture seule.
shell
tmaegis scan --target kubernetes