TMAegisBeta
Thêm quy tắc cho kubernetes

Kubernetes

TMA-KUBERNETES-1.1.11

Ensure that the etcd data directory permissions are set to 700 or more restrictive

CaoCấp 1Tự độngkubernetes

Mô tả

Ensure that the etcd data directory has permissions of 700 or more restrictive. Runs on etcd/control-plane nodes; the data directory comes from etcd --data-dir (default /var/lib/etcd).

Cách kiểm tra

Phương pháp kiểm tra: Lệnh 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
p=$(stat -Lc %a "$d") || exit 1
if [ $((0$p & 0077)) -eq 0 ]; then echo compliant; else echo "noncompliant: $d mode $p"; fi
Đầu ra mong đợi
compliant

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

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, chmod 700 /var/lib/etcd

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
kubernetescontrol-planeetcdfile-permissions
Tham chiếu
CIS Kubernetes Benchmark v2.1.0 - 1.1.11 Ensure that the etcd data directory permissions are set to 700 or more restrictive

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target kubernetes