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