]> eyrie.org Git - kerberos/krb5-strength.git/blob - README.md
Add changelog for new upstream release
[kerberos/krb5-strength.git] / README.md
1 # krb5-strength 3.1
2
3 Copyright 2016 Russ Allbery <eagle@eyrie.org>.  Copyright 2006-2007,
4 2009-2010, 2012-2014 The Board of Trustees of the Leland Stanford Junior
5 University.  Copyright 1993 Alec Muffett.  This software is distributed
6 under a BSD-style license.  Please see the section [License](#license)
7 below for more information.
8
9 ## Blurb
10
11 krb5-strength provides a password quality plugin for the MIT Kerberos KDC
12 (specifically the kadmind server) and Heimdal KDC, an external password
13 quality program for use with Heimdal, and a per-principal password history
14 implementation for Heimdal.  Passwords can be tested with CrackLib,
15 checked against a CDB or SQLite database of known weak passwords with some
16 transformations, checked for length, checked for non-printable or
17 non-ASCII characters that may be difficult to enter reproducibly, required
18 to contain particular character classes, or any combination of these
19 tests.
20
21 ## Description
22
23 Heimdal includes a capability to plug in external password quality checks
24 and comes with an example that checks passwords against CrackLib.
25 However, in testing at Stanford, we found that CrackLib with its default
26 transform rules does not catch passwords that can be guessed using the
27 same dictionary with other tools, such as Jack the Ripper.  We then
28 discovered other issues with CrackLib with longer passwords, such as some
29 bad assumptions about how certain measures of complexity will scale, and
30 wanted to impose other limitations that it didn't support.
31
32 This plugin provides the ability to check password quality against the
33 standard version of CrackLib, or against a modified version of CrackLib
34 that only passes passwords that resist attacks from both Crack and Jack
35 the Ripper using the same rule sets.  It also supports doing simpler
36 dictionary checks against a CDB database, which is fast with very large
37 dictionaries, or a SQLite database, which can reject all passwords within
38 edit distance one of a dictionary word.  It can also impose other
39 programmatic checks on passwords such as character class requirements.
40
41 If you're just now starting with password checking, I recommend using the
42 SQLite database with a large wordlist and minimum password lengths.  We
43 found this produced the best results with the least user frustration.
44
45 For Heimdal, krb5-strength includes both a program usable as an external
46 password quality check and a plugin that implements the dynamic module
47 API.  For MIT Kerberos (1.9 or later), it includes a plugin for the
48 password quality (pwqual) plugin API.
49
50 krb5-strength can be built with either the system CrackLib or with the
51 modified version of CrackLib included in this package.  Note, however,
52 that if you're building against the system CrackLib, Heimdal includes in
53 the distribution a strength-checking plugin and an external password check
54 program that use the system CrackLib.  With Heimdal, it would probably be
55 easier to use that plugin or program than build this package unless you
56 want the modified CrackLib, one of the other dictionary types, or the
57 additional character class and length checks.
58
59 For information about the changes to the CrackLib included in this
60 toolkit, see `cracklib/HISTORY`.  The primary changes are tighter rules,
61 which are more aggressive at finding dictionary words with characters
62 appended and prepended, which tighten the requirements for password
63 entropy, and which add stricter rules for longer passwords.  They are also
64 minor changes to fix portability issues, remove some code that doesn't
65 make sense in the kadmind context, and close a few security issues.  The
66 standard CrackLib distribution on at least some Linux distributions now
67 supports an additional interface to configure its behavior, and
68 krb5-strength should change in the future to use that interface and drop
69 the embedded copy.
70
71 krb5-strength also includes a password history implementation for Heimdal.
72 This is separate from the password strength implementation but can be
73 stacked with it so that both strength and history checks are performed.
74 This history implementation is available only via the Heimdal external
75 password quality interface.  MIT Kerberos includes its own password
76 history implementation.
77
78 ## Requirements
79
80 For Heimdal, you may use either the external password quality check tool,
81 installed as heimdal-strength, or the plugin as you choose.  It has been
82 tested with Heimdal 1.2.1 and later, but has not recently been tested with
83 versions prior to 1.5.
84
85 For MIT Kerberos, version 1.9 or higher is required for the password
86 quality plugin interface.  MIT Kerberos does not support an external
87 password quality check tool directly, so you will need to install the
88 plugin.
89
90 You can optionally build against the system CrackLib library.  Any version
91 should be supported, but note that some versions, particularly older
92 versions close to the original code, do things like printing diagnostics
93 to stderr, calling exit, and otherwise not being well-behaved for use
94 inside plugins or libraries.  They also have known security
95 vulnerabilities.  If using a system CrackLib library, use version 2.8.22
96 or later to avoid these problems.
97
98 You can also optionally build against the TinyCDB library, which provides
99 support for simpler and faster password checking against a CDB dictionary
100 file, and the SQLite library (a version new enough to support the
101 `sqlite3_open_v2` API; 3.7 should be more than sufficient), which provides
102 support for checking whether passwords are within edit distance one of a
103 dictionary word.
104
105 For this module to be effective for either Heimdal or MIT Kerberos, you
106 will also need to construct a dictionary.  The `mkdict` and `packer`
107 utilities to build a CrackLib dictionary from a word list are included in
108 this toolkit but not installed by default.  You can run them out of the
109 `cracklib` directory after building.  You can also use the utilities that
110 come with the stock CrackLib package (often already packaged in a Linux
111 distribution); the database format is compatible.
112
113 For building a CDB or SQLite dictionary, use the provided
114 `krb5-strength-wordlist` program.  For CDB dictionries, the `cdb` utility
115 must be on your `PATH`.  For SQLite, the DBI and DBD::SQLite Perl modules
116 are required.  `krb5-strength-wordlist` requires Perl 5.006 or later.
117
118 For a word list to use as source for the dictionary, you can use
119 `/usr/share/dict/words` if it's available on your system, but it would be
120 better to find a more comprehensive word list.  Since word lists are
121 bulky, often covered by murky copyrights, and easily locatable on the
122 Internet with a modicum of searching, none are included in this toolkit.
123
124 The password history program, heimdal-history, requires Perl 5.010 or
125 later plus the following CPAN modules:
126
127 * DB_File::Lock
128 * Crypt::PBKDF2
129 * Getopt::Long::Descriptive
130 * IPC::Run
131 * JSON
132 * Readonly
133
134 and their dependencies.
135
136 To run the test suite, you will need Perl 5.010 or later and the
137 dependencies of the `heimdal-history` program.  The following additional
138 Perl modules will also be used by the test suite if present:
139
140 * Perl6::Slurp
141 * Test::MinimumVersion
142 * Test::Perl::Critic
143 * Test::Pod
144 * Test::Spelling
145 * Test::Strict
146
147 All are available on CPAN.  Some tests will be skipped if the modules are
148 not available.
149
150 To enable tests that don't detect functionality problems but are used to
151 sanity-check the release, set the environment variable `RELEASE_TESTING`
152 to a true value.  To enable tests that may be sensitive to the local
153 environment or that produce a lot of false positives without uncovering
154 many problems, set the environment variable `AUTHOR_TESTING` to a true
155 value.
156
157 To bootstrap from a Git checkout, or if you change the Automake files and
158 need to regenerate Makefile.in, you will need Automake 1.11 or later.  For
159 bootstrap or if you change configure.ac or any of the m4 files it includes
160 and need to regenerate configure or config.h.in, you will need Autoconf
161 2.64 or later.  You will also need Perl 5.010 or later and the DBI,
162 DBD::SQLite, JSON, Perl6::Slurp, and Readonly modules (from CPAN) to
163 generate man pages and bootstrap the test suite data from a Git checkout.
164
165 ## Building and Installation
166
167 You can build and install krb5-strength with the standard commands:
168
169 ```
170     ./configure
171     make
172     make install
173 ```
174
175 If you are building from a Git clone, first run `./bootstrap` in the
176 source directory to generate the build files.  `make install` will
177 probably have to be done as root.  Building outside of the source
178 directory is also supported, if you wish, by creating an empty directory
179 and then running configure with the correct relative path.
180
181 By default, the Heimdal external password check function is installed as
182 `/usr/local/bin/heimdal-strength`, and the plugin is installed as
183 `/usr/local/lib/krb5/plugins/pwqual/strength.so`.  You can change these
184 paths with the `--prefix`, `--libdir`, and `--bindir` options to
185 configure.
186
187 By default, the embedded version of CrackLib will be used.  To build with
188 the system version of CrackLib, pass `--with-cracklib` to configure.  You
189 can optionally add a directory, giving the root directory where CrackLib
190 was installed, or separately set the include and library path with
191 `--with-cracklib-include` and `--with-cracklib-lib`.
192
193 krb5-strength will automatically build with TinyCDB if it is found.  To
194 specify the installation path of TinyCDB, use `--with-tinycdb`.  You can
195 also separately set the include and library path with
196 `--with-tinycdb-include` and `--with-tinycdb-lib`.
197
198 Similarly, krb5-strength will automatically build with SQLite if it is
199 found.  To specify the installation path of SQLite, use `--with-sqlite`.
200 You can also separately set the include and library path with
201 `--with-sqlite-include` and `--with-sqlite-lib`.
202
203 Normally, configure will use `krb5-config` to determine the flags to use
204 to compile with your Kerberos libraries.  To specify a particular
205 `krb5-config` script to use, either set the `PATH_KRB5_CONFIG` environment
206 variable or pass it to configure like:
207
208 ```
209     ./configure PATH_KRB5_CONFIG=/path/to/krb5-config
210 ```
211
212 If `krb5-config` isn't found, configure will look for the standard
213 Kerberos libraries in locations already searched by your compiler.  If the
214 the `krb5-config` script first in your path is not the one corresponding
215 to the Kerberos libraries you want to use, or if your Kerberos libraries
216 and includes aren't in a location searched by default by your compiler,
217 you need to specify a different Kerberos installation root via
218 `--with-krb5=PATH`.  For example:
219
220 ```
221     ./configure --with-krb5=/usr/pubsw
222 ```
223
224 You can also individually set the paths to the include directory and the
225 library directory with `--with-krb5-include` and `--with-krb5-lib`.  You
226 may need to do this if Autoconf can't figure out whether to use lib,
227 lib32, or lib64 on your platform.
228
229 To not use krb5-config and force library probing even if there is a
230 krb5-config script on your path, set PATH_KRB5_CONFIG to a nonexistent
231 path:
232
233 ```
234     ./configure PATH_KRB5_CONFIG=/nonexistent
235 ```
236
237 `krb5-config` is not used and library probing is always done if either
238 `--with-krb5-include` or `--with-krb5-lib` are given.
239
240 Pass `--enable-silent-rules` to configure for a quieter build (similar to
241 the Linux kernel).  Use `make warnings` instead of `make` to build with
242 full GCC compiler warnings (requires a relatively current version of GCC).
243
244 You can pass the `--enable-reduced-depends` flag to configure to try to
245 minimize the shared library dependencies encoded in the binaries.  This
246 omits from the link line all the libraries included solely because other
247 libraries depend on them and instead links the programs only against
248 libraries whose APIs are called directly.  This will only work with shared
249 libraries and will only work on platforms where shared libraries properly
250 encode their own dependencies (this includes most modern platforms such as
251 all Linux).  It is intended primarily for building packages for Linux
252 distributions to avoid encoding unnecessary shared library dependencies
253 that make shared library migrations more difficult.  If none of the above
254 made any sense to you, don't bother with this flag.
255
256 After installing this software, see the man pages for krb5-strength,
257 heimdal-strength, and heimdal-history for configuration information.
258
259 ## Testing
260
261 krb5-strength comes with a test suite, which you can run after building
262 with:
263
264 ```
265     make check
266 ```
267
268 If a test fails, you can run a single test with verbose output via:
269
270 ```
271     tests/runtests -o <name-of-test>
272 ```
273
274 Do this instead of running the test program directly since it will ensure
275 that necessary environment variables are set up.
276
277 ## Support
278
279 The [krb5-strength web
280 page](https://www.eyrie.org/~eagle/software/krb5-strength/) will always
281 have the current version of this package, the current documentation, and
282 pointers to any additional resources.
283
284 For bug tracking, use the [issue tracker on
285 GitHub](https://github.com/rra/krb5-strength/issues).  However, please be
286 aware that I tend to be extremely busy and work projects often take
287 priority.  I'll save your report and get to it as soon as I can, but it
288 may take me a couple of months.
289
290 ## Source Repository
291
292 krb5-strength is maintained using Git.  You can access the current source
293 on [GitHub](https://github.com/rra/krb5-strength) or by cloning the
294 repository at:
295
296 https://git.eyrie.org/git/kerberos/krb5-strength.git
297
298 or [view the repository on the
299 web](https://git.eyrie.org/?p=devel/krb5-strength.git).
300
301 The eyrie.org repository is the canonical one, maintained by the author,
302 but using GitHub is probably more convenient for most purposes.  Pull
303 requests are gratefully reviewed and normally accepted.
304
305 ## License
306
307 The krb5-strength package as a whole is covered by the following copyright
308 statement and license:
309
310 > Copyright 2016
311 >     Russ Allbery <eagle@eyrie.org>
312 >
313 > Copyright 2006-2007, 2009-2010, 2012-2014
314 >     The Board of Trustees of the Leland Stanford Junior University
315 >
316 > Copyright 1993
317 >     Alec Muffett
318 >
319 > Permission is hereby granted, free of charge, to any person obtaining a
320 > copy of this software and associated documentation files (the "Software"),
321 > to deal in the Software without restriction, including without limitation
322 > the rights to use, copy, modify, merge, publish, distribute, sublicense,
323 > and/or sell copies of the Software, and to permit persons to whom the
324 > Software is furnished to do so, subject to the following conditions:
325 >
326 > The above copyright notice and this permission notice shall be included in
327 > all copies or substantial portions of the Software.
328 >
329 > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
330 > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
331 > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
332 > THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
333 > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
334 > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
335 > DEALINGS IN THE SOFTWARE.
336 >
337 > Developed by Derrick Brashear and Ken Hornstein of Sine Nomine Associates,
338 > on behalf of Stanford University.
339 >
340 > The embedded version of CrackLib (all files in the `cracklib`
341 > subdirectory) is covered by the Artistic license.  See the file
342 > `cracklib/LICENCE` for more information.  Combined derivative works that
343 > include this code, such as binaries built with the embedded CrackLib, will
344 > need to follow the terms of the Artistic license as well as the above
345 > license.
346
347 Some files in this distribution are individually released under different
348 licenses, all of which are compatible with the above general package
349 license but which may require preservation of additional notices.  All
350 required notices, and detailed information about the licensing of each
351 file, are recorded in the LICENSE file.
352
353 For any copyright range specified by files in this package as YYYY-ZZZZ,
354 the range specifies every single year in that closed interval.