TMAegisБета
Више правила за postgres

PostgreSQL

TMA-POSTGRES-1.7

Verify That the 'PGPASSWORD' Environment Variable is Not in Use

СредњаНиво 1Аутоматскаpostgres

Опис

PostgreSQL can read a default database password from an environment variable called PGPASSWORD. Run as root; counts processes whose environment contains PGPASSWORD (including the scanner itself if it was given PGPASSWORD).

Како се проверава

Метод провере: Команда љуске

shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -lsaz '^PGPASSWORD=' /proc/[0-9]*/environ 2>/dev/null | wc -l); echo "$n"
Очекивани излаз
0

Како се исправља

Метод исправке: Смерница или закрпа инфраструктуре

Find the processes (grep -lsaz ^PGPASSWORD= /proc/*/environ) and change the users or scripts that export PGPASSWORD to use ~/.pgpass or another secure method.

Својства

Оперативни системи
Било који
Ознаке
postgresdatabasecredentials
Референца
CIS PostgreSQL 18 Benchmark v1.0.0 - 1.7 Verify That the 'PGPASSWORD' Environment Variable is Not in Use

Проверите овај рачунар

Покрените ово на рачунару за који имате дозволу за проверу. Скенирање ради у режиму само за читање.

shell
tmaegis scan --target postgres