TMA-POSTGRES-5.1
Do Not Specify Passwords in the Command Line
설명
When a command is executed on the command line, for example ; psql postgresql://postgres:PASSWORD@host the password may be visible in the user's shell/command history or in the process list, thus exposing the password to other entities on the server.
점검 방법
감사 방식: 수동 검토
이 권장 사항은 자동으로 점검할 수 없습니다. --include-manual 옵션을 전달하면 스캔 결과에 이 지침과 함께 표시됩니다.
Check the process list (sudo ps -few) and shell histories (history, ~/.bash_history) for psql/pg_dump invocations that contain a password, e.g. in a connection string (password=...). Any visible password is a fail.
조치 방법
조치 방식: 가이드 또는 인프라 패치
Do not pass passwords on the command line; use ~/.pgpass (mode 0600), a service file without passwords, or certificate authentication, and clear exposed history entries.
속성
- 운영 체제
- 모두
- 태그
- postgresdatabasecredentialsmanual
- 참고 자료
- CIS PostgreSQL 18 Benchmark v1.0.0 - 5.1 Do Not Specify Passwords in the Command Line