TMA-MARIADB-1.2
Use Dedicated Least Privileged Account for MariaDB Daemon/Service
Mô tả
As with any service installed on a host, it can be provided with its own user context. Providing a dedicated user to the service provides the ability to precisely constrain the service within the larger host context. Passes when the running mariadbd/mysqld process does not run as root (the benchmark expects the mysql account).
Cách kiểm tra
Phương pháp kiểm tra: Lệnh shell
out=$(ps -eo user:32=,comm= 2>/dev/null) || exit 1; printf '%s\n' "$out" | awk '$2=="mysqld"||$2=="mariadbd"{n++; if($1=="root")r++} END{if(!n)print "not-running"; else if(r)print "runs-as-root"; else print "compliant"}'- Đầ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
Run MariaDB under a dedicated unprivileged account (normally mysql, no sudo rights, shell /bin/false): groupadd -r mysql; useradd -r -M -g mysql -d /var/lib/mysql -s /bin/false mysql; set user=mysql under [mariadbd] or User=mysql in the systemd unit, then restart.
Thuộc tính
- Hệ điều hành
- Bất kỳ
- Thẻ
- mariadbdatabaseserviceos
- Tham chiếu
- CIS MariaDB 10.11 Benchmark v1.0.0 - 1.2 Use Dedicated Least Privileged Account for MariaDB Daemon/Service
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 mariadb