TMAegis
Thêm quy tắc cho postgres

TMA-POSTGRES-6.2

Ensure 'backend' runtime parameters are configured correctly

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

Mô tả

In order to serve multiple clients efficiently, the PostgreSQL server launches a new "backend" process for each client. The runtime parameters in this benchmark section are controlled by the backend process. Checks the benchmark's expected backend values ignore_system_indexes=off, jit_debugging_support=off, jit_profiling_support=off and post_auth_delay=0 (log_connections/log_disconnections are 3.1.20/3.1.21). Runs psql as ${PGUSER:-postgres} against ${PGDATABASE:-postgres}; set PGHOST/PGPORT and use ~/.pgpass (not PGPASSWORD, see 1.6/1.7) when peer authentication is not available.

Cách kiểm tra

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

sql_query
out=$(psql -X -U "${PGUSER:-postgres}" -d "${PGDATABASE:-postgres}" -tAc "SELECT CASE WHEN (SELECT count(*) FROM pg_settings WHERE (name, setting) IN (('ignore_system_indexes','off'),('jit_debugging_support','off'),('jit_profiling_support','off'),('post_auth_delay','0'))) = 4 THEN 'compliant' ELSE 'noncompliant' 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

Correct unauthorized backend parameters in postgresql.conf/postgresql.auto.conf (or the pg_ctl command line / $PGDATA/postmaster.opts) and restart PostgreSQL; compare SELECT name, setting FROM pg_settings WHERE context IN ('backend','superuser-backend') with your baseline.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
postgresdatabaseconfiguration
Tham chiếu
CIS PostgreSQL 18 Benchmark v1.0.0 - 6.2 Ensure 'backend' runtime parameters are configured 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 postgres