TMAegis
Thêm quy tắc cho postgres

TMA-POSTGRES-3.1.4

Ensure the log file destination directory is set correctly

ThấpCấp 1Xem xét thủ côngpostgres

Mô tả

The log_directory setting specifies the destination directory for log files when log_destination is stderr or csvlog. It can be specified as relative to the cluster data directory ($PGDATA) or as an absolute path. log_directory should be set according to your organization's logging policy.

Cách kiểm tra

Phương pháp kiểm tra: Xem xét thủ công

Khuyến nghị này không thể kiểm tra tự động. Lần quét sẽ liệt kê mục này kèm hướng dẫn khi bạn truyền cờ --include-manual.

Run SHOW log_directory; (default log, relative to the data directory) and confirm it is the directory defined by your logging policy. Prefer an absolute path outside PGDATA (e.g. /var/log/postgres) so logs are not copied by pg_basebackup or pgBackRest.

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

ALTER SYSTEM SET log_directory = '/var/log/postgres'; (create it owned by postgres, mode 0700) then SELECT pg_reload_conf();

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
postgresdatabaseloggingmanual
Tham chiếu
CIS PostgreSQL 18 Benchmark v1.0.0 - 3.1.4 Ensure the log file destination directory is set correctly