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.
修正方法
修正方法: ガイダンスまたは IaC パッチ
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