TMAegis
postgres 관련 규칙 더 보기

TMA-POSTGRES-1.6

Verify That 'PGPASSWORD' is Not Set in Users' Profiles

보통레벨 1자동postgres

설명

PostgreSQL can read a default database password from an environment variable called PGPASSWORD. Run as root; counts Bash login scripts in /home/*, /root and /etc/environment that mention PGPASSWORD (other shells need manual review).

점검 방법

감사 방식: 셸 명령

shell
[ "$(id -u)" -eq 0 ] || exit 1; n=$(grep -ls PGPASSWORD /home/*/.bashrc /home/*/.profile /home/*/.bash_profile /root/.bashrc /root/.profile /root/.bash_profile /etc/environment 2>/dev/null | wc -l); echo "$n"
예상 출력
0

조치 방법

조치 방식: 가이드 또는 인프라 패치

Remove PGPASSWORD from the listed login scripts and use ~/.pgpass (mode 0600), a service file without passwords, or certificate/peer authentication instead.

속성

운영 체제
모두
태그
postgresdatabasecredentials
참고 자료
CIS PostgreSQL 18 Benchmark v1.0.0 - 1.6 Verify That 'PGPASSWORD' is Not Set in Users' Profiles

이 호스트 점검하기

감사 권한이 있는 시스템에서 실행하세요. 스캔은 읽기 전용입니다.

shell
tmaegis scan --target postgres