TMAegis
Više pravila za postgres

TMA-POSTGRES-1.7

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

SrednjaNivo 1Automatskapostgres

Opis

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).

Kako se proverava

Metod provere: Komanda ljuske

shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -lsaz '^PGPASSWORD=' /proc/[0-9]*/environ 2>/dev/null | wc -l); echo "$n"
Očekivani izlaz
0

Kako se ispravlja

Metod ispravke: Smernica ili zakrpa infrastrukture

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

Svojstva

Operativni sistemi
Bilo koji
Oznake
postgresdatabasecredentials
Referenca
CIS PostgreSQL 18 Benchmark v1.0.0 - 1.7 Verify That the 'PGPASSWORD' Environment Variable is Not in Use

Proverite ovaj računar

Pokrenite ovo na računaru za koji imate dozvolu za proveru. Skeniranje radi u režimu samo za čitanje.

shell
tmaegis scan --target postgres