2 (Kerberos password strength checking plugin)
4 Maintained by Russ Allbery <rra@stanford.edu>
6 Copyright 2006, 2007, 2009, 2010, 2012, 2013 The Board of Trustees of
7 the Leland Stanford Junior University. Portions copyright 1993 Alec
8 Muffett. Developed by Derrick Brashear and Ken Hornstein of Sine Nomine
9 Associates, on behalf of Stanford University. This software is
10 distributed under a BSD-style license and under the Artistic License.
11 Please see the section LICENSE for more information.
15 krb5-strength provides mechanisms for checking the strength of Kerberos
16 passwords against an external dictionary when a user changes passwords
17 in a Kerberos KDC. It is roughly equivalent to checking password
18 strength via CrackLib, except that it embeds a copy of Alec Muffett's
19 CrackLib that has been modified to perform slightly more strenuous
20 tests. It supports both Heimdal and MIT Kerberos (1.9 or later).
24 Heimdal includes a capability to plug in external password quality
25 checks and comes with an example that checks passwords against CrackLib.
26 However, in testing at Stanford, we found that CrackLib with its default
27 transform rules does not catch passwords that can be guessed using the
28 same dictionary with other tools, such as Jack the Ripper.
30 This plugin provides the ability to check password quality against the
31 standard version of CrackLib, or against a modified version of CrackLib
32 that only passes passwords that resist attacks from both Crack and Jack
33 the Ripper using the same rule sets. For Heimdal, it includes both a
34 program usable as an external password quality check and a plugin that
35 implements the dynamic module API. For MIT Kerberos (1.9 or later), it
36 includes a plugin for the password quality (pwqual) plugin API.
38 krb5-strength can be built with either the system CrackLib or with the
39 modified version of CrackLib included in this package. Note, however,
40 that if you're building against the system CrackLib, Heimdal includes in
41 the distribution a strength-checking plugin and an external password
42 check program that use the system CrackLib. With Heimdal, it would
43 probably be easier to use that plugin or program than build this package
44 unless you want the modified CrackLib.
46 For information about the changes to the CrackLib included in this
47 toolkit, see cracklib/HISTORY. The primary changes are tighter rules,
48 which are more aggressive at finding dictionary words with characters
49 appended and prepended, which tighten the requirements for password
50 entropy, and which add stricter rules for longer passwords. They are
51 also minor changes to fix portability issues and remove some code that
52 doesn't make sense in the kadmind context.
54 Ideally, the changes to CrackLib should be added to the standard
55 CrackLib distribution by adding an additional interface to configure its
56 behavior, at which point this package can likely wither away in favor of
57 much simpler plugins that link to the standard CrackLib library.
61 For Heimdal, you may use either the external password quality check
62 tool, installed as heimdal-strength, or the plugin as you choose. It
63 has been tested with Heimdal 1.2.1 and later, but has not recently been
64 tested with versions prior to 1.5.
66 For MIT Kerberos, version 1.9 or higher is required for the password
67 quality plugin interface. MIT Kerberos does not support an external
68 password quality check tool directly, so you will need to install the
71 You can optionally build against the system CrackLib library. Any
72 version should be supported, but note that some versions, particularly
73 older versions close to the original code, do things like printing
74 diagnostics to stderr, calling exit, and otherwise not being
75 well-behaved for use inside plugins or libraries. If using a system
76 CrackLib library, use version 2.8.22 or later to avoid these problems.
78 You can also optionally build against the TinyCDB library, which
79 provides support for simpler and faster password checking against a CDB
80 dictionary file. Building a CDB dictionary with cdbmake-wordlist
81 (included) requires Perl 5.006 or later and the CDB utility that comes
84 For this module to be effective for either Heimdal or MIT Kerberos, you
85 will also need to construct a dictionary. The mkdict and packer
86 utilities to build a CrackLib dictionary from a word list are included
87 in this toolkit but not installed by default. You can run them out of
88 the cracklib directory after building. You can also use the utilities
89 that come with the stock CrackLib package (often already packaged in a
90 Linux distribution); the database format is compatible. For building a
91 CDB dictionary, use the provided cdbmake-wordlist program. The CDB
92 utility must be on your PATH.
94 For a word list to use as source for the dictionary, you can use
95 /usr/share/dict/words if it's available on your system, but it would be
96 better to find a more comprehensive word list. Since word lists are
97 bulky, often covered by murky copyrights, and easily locatable on the
98 Internet with a modicum of searching, none are included in this toolkit.
100 To bootstrap from a Git checkout, or If you change the Automake files
101 and need to regenerate Makefile.in, you will need Automake 1.11 or
102 later. For bootstrap or if you change configure.ac or any of the m4
103 files it includes and need to regenerate configure or config.h.in, you
104 will need Autoconf 2.64 or later.
106 COMPILING AND INSTALLING
108 You can build and install the plugin with the standard commands:
114 Pass --enable-silent-rules to configure for a quieter build (similar to
115 the Linux kernel). Use make warnings instead of make to build with full
116 GCC compiler warnings (requires a relatively current version of GCC).
118 The last step will probably have to be done as root. By default, the
119 plugin is installed as /usr/local/lib/krb5/plugins/pwqual/strength.so
120 and the Heimdal external password check function is installed as
121 /usr/local/bin/heimdal-strength. You can change these paths with the
122 --prefix, --libdir, and --bindir options to configure.
124 To build with the system version of CrackLib, pass --with-cracklib to
125 configure. You can optionally add a directory, giving the root
126 directory where CrackLib was installed, or separately set the include
127 and library path with --with-cracklib-include and --with-cracklib-lib.
129 krb5-strength will automatically build with TinyCDB if it is found. To
130 specify the installation path of TinyCDB, use --with-tinycdb. You can
131 also separately set the include and library path with
132 --with-tinycdb-include and --with-tinycdb-lib.
134 Normally, configure will use krb5-config to determine the flags to use
135 to compile with your Kerberos libraries. If krb5-config isn't found, it
136 will look for the standard Kerberos libraries in locations already
137 searched by your compiler. If the the krb5-config script first in your
138 path is not the one corresponding to the Kerberos libraries you want to
139 use or if your Kerberos libraries and includes aren't in a location
140 searched by default by your compiler, you need to specify a different
141 Kerberos installation root via --with-krb5=PATH. For example:
143 ./configure --with-krb5=/usr/pubsw
145 You can also individually set the paths to the include directory and the
146 library directory with --with-krb5-include and --with-krb5-lib. You may
147 need to do this if Autoconf can't figure out whether to use lib, lib32,
148 or lib64 on your platform.
150 To specify a particular krb5-config script to use, either set the
151 PATH_KRB5_CONFIG environment variable or pass it to configure like:
153 ./configure PATH_KRB5_CONFIG=/path/to/krb5-config
155 To not use krb5-config and force library probing even if there is a
156 krb5-config script on your path, set PATH_KRB5_CONFIG to a nonexistent
159 ./configure PATH_KRB5_CONFIG=/nonexistent
161 krb5-config is not used and library probing is always done if either
162 --with-krb5-include or --with-krb5-lib are given.
164 You can pass the --enable-reduced-depends flag to configure to try to
165 minimize the shared library dependencies encoded in the binaries. This
166 omits from the link line all the libraries included solely because the
167 Kerberos libraries depend on them and instead links the programs only
168 against libraries whose APIs are called directly. This will only work
169 with shared Kerberos libraries and will only work on platforms where
170 shared libraries properly encode their own dependencies (such as Linux).
171 It is intended primarily for building packages for Linux distributions
172 to avoid encoding unnecessary shared library dependencies that make
173 shared library migrations more difficult. If none of the above made any
174 sense to you, don't bother with this flag.
178 First, build and install either a CrackLib dictionary as described in
179 REQUIREMENTS above, or build a CDB dictionary with cdbmake-wordlist.
180 (Or both.) The CrackLib dictionary will consist of three files, one
181 each ending in *.hwm, *.pwd, and *.pwi. The CDB dictionary will consist
182 of a single file ending in *.cdb. Install those files somewhere on your
183 system. Then, follow the relevant instructions below for either Heimdal
186 See "Other Settings" below for additional krb5.conf setting supported by
187 both Heimdal and MIT Kerberos.
191 There are two options: using an external password check program, or
192 using the plugin. I recommend the external password check program
193 unless you encounter speed problems with that approach that cause
196 For either approach, first add a stanza like the following to the
197 [appdefaults] section of your /etc/krb5.conf (or wherever your krb5.conf
201 password_dictionary = /path/to/cracklib/dictionary
202 password_dictionary_cdb = /path/to/cdb/dictionary.cdb
205 The first setting configures a CrackLib dictionary and the second a CDB
206 dictionary. The provided path should be the full path to the dictionary
207 files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
208 CrackLib dictionary. You can use either or both settings. If you use
209 both, CrackLib will be checked first, and then CDB.
211 Then, for the external password checking program, add a new section (or
212 modify the existing [password_quality] section) to look like the
216 policies = external-check
217 external_program = /usr/local/bin/heimdal-strength
219 You can, of course, combine this policy with others. Replace the path
220 with the full path to wherever you have installed heimdal-strength. You
221 can put this section in your kdc.conf instead of krb5.conf if you
224 If you want to instead use the module, use the following section
228 policies = krb5-strength
229 policy_libraries = /usr/local/lib/krb5/plugins/pwqual/strength.so
231 in either krb5.conf or kdc.conf. Note that some older versions of
232 Heimdal have a bug in the support for loading modules when
233 policy_libraries is set. If you get an error like:
235 didn't find `kadm5_password_verifier' symbol in `(null)'
237 you may have to omit policy_libraries in your configuration and instead
238 pass the --check-library argument to kpasswdd specifying the library to
243 To add this module to the list of password quality checks, add a section
244 to krb5.conf (or to a separate kdc.conf if you use that) like:
248 module = strength:/usr/local/lib/krb5/plugins/pwqual/strength.so
251 to register the plugin.
253 There are two ways to tell where the dictionary is. One option is to
254 use krb5.conf (and in this case you must use krb5.conf, even if you use
255 a separate kdc.conf file). For this approach, add the following to the
256 [appdefaults] section:
259 password_dictionary = /path/to/cracklib/dictionary
260 password_dictionary_cdb = /path/to/cdb/dictionary.cdb
263 The first setting configures a CrackLib dictionary and the second a CDB
264 dictionary. The provided path should be the full path to the dictionary
265 files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
266 CrackLib dictionary. You can use either or both settings. If you use
267 both, CrackLib will be checked first, and then CDB.
269 The second option is to use the normal dict_path setting. In the
270 [realms] section of your krb5.conf kdc.conf, under the appropriate realm
271 or realms, specify the path to the dictionary:
273 dict_file = /path/to/cracklib/dictionary
275 This will be taken as a CrackLib dictionary path, the same as the
276 setting for password_dictionary above. The provided path should be the
277 full path to the dictionary files, omitting the trailing *.hwm, *.pwd,
278 or *.pwi extension. However, be aware that, if you use this approach,
279 you will probably want to disable the built-in standard dict pwqual
280 plugin by adding the line:
284 to the pwqual block of the [plugins] section as shown above. Otherwise,
285 it will also try to load a dictionary at the same path to do simple
288 You can also mix and match these settings, by using dict_path for the
289 CrackLib dictionary path and krb5.conf for the CDB dictionary path. If
290 both settings are used, krb5.conf overrides the dict_path setting (so
291 that dict_path can be used for other password quality modules). There
292 is no way to specify a CDB dictionary via the dict_path setting.
296 The following additional settings are supported in the [appdefaults]
297 section of krb5.conf when running under either Heimdal or MIT Kerberos.
301 If set to a numeric value, passwords with fewer than that number of
302 characters will be rejected, independent of any length restrictions
303 in CrackLib. Note that this setting does not bypass the minimum
304 length requirements in CrackLib itself (which, for the version
305 embedded in this package, is eight characters).
307 require_ascii_printable
309 If set to a true boolean value, rejects any password that contains
310 non-ASCII characters or ASCII control characters. Spaces are
311 allowed; tabs are not (at least assuming the POSIX C locale). No
312 canonicalization or character set is defined for Kerberos passwords
313 in general, so you may want to reject non-ASCII characters to avoid
314 interoperability problems with computers with different default
315 character sets or Unicode normalization forms.
319 If set to a true boolean value, the password must contain at least
320 one character that is not a letter (uppercase or lowercase) or a
321 space. This may be helpful in combination with passphrases; users
322 may choose a stock English phrase, and this will force at least some
323 additional complexity.
325 You can omit any dictionary setting and only use the above settings, in
326 which case only the above checks and checks for passwords based on the
327 principal will be done, bypassing any dictionary check. (But for that
328 simple style of password strength checking, there are probably better
329 strength checking plugins already available.)
333 The krb5-strength web page at:
335 http://www.eyrie.org/~eagle/software/krb5-strength/
337 will always have the current version of this package, the current
338 documentation, and pointers to any additional resources.
340 I welcome bug reports and patches for this package at rra@stanford.edu.
341 However, please be aware that I tend to be extremely busy and work
342 projects often take priority. I'll save your mail and get to it as soon
343 as I can, but it may take me a couple of months.
347 krb5-strength is maintained using Git. You can access the current
348 source by cloning the repository at:
350 git://git.eyrie.org/kerberos/krb5-strength.git
352 or view the repository via the web at:
354 http://git.eyrie.org/?p=kerberos/krb5-strength.git
356 When contributing modifications, either patches (possibly generated by
357 git format-patch) or Git pull requests are welcome.
361 The krb5-strength package as a whole is covered by the following
362 copyright statement and license:
364 Copyright 2006, 2007, 2009, 2010, 2012, 2013
365 The Board of Trustees of the Leland Stanford Junior University
367 Permission is hereby granted, free of charge, to any person obtaining
368 a copy of this software and associated documentation files (the
369 "Software"), to deal in the Software without restriction, including
370 without limitation the rights to use, copy, modify, merge, publish,
371 distribute, sublicense, and/or sell copies of the Software, and to
372 permit persons to whom the Software is furnished to do so, subject to
373 the following conditions:
375 The above copyright notice and this permission notice shall be
376 included in all copies or substantial portions of the Software.
378 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
379 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
380 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
381 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
382 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
383 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
384 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
386 The embedded version of CrackLib (all files in the cracklib
387 subdirectory) is covered by the Artistic license. See the file
388 cracklib/LICENCE for more information. Combined derivative works that
389 include this code, such as binaries built with the embedded CrackLib,
390 will need to follow the terms of the Artistic license as well as the
393 All other individual files without an explicit exception below are
394 released under this license. Some files may have additional copyright
395 holders as noted in those files. There is detailed information about
396 the licensing of each file in the LICENSE file in this distribution.
398 Some files in this distribution are individually released under
399 different licenses, all of which are compatible with the above general
400 package license but which may require preservation of additional
401 notices. All required notices are preserved in the LICENSE file.