]> eyrie.org Git - kerberos/krb5-strength.git/blob - README
Add support for new MIT plugin interface, drop old patch
[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   For this module to be effective for either Heimdal or MIT Kerberos, you
80   will also need to construct a dictionary.  The mkdict and packer
81   utilities to build a CrackLib dictionary from a word list are included
82   in this toolkit but not installed by default.  You can run them out of
83   the cracklib directory after building.  You can also use the utilities
84   that come with the stock CrackLib package (often already packaged in a
85   Linux distribution); the database format is compatible.
86
87   For a word list to use as source for the dictionary, you can use
88   /usr/share/dict/words if it's available on your system, but it would be
89   better to find a more comprehensive word list.  Since word lists are
90   bulky, often covered by murky copyrights, and easily locatable on the
91   Internet with a modicum of searching, none are included in this toolkit.
92
93   To bootstrap from a Git checkout, or If you change the Automake files
94   and need to regenerate Makefile.in, you will need Automake 1.11 or
95   later.  For bootstrap or if you change configure.ac or any of the m4
96   files it includes and need to regenerate configure or config.h.in, you
97   will need Autoconf 2.64 or later.
98
99 COMPILING AND INSTALLING
100
101   You can build and install the plugin with the standard commands:
102
103       ./configure
104       make
105       make install
106
107   Pass --enable-silent-rules to configure for a quieter build (similar to
108   the Linux kernel).  Use make warnings instead of make to build with full
109   GCC compiler warnings (requires a relatively current version of GCC).
110
111   The last step will probably have to be done as root.  By default, the
112   plugin is installed as /usr/local/lib/kadmind/passwd_strength.so and the
113   Heimdal external password check function is installed as
114   /usr/local/bin/heimdal-strength.  You can change these paths with the
115   --prefix, --libdir, and --bindir options to configure.
116
117   To build with the system version of CrackLib, pass --with-cracklib to
118   configure.  You can optionally add a directory, giving the root
119   directory where CrackLib was installed, or separately set the include
120   and library path with --with-cracklib-include and --with-cracklib-lib.
121
122   Normally, configure will use krb5-config to determine the flags to use
123   to compile with your Kerberos libraries.  If krb5-config isn't found, it
124   will look for the standard Kerberos libraries in locations already
125   searched by your compiler.  If the the krb5-config script first in your
126   path is not the one corresponding to the Kerberos libraries you want to
127   use or if your Kerberos libraries and includes aren't in a location
128   searched by default by your compiler, you need to specify a different
129   Kerberos installation root via --with-krb5=PATH.  For example:
130
131       ./configure --with-krb5=/usr/pubsw
132
133   You can also individually set the paths to the include directory and the
134   library directory with --with-krb5-include and --with-krb5-lib.  You may
135   need to do this if Autoconf can't figure out whether to use lib, lib32,
136   or lib64 on your platform.
137
138   To specify a particular krb5-config script to use, either set the
139   PATH_KRB5_CONFIG environment variable or pass it to configure like:
140
141       ./configure PATH_KRB5_CONFIG=/path/to/krb5-config
142
143   To not use krb5-config and force library probing even if there is a
144   krb5-config script on your path, set PATH_KRB5_CONFIG to a nonexistent
145   path:
146
147       ./configure PATH_KRB5_CONFIG=/nonexistent
148
149   krb5-config is not used and library probing is always done if either
150   --with-krb5-include or --with-krb5-lib are given.
151
152   You can pass the --enable-reduced-depends flag to configure to try to
153   minimize the shared library dependencies encoded in the binaries.  This
154   omits from the link line all the libraries included solely because the
155   Kerberos libraries depend on them and instead links the programs only
156   against libraries whose APIs are called directly.  This will only work
157   with shared Kerberos libraries and will only work on platforms where
158   shared libraries properly encode their own dependencies (such as Linux).
159   It is intended primarily for building packages for Linux distributions
160   to avoid encoding unnecessary shared library dependencies that make
161   shared library migrations more difficult.  If none of the above made any
162   sense to you, don't bother with this flag.
163
164 CONFIGURATION
165
166   First, build and install a CrackLib dictionary as described above.  This
167   dictionary will consist of three files, one each ending in *.hwm, *.pwd,
168   and *.pwi.  Install those files somewhere on your system.  Then, follow
169   the relevant instructions below for either Heimdal or MIT Kerberos.
170
171  Heimdal
172
173   There are two options: using an external password check program, or
174   using the plugin.  I recommend the external password check program
175   unless you encounter speed problems with that approach that cause
176   kpasswd to time out.
177
178   For either approach, first add a stanza like the following to the
179   [appdefaults] section of your /etc/krb5.conf (or wherever your krb5.conf
180   file is located):
181
182       krb5-strength = {
183           password_dictionary = /usr/local/lib/kadmind/dictionary
184       }
185
186   The provided path should be the full path to the dictionary files,
187   omitting the trailing *.hwm, *.pwd, and *.pwi extensions.
188
189   Then, for the external password checking program, add a new section (or
190   modify the existing [password_quality] section) to look like the
191   following:
192
193       [password_quality]
194           policies         = external-check
195           external_program = /usr/local/bin/heimdal-strength
196
197   You can, of course, combine this policy with others.  Replace the path
198   with the full path to wherever you have installed heimdal-strength.  You
199   can put this section in your kdc.conf instead of krb5.conf if you
200   prefer.
201
202   If you want to instead use the module, use the following section
203   instead:
204
205       [password_quality]
206           policies         = krb5-strength
207           policy_libraries = /usr/local/lib/kadmind/passwd_strength.so
208
209   in either krb5.conf or kdc.conf.  Note that some older versions of
210   Heimdal have a bug in the support for loading modules when
211   policy_libraries is set.  If you get an error like:
212
213       didn't find `kadm5_password_verifier' symbol in `(null)'
214
215   you may have to omit policy_libraries in your configuration and instead
216   pass the --check-library argument to kpasswdd specifying the library to
217   load.
218
219  MIT Kerberos
220
221   To add this module to the list of password quality checks, add a section
222   to krb5.conf (or to a separate kdc.conf if you use that) like:
223
224       [plugins]
225           pwqual = {
226               module = strength:/usr/local/lib/kadmind/passwd_strength.so
227           }
228
229   to register the plugin.
230
231   There are two ways to tell where the dictionary is.  One option is to
232   use krb5.conf (and in this case you must use krb5.conf, even if you use
233   a separate kdc.conf file).  For this approach, add the following to the
234   [appdefaults] section:
235
236       krb5-strength = {
237           password_dictionary = /path/to/cracklib/dictionary
238       }
239
240   The second option is to use the normal dict_path setting.  In the
241   [realms] section of your krb5.conf kdc.conf, under the appropriate realm
242   or realms, specify the path to the dictionary:
243
244       dict_file = /path/to/cracklib/dictionary
245
246   The provided path should be the full path to the dictionary files,
247   omitting the trailing *.hwm, *.pwd, or *.pwi extension.  However, be
248   aware that, if you use this approach, you will probably want to disable
249   the built-in standard dict pwqual plugin by adding the line:
250
251       disable = dict
252
253   to the pwqual block of the [plugins] section as shown above.  Otherwise,
254   it will also try to load a dictionary at the same path to do simple
255   dictionary matching.