2 F.24. passwordcheck — verify password strength #
4 F.24.1. Configuration Parameters
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.
10 To enable this module, add '$libdir/passwordcheck' to
11 shared_preload_libraries in postgresql.conf, then restart the server.
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.
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.
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
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.
39 F.24.1. Configuration Parameters #
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.
47 This parameter has no effect if a user supplies a pre-encrypted
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
54 passwordcheck.min_password_length = 12