TMAegisBeta
Thêm quy tắc cho yugabytedb

YugabyteDB

TMA-YUGABYTEDB-3.1.3

Ensure the log file permissions are set correctly

Trung bìnhCấp 1Tự độngyugabytedb

Mô tả

The log_file_mode setting determines the file permissions for log files when logging_collector is enabled. The parameter value is expected to be a numeric mode specification in the form accepted by the chmod and umask system calls. (To use the customary octal format, the number must start with a 0) The permissions should be set to allow only the necessary access to authorized personnel. Runs ysqlsh (add the YugabyteDB bin directory to PATH) against PGHOST/PGPORT (default 127.0.0.1:5433) as PGUSER (default yugabyte); supply the password through PGPASSWORD or ~/.pgpass. Passes when log_file_mode grants no access to other users (default 0600; 0640/0660 only if your policy allows group access).

Cách kiểm tra

Phương pháp kiểm tra: Truy vấn SQL

sql_query
out=$(ysqlsh -h "${PGHOST:-127.0.0.1}" -p "${PGPORT:-5433}" -U "${PGUSER:-yugabyte}" -d "${PGDATABASE:-yugabyte}" -tAc "SELECT CASE WHEN right(current_setting('log_file_mode'), 1) = '0' THEN 'compliant' ELSE 'mode ' || current_setting('log_file_mode') END" 2>/dev/null) || exit 1; printf '%s\n' "$out"
Đầ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

Set it with the YB-TServer GFlag --ysql_pg_conf_csv="log_file_mode='0600'" on every YB-TServer and restart it.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
yugabytedbloggingpermissions
Tham chiếu
CIS YugabyteDB Benchmark v2.0.0 - 3.1.3 Ensure the log file permissions are set correctly

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 yugabytedb