TMA-POSTGRES-1.7
Verify That the 'PGPASSWORD' Environment Variable is Not in Use
OrtaDüzey 1Otomatikpostgres
Açıklama
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).
Nasıl denetlenir
Denetim yöntemi: Kabuk komutu
shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -lsaz '^PGPASSWORD=' /proc/[0-9]*/environ 2>/dev/null | wc -l); echo "$n"- Beklenen çıktı
0
Nasıl düzeltilir
Düzeltme yöntemi: Kılavuz veya altyapı yaması
Find the processes (grep -lsaz ^PGPASSWORD= /proc/*/environ) and change the users or scripts that export PGPASSWORD to use ~/.pgpass or another secure method.
Özellikler
- İşletim sistemleri
- Herhangi biri
- Etiketler
- postgresdatabasecredentials
- Referans
- CIS PostgreSQL 18 Benchmark v1.0.0 - 1.7 Verify That the 'PGPASSWORD' Environment Variable is Not in Use
Bu ana makineyi denetle
Bunu denetleme izniniz olan bir makinede çalıştırın. Tarama salt okunurdur.
shell
tmaegis scan --target postgres