Kubernetes
TMA-KUBERNETES-1.1.12
Ensure that the etcd data directory ownership is set to etcd:etcd
높음레벨 1자동kubernetes
설명
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).
점검 방법
감사 방식: 셸 명령
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- 예상 출력
compliant
조치 방법
조치 방식: 가이드 또는 인프라 패치
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
속성
- 운영 체제
- 모두
- 태그
- kubernetescontrol-planeetcdfile-permissions
- 참고 자료
- CIS Kubernetes Benchmark v2.1.0 - 1.1.12 Ensure that the etcd data directory ownership is set to etcd:etcd
이 호스트 점검하기
감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.
shell
tmaegis scan --target kubernetes