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