TMAegisBeta
更多 postgres 規則

PostgreSQL

TMA-POSTGRES-8.2

Ensure the backup and restore tool, 'pgBackRest', is installed and configured

低等級 1自動化postgres

說明

pgBackRest aims to be a simple, reliable backup and restore system that can seamlessly scale up to the largest databases and workloads. Instead of relying on traditional backup tools like tar and rsync, pgBackRest implements all backup features internally and uses a custom protocol for communicating with remote systems. Passes when the pgbackrest binary is installed and /etc/pgbackrest/pgbackrest.conf (or /etc/pgbackrest.conf) exists; an alternative backup tool makes this an accepted exception.

檢查方式

稽核方法: Shell 指令

shell
command -v pgbackrest >/dev/null 2>&1 || { echo not-installed; exit 0; }; if [ -f /etc/pgbackrest/pgbackrest.conf ] || [ -f /etc/pgbackrest.conf ]; then echo compliant; else echo not-configured; fi
預期輸出
compliant

修補方式

修補方法: 操作指南或基礎設施修補檔

Install pgBackRest from PGDG (dnf install pgbackrest / apt install pgbackrest), configure /etc/pgbackrest/pgbackrest.conf (stanza, repository on separate storage, retention, logging), run pgbackrest --stanza=<name> stanza-create and test a restore.

屬性

作業系統
不限
標籤
postgresdatabasebackup
參考資料
CIS PostgreSQL 18 Benchmark v1.0.0 - 8.2 Ensure the backup and restore tool, 'pgBackRest', is installed and configured

檢查此主機

請在您有權稽核的機器上執行此指令。掃描為唯讀操作。

shell
tmaegis scan --target postgres