]> begriffs open source - ai-pg/blob - full-docs/txt/passwordcheck.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / passwordcheck.txt
1
2 F.24. passwordcheck — verify password strength #
3
4    F.24.1. Configuration Parameters
5
6    The passwordcheck module checks users' passwords whenever they are set
7    with CREATE ROLE or ALTER ROLE. If a password is considered too weak,
8    it will be rejected and the command will terminate with an error.
9
10    To enable this module, add '$libdir/passwordcheck' to
11    shared_preload_libraries in postgresql.conf, then restart the server.
12
13    You can adapt this module to your needs by changing the source code.
14    For example, you can use CrackLib to check passwords — this only
15    requires uncommenting two lines in the Makefile and rebuilding the
16    module. (We cannot include CrackLib by default for license reasons.)
17    Without CrackLib, the module enforces a few simple rules for password
18    strength, which you can modify or extend as you see fit.
19
20 Caution
21
22    To prevent unencrypted passwords from being sent across the network,
23    written to the server log or otherwise stolen by a database
24    administrator, PostgreSQL allows the user to supply pre-encrypted
25    passwords. Many client programs make use of this functionality and
26    encrypt the password before sending it to the server.
27
28    This limits the usefulness of the passwordcheck module, because in that
29    case it can only try to guess the password. For this reason,
30    passwordcheck is not recommended if your security requirements are
31    high. It is more secure to use an external authentication method such
32    as GSSAPI (see Chapter 20) than to rely on passwords within the
33    database.
34
35    Alternatively, you could modify passwordcheck to reject pre-encrypted
36    passwords, but forcing users to set their passwords in clear text
37    carries its own security risks.
38
39 F.24.1. Configuration Parameters #
40
41    passwordcheck.min_password_length (integer)
42           The minimum acceptable password length in bytes. The default is
43           8. Only superusers can change this setting.
44
45 Note
46
47           This parameter has no effect if a user supplies a pre-encrypted
48           password.
49
50    In ordinary usage, this parameter is set in postgresql.conf, but
51    superusers can alter it on-the-fly within their own sessions. Typical
52    usage might be:
53 # postgresql.conf
54 passwordcheck.min_password_length = 12