]> eyrie.org Git - kerberos/krb5-strength.git/blob - README
Document that checking against the principal is always done
[kerberos/krb5-strength.git] / README
1                             krb5-strength 1.1
2                (Kerberos password strength checking plugin)
3
4               Maintained by Russ Allbery <rra@stanford.edu>
5
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.
10
11   This software is distributed under a BSD-style license and under the
12   Artistic License.  Please see the section LICENSE for more information.
13
14 BLURB
15
16   krb5-strength provides mechanisms for checking the strength of Kerberos
17   passwords against an external dictionary when a user changes passwords
18   in a Kerberos KDC.  It is roughly equivalent to checking password
19   strength via CrackLib, except that it embeds a copy of Alec Muffett's
20   CrackLib that has been modified to perform slightly more strenuous
21   tests.  It supports both Heimdal and MIT Kerberos (1.9 or later).
22
23 DESCRIPTION
24
25   Heimdal includes a capability to plug in external password quality
26   checks and comes with an example that checks passwords against CrackLib.
27   However, in testing at Stanford, we found that CrackLib with its default
28   transform rules does not catch passwords that can be guessed using the
29   same dictionary with other tools, such as Jack the Ripper.
30
31   This plugin provides the ability to check password quality against the
32   standard version of CrackLib, or against a modified version of CrackLib
33   that only passes passwords that resist attacks from both Crack and Jack
34   the Ripper using the same rule sets.  For Heimdal, it includes both a
35   program usable as an external password quality check and a plugin that
36   implements the dynamic module API.  For MIT Kerberos (1.9 or later), it
37   includes a plugin for the password quality (pwqual) plugin API.
38
39   krb5-strength can be built with either the system CrackLib or with the
40   modified version of CrackLib included in this package.  Note, however,
41   that if you're building against the system CrackLib, Heimdal includes in
42   the distribution a strength-checking plugin and an external password
43   check program that use the system CrackLib.  With Heimdal, it would
44   probably be easier to use that plugin or program than build this package
45   unless you want the modified CrackLib.
46
47   For information about the changes to the CrackLib included in this
48   toolkit, see cracklib/HISTORY.  The primary changes are tighter rules,
49   which are more aggressive at finding dictionary words with characters
50   appended and prepended, which tighten the requirements for password
51   entropy, and which add stricter rules for longer passwords.  They are
52   also minor changes to fix portability issues and remove some code that
53   doesn't make sense in the kadmind context.
54
55   Ideally, the changes to CrackLib should be added to the standard
56   CrackLib distribution by adding an additional interface to configure its
57   behavior, at which point this package can likely wither away in favor of
58   much simpler plugins that link to the standard CrackLib library.
59
60 REQUIREMENTS
61
62   For Heimdal, you may use either the external password quality check
63   tool, installed as heimdal-strength, or the plugin as you choose.  It
64   has been tested with Heimdal 1.2.1 and later, but has not recently been
65   tested with versions prior to 1.5.
66
67   For MIT Kerberos, version 1.9 or higher is required for the password
68   quality plugin interface.  MIT Kerberos does not support an external
69   password quality check tool directly, so you will need to install the
70   plugin.
71
72   You can optionally build against the system CrackLib library.  Any
73   version should be supported, but note that some versions, particularly
74   older versions close to the original code, do things like printing
75   diagnostics to stderr, calling exit, and otherwise not being
76   well-behaved for use inside plugins or libraries.  If using a system
77   CrackLib library, use version 2.8.22 or later to avoid these problems.
78
79   You can also optionally build against the TinyCDB library, which
80   provides support for simpler and faster password checking against a CDB
81   dictionary file.  Building a CDB dictionary with cdbmake-wordlist
82   (included) requires Perl 5.006 or later and the CDB utility that comes
83   with TinyCDB.
84
85   For this module to be effective for either Heimdal or MIT Kerberos, you
86   will also need to construct a dictionary.  The mkdict and packer
87   utilities to build a CrackLib dictionary from a word list are included
88   in this toolkit but not installed by default.  You can run them out of
89   the cracklib directory after building.  You can also use the utilities
90   that come with the stock CrackLib package (often already packaged in a
91   Linux distribution); the database format is compatible.  For building a
92   CDB dictionary, use the provided cdbmake-wordlist program.  The CDB
93   utility must be on your PATH.
94
95   For a word list to use as source for the dictionary, you can use
96   /usr/share/dict/words if it's available on your system, but it would be
97   better to find a more comprehensive word list.  Since word lists are
98   bulky, often covered by murky copyrights, and easily locatable on the
99   Internet with a modicum of searching, none are included in this toolkit.
100
101   To bootstrap from a Git checkout, or If you change the Automake files
102   and need to regenerate Makefile.in, you will need Automake 1.11 or
103   later.  For bootstrap or if you change configure.ac or any of the m4
104   files it includes and need to regenerate configure or config.h.in, you
105   will need Autoconf 2.64 or later.
106
107 COMPILING AND INSTALLING
108
109   You can build and install the plugin with the standard commands:
110
111       ./configure
112       make
113       make install
114
115   Pass --enable-silent-rules to configure for a quieter build (similar to
116   the Linux kernel).  Use make warnings instead of make to build with full
117   GCC compiler warnings (requires a relatively current version of GCC).
118
119   The last step will probably have to be done as root.  By default, the
120   plugin is installed as /usr/local/lib/krb5/plugins/pwqual/strength.so
121   and the Heimdal external password check function is installed as
122   /usr/local/bin/heimdal-strength.  You can change these paths with the
123   --prefix, --libdir, and --bindir options to configure.
124
125   To build with the system version of CrackLib, pass --with-cracklib to
126   configure.  You can optionally add a directory, giving the root
127   directory where CrackLib was installed, or separately set the include
128   and library path with --with-cracklib-include and --with-cracklib-lib.
129
130   krb5-strength will automatically build with TinyCDB if it is found.  To
131   specify the installation path of TinyCDB, use --with-tinycdb.  You can
132   also separately set the include and library path with
133   --with-tinycdb-include and --with-tinycdb-lib.
134
135   Normally, configure will use krb5-config to determine the flags to use
136   to compile with your Kerberos libraries.  If krb5-config isn't found, it
137   will look for the standard Kerberos libraries in locations already
138   searched by your compiler.  If the the krb5-config script first in your
139   path is not the one corresponding to the Kerberos libraries you want to
140   use or if your Kerberos libraries and includes aren't in a location
141   searched by default by your compiler, you need to specify a different
142   Kerberos installation root via --with-krb5=PATH.  For example:
143
144       ./configure --with-krb5=/usr/pubsw
145
146   You can also individually set the paths to the include directory and the
147   library directory with --with-krb5-include and --with-krb5-lib.  You may
148   need to do this if Autoconf can't figure out whether to use lib, lib32,
149   or lib64 on your platform.
150
151   To specify a particular krb5-config script to use, either set the
152   PATH_KRB5_CONFIG environment variable or pass it to configure like:
153
154       ./configure PATH_KRB5_CONFIG=/path/to/krb5-config
155
156   To not use krb5-config and force library probing even if there is a
157   krb5-config script on your path, set PATH_KRB5_CONFIG to a nonexistent
158   path:
159
160       ./configure PATH_KRB5_CONFIG=/nonexistent
161
162   krb5-config is not used and library probing is always done if either
163   --with-krb5-include or --with-krb5-lib are given.
164
165   You can pass the --enable-reduced-depends flag to configure to try to
166   minimize the shared library dependencies encoded in the binaries.  This
167   omits from the link line all the libraries included solely because the
168   Kerberos libraries depend on them and instead links the programs only
169   against libraries whose APIs are called directly.  This will only work
170   with shared Kerberos libraries and will only work on platforms where
171   shared libraries properly encode their own dependencies (such as Linux).
172   It is intended primarily for building packages for Linux distributions
173   to avoid encoding unnecessary shared library dependencies that make
174   shared library migrations more difficult.  If none of the above made any
175   sense to you, don't bother with this flag.
176
177 CONFIGURATION
178
179   First, build and install either a CrackLib dictionary as described in
180   REQUIREMENTS above, or build a CDB dictionary with cdbmake-wordlist.
181   (Or both.)  The CrackLib dictionary will consist of three files, one
182   each ending in *.hwm, *.pwd, and *.pwi.  The CDB dictionary will consist
183   of a single file ending in *.cdb.  Install those files somewhere on your
184   system.  Then, follow the relevant instructions below for either Heimdal
185   or MIT Kerberos.
186
187   See "Other Settings" below for additional krb5.conf setting supported by
188   both Heimdal and MIT Kerberos.
189
190  Heimdal
191
192   There are two options: using an external password check program, or
193   using the plugin.  I recommend the external password check program
194   unless you encounter speed problems with that approach that cause
195   kpasswd to time out.
196
197   For either approach, first add a stanza like the following to the
198   [appdefaults] section of your /etc/krb5.conf (or wherever your krb5.conf
199   file is located):
200
201       krb5-strength = {
202           password_dictionary     = /path/to/cracklib/dictionary
203           password_dictionary_cdb = /path/to/cdb/dictionary.cdb
204       }
205
206   The first setting configures a CrackLib dictionary and the second a CDB
207   dictionary.  The provided path should be the full path to the dictionary
208   files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
209   CrackLib dictionary.  You can use either or both settings.  If you use
210   both, CrackLib will be checked first, and then CDB.
211
212   Then, for the external password checking program, add a new section (or
213   modify the existing [password_quality] section) to look like the
214   following:
215
216       [password_quality]
217           policies         = external-check
218           external_program = /usr/local/bin/heimdal-strength
219
220   You can, of course, combine this policy with others.  Replace the path
221   with the full path to wherever you have installed heimdal-strength.  You
222   can put this section in your kdc.conf instead of krb5.conf if you
223   prefer.
224
225   If you want to instead use the module, use the following section
226   instead:
227
228       [password_quality]
229           policies         = krb5-strength
230           policy_libraries = /usr/local/lib/krb5/plugins/pwqual/strength.so
231
232   in either krb5.conf or kdc.conf.  Note that some older versions of
233   Heimdal have a bug in the support for loading modules when
234   policy_libraries is set.  If you get an error like:
235
236       didn't find `kadm5_password_verifier' symbol in `(null)'
237
238   you may have to omit policy_libraries in your configuration and instead
239   pass the --check-library argument to kpasswdd specifying the library to
240   load.
241
242  MIT Kerberos
243
244   To add this module to the list of password quality checks, add a section
245   to krb5.conf (or to a separate kdc.conf if you use that) like:
246
247       [plugins]
248           pwqual = {
249               module = strength:/usr/local/lib/krb5/plugins/pwqual/strength.so
250           }
251
252   to register the plugin.
253
254   There are two ways to tell where the dictionary is.  One option is to
255   use krb5.conf (and in this case you must use krb5.conf, even if you use
256   a separate kdc.conf file).  For this approach, add the following to the
257   [appdefaults] section:
258
259       krb5-strength = {
260           password_dictionary     = /path/to/cracklib/dictionary
261           password_dictionary_cdb = /path/to/cdb/dictionary.cdb
262       }
263
264   The first setting configures a CrackLib dictionary and the second a CDB
265   dictionary.  The provided path should be the full path to the dictionary
266   files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
267   CrackLib dictionary.  You can use either or both settings.  If you use
268   both, CrackLib will be checked first, and then CDB.
269
270   The second option is to use the normal dict_path setting.  In the
271   [realms] section of your krb5.conf kdc.conf, under the appropriate realm
272   or realms, specify the path to the dictionary:
273
274       dict_file = /path/to/cracklib/dictionary
275
276   This will be taken as a CrackLib dictionary path, the same as the
277   setting for password_dictionary above.  The provided path should be the
278   full path to the dictionary files, omitting the trailing *.hwm, *.pwd,
279   or *.pwi extension.  However, be aware that, if you use this approach,
280   you will probably want to disable the built-in standard dict pwqual
281   plugin by adding the line:
282
283       disable = dict
284
285   to the pwqual block of the [plugins] section as shown above.  Otherwise,
286   it will also try to load a dictionary at the same path to do simple
287   dictionary matching.
288
289   You can also mix and match these settings, by using dict_path for the
290   CrackLib dictionary path and krb5.conf for the CDB dictionary path.  If
291   both settings are used, krb5.conf overrides the dict_path setting (so
292   that dict_path can be used for other password quality modules).  There
293   is no way to specify a CDB dictionary via the dict_path setting.
294
295  Other Settings
296
297   The following additional settings are supported in the [appdefaults]
298   section of krb5.conf when running under either Heimdal or MIT Kerberos.
299
300   minimum_length
301
302       If set to a numeric value, passwords with fewer than that number of
303       characters will be rejected, independent of any length restrictions
304       in CrackLib.  Note that this setting does not bypass the minimum
305       length requirements in CrackLib itself (which, for the version
306       embedded in this package, is eight characters).
307
308   require_ascii_printable
309
310       If set to a true boolean value, rejects any password that contains
311       non-ASCII characters or ASCII control characters.  Spaces are
312       allowed; tabs are not (at least assuming the POSIX C locale).  No
313       canonicalization or character set is defined for Kerberos passwords
314       in general, so you may want to reject non-ASCII characters to avoid
315       interoperability problems with computers with different default
316       character sets or Unicode normalization forms.
317
318   require_non_letter
319
320       If set to a true boolean value, the password must contain at least
321       one character that is not a letter (uppercase or lowercase) or a
322       space.  This may be helpful in combination with passphrases; users
323       may choose a stock English phrase, and this will force at least some
324       additional complexity.
325
326   You can omit any dictionary setting and only use the above settings, in
327   which case only the above checks and checks for passwords based on the
328   principal will be done, bypassing any dictionary check.  (But for that
329   simple style of password strength checking, there are probably better
330   strength checking plugins already available.)