バージョンごとのドキュメント一覧

F.26. passwordcheck — パスワードの強度を検査する #

<title>passwordcheck &mdash; verify password strength</title>

The <filename>passwordcheck</filename> module checks users' passwords whenever they are set with <xref linkend="sql-createrole"/> or <xref linkend="sql-alterrole"/>. If a password is considered too weak, it will be rejected and the command will terminate with an error. passwordcheckモジュールはCREATE ROLEまたはALTER ROLEによって設定したユーザのパスワードを検査します。 パスワードが弱すぎると考えられた場合、パスワードは拒絶されてコマンドはエラーで終わります。

To enable this module, add <literal>'$libdir/passwordcheck'</literal> to <xref linkend="guc-shared-preload-libraries"/> in <filename>postgresql.conf</filename>, then restart the server. このモジュールを有効にするには、postgresql.conf中のshared_preload_libraries'$libdir/passwordcheck'を追加して、サーバを再起動してください。

You can adapt this module to your needs by changing the source code. For example, you can use <ulink url="https://github.com/cracklib/cracklib">CrackLib</ulink> to check passwords &mdash; this only requires uncommenting two lines in the <filename>Makefile</filename> and rebuilding the module. (We cannot include <productname>CrackLib</productname> by default for license reasons.) Without <productname>CrackLib</productname>, the module enforces a few simple rules for password strength, which you can modify or extend as you see fit. ソースコードの変更により、このモジュールをユーザの用途に適合できます。 例えば、パスワード検査のためCrackLibを使用できます。 これに必要な作業はMakefile中の 2行のコメントアウトを外してモジュールを再構築することだけです。 (ライセンスの理由からCrackLibをデフォルトで組み込むことができません。) CrackLibがなくても、モジュールはパスワードの強度に関する幾つかの単純な規則を強制します。 ユーザはこの規則を、適切となるように修正または拡張できます。

注意

To prevent unencrypted passwords from being sent across the network, written to the server log or otherwise stolen by a database administrator, <productname>PostgreSQL</productname> allows the user to supply pre-encrypted passwords. Many client programs make use of this functionality and encrypt the password before sending it to the server. 暗号化されないパスワードが、ネットワークを送信されること、サーバログに記録されることおよびデータベース管理者に盗聴されることを防ぐために、PostgreSQLはパスワードの一方向暗号化をユーザに提供できます。 この機能を使用して、多くのクライアントプログラムはサーバへ送信する前にパスワードを暗号化できます。

This limits the usefulness of the <filename>passwordcheck</filename> module, because in that case it can only try to guess the password. For this reason, <filename>passwordcheck</filename> is not recommended if your security requirements are high. It is more secure to use an external authentication method such as GSSAPI (see <xref linkend="client-authentication"/>) than to rely on passwords within the database. 一方向暗号化されたパスワードは復号できないので、これがpasswordcheckモジュールの有効性の限界となります。 この理由により、高度のセキュリティが要求される場合、passwordcheckは推奨されません。 データベース内部に保存したパスワードに依存するよりは、GSSAPIのような外部の認証方法を使用した方が安全です(第21章参照)。

Alternatively, you could modify <filename>passwordcheck</filename> to reject pre-encrypted passwords, but forcing users to set their passwords in clear text carries its own security risks. その他の方法として、一方向暗号化されたパスワードを拒否するためにpasswordcheckを修正できます。 しかし、この方法ではパスワードが平文のテキストとして送信されるため、ユーザに多大なセキュリティリスクを負担させます。