TMAegis
Thêm quy tắc cho postgres

TMA-POSTGRES-1.3

Ensure systemd Service Files Are Enabled

ThấpCấp 1Tự độngpostgres

Mô tả

Confirm, and correct if necessary, the PostgreSQL systemd service is enabled. Passes when at least one postgresql* systemd service unit is enabled.

Cách kiểm tra

Phương pháp kiểm tra: Lệnh shell

shell
out=$(systemctl list-unit-files --type=service --no-legend 'postgresql*' 2>/dev/null) || exit 1; printf '%s\n' "$out" | awk '$2=="enabled"{e=1} END{print e?"enabled":"not-enabled"}'
Đầu ra mong đợi
enabled

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

Enable the PostgreSQL unit for the default target, e.g. systemctl enable postgresql-18 (PGDG) or systemctl enable postgresql (Debian/Ubuntu), then confirm with systemctl is-enabled.

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
postgresdatabaseservice
Tham chiếu
CIS PostgreSQL 18 Benchmark v1.0.0 - 1.3 Ensure systemd Service Files Are Enabled

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