TMA-TDSQL-1.2
Ensure a Dedicated Least-Privilege Account Is Used for TDSQL Processes
Mô tả
Each TDSQL component (OSS, Manager/Scheduler/Keeper, Agent, MySQL) should run under a dedicated, non-root, least-privilege operating system account. The MySQL daemon should not run as root. TDSQL management processes should run under a dedicated account (e.g., tdsql). Counts mysqld, oss_server, scheduler and ZooKeeper processes running as root (FAIL when none of these processes is running).
Cách kiểm tra
Phương pháp kiểm tra: Lệnh shell
out=$(ps -eo user=,comm=,args= 2>/dev/null) || exit 1; printf '%s\n' "$out" | awk '$2 ~ /^(mysqld|mysqld_safe|oss_server|scheduler)$/ || ($2 == "java" && /zookeeper/) {n++; if ($1 == "root") r++} END {if (n == 0) exit 1; print r + 0}'- Đầu ra mong đợi
0
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
Create a dedicated system account (groupadd -r tdsql; useradd -r -g tdsql -s /sbin/nologin -d /data/tdsql tdsql), chown the TDSQL directories to it and restart each component under that account.
Thuộc tính
- Hệ điều hành
- Bất kỳ
- Thẻ
- tdsqlservice-account
- Tham chiếu
- CIS Tencent TDSQL 10.3.22 Benchmark v1.0.0 - 1.2 Ensure a Dedicated Least-Privilege Account Is Used for TDSQL Processes
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.
tmaegis scan --target tdsql