]> eyrie.org Git - kerberos/krb5-strength.git/blobdiff - README
Merge branch 'debian' into squeeze
[kerberos/krb5-strength.git] / README
diff --git a/README b/README
index 43a8f12e00d7ff3dcc2527caf0f2bdbbd985186f..8d88ed46d3d63a3a54a9416adaafada9ef66def5 100644 (file)
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
-                            krb5-strength 2.1
+                            krb5-strength 3.0
                (Kerberos password strength checking plugin)
 
-              Maintained by Russ Allbery <rra@stanford.edu>
+               Maintained by Russ Allbery <eagle@eyrie.org>
 
-  Copyright 2006, 2007, 2009, 2010, 2012, 2013 The Board of Trustees of
-  the Leland Stanford Junior University.  Portions copyright 1993 Alec
+  Copyright 2006, 2007, 2009, 2010, 2012, 2013, 2014 The Board of Trustees
+  of the Leland Stanford Junior University.  Portions copyright 1993 Alec
   Muffett.  Developed by Derrick Brashear and Ken Hornstein of Sine Nomine
   Associates, on behalf of Stanford University.  This software is
   distributed under a BSD-style license and under the Artistic License.
 BLURB
 
   krb5-strength provides a password quality plugin for the MIT Kerberos
-  KDC (specifically the kadmind server) and an external password quality
-  program for use with the Heimdal kpasswdd server.  Passwords can be
-  tested with CrackLib, checked against a CDB database of known weak
-  passwords, checked for length, checked for non-printable or non-ASCII
-  characters that may be difficult to enter reproducibly, required to
-  contain a non-alphabetic character, or any combination of these tests.
-  It supports both Heimdal and MIT Kerberos (1.9 or later).
+  KDC (specifically the kadmind server), an external password quality
+  program for use with Heimdal, and a per-principal password history
+  implementation for Heimdal.  Passwords can be tested with CrackLib,
+  checked against a CDB or SQLite database of known weak passwords with
+  some transformations, checked for length, checked for non-printable or
+  non-ASCII characters that may be difficult to enter reproducibly,
+  required to contain particular character classes, or any combination of
+  these tests.  It supports both Heimdal and MIT Kerberos (1.9 or later).
 
 DESCRIPTION
 
@@ -27,15 +28,24 @@ DESCRIPTION
   checks and comes with an example that checks passwords against CrackLib.
   However, in testing at Stanford, we found that CrackLib with its default
   transform rules does not catch passwords that can be guessed using the
-  same dictionary with other tools, such as Jack the Ripper.
+  same dictionary with other tools, such as Jack the Ripper.  We then
+  discovered other issues with CrackLib with longer passwords, such as
+  some bad assumptions about how certain measures of complexity will
+  scale, and wanted to impose other limitations that it didn't support.
 
   This plugin provides the ability to check password quality against the
   standard version of CrackLib, or against a modified version of CrackLib
   that only passes passwords that resist attacks from both Crack and Jack
-  the Ripper using the same rule sets.  For Heimdal, it includes both a
-  program usable as an external password quality check and a plugin that
-  implements the dynamic module API.  For MIT Kerberos (1.9 or later), it
-  includes a plugin for the password quality (pwqual) plugin API.
+  the Ripper using the same rule sets.  It also supports doing simpler
+  dictionary checks against a CDB database, which is fast with very large
+  dictionaries, or a SQLite database, which can reject all passwords
+  within edit distance one of a dictionary word.  It can also impose other
+  programmatic checks on passwords such as character class requirements.
+
+  For Heimdal, it includes both a program usable as an external password
+  quality check and a plugin that implements the dynamic module API.  For
+  MIT Kerberos (1.9 or later), it includes a plugin for the password
+  quality (pwqual) plugin API.
 
   krb5-strength can be built with either the system CrackLib or with the
   modified version of CrackLib included in this package.  Note, however,
@@ -58,6 +68,13 @@ DESCRIPTION
   behavior, at which point this package can likely wither away in favor of
   much simpler plugins that link to the standard CrackLib library.
 
+  krb5-strength also includes a password history implementation for
+  Heimdal.  This is separate from the password strength implementation but
+  can be stacked with it so that both strength and history checks are
+  performed.  This history implementation is available only via the
+  Heimdal external password quality interface.  MIT Kerberos includes its
+  own password history implementation.
+
 REQUIREMENTS
 
   For Heimdal, you may use either the external password quality check
@@ -79,9 +96,10 @@ REQUIREMENTS
 
   You can also optionally build against the TinyCDB library, which
   provides support for simpler and faster password checking against a CDB
-  dictionary file.  Building a CDB dictionary with cdbmake-wordlist
-  (included) requires Perl 5.006 or later and the CDB utility that comes
-  with TinyCDB.
+  dictionary file, and the SQLite library (a version new enough to support
+  the sqlite3_open_v2 API; 3.7 should be more than sufficient), which
+  provides support for checking whether passwords are within edit distance
+  one of a dictionary word.
 
   For this module to be effective for either Heimdal or MIT Kerberos, you
   will also need to construct a dictionary.  The mkdict and packer
@@ -89,9 +107,12 @@ REQUIREMENTS
   in this toolkit but not installed by default.  You can run them out of
   the cracklib directory after building.  You can also use the utilities
   that come with the stock CrackLib package (often already packaged in a
-  Linux distribution); the database format is compatible.  For building a
-  CDB dictionary, use the provided cdbmake-wordlist program.  The CDB
-  utility must be on your PATH.
+  Linux distribution); the database format is compatible.
+
+  For building a CDB or SQLite dictionary, use the provided
+  krb5-strength-wordlist program.  For CDB dictionries, the cdb utility
+  must be on your PATH.  For SQLite, the DBI and DBD::SQLite Perl modules
+  are required.  krb5-strength-wordlist requires Perl 5.006 or later.
 
   For a word list to use as source for the dictionary, you can use
   /usr/share/dict/words if it's available on your system, but it would be
@@ -99,31 +120,46 @@ REQUIREMENTS
   bulky, often covered by murky copyrights, and easily locatable on the
   Internet with a modicum of searching, none are included in this toolkit.
 
-  To run the test suite, you will also need Perl 5.006 or later.  The
-  following additional Perl modules will be used by the test suite if
-  present:
+  The password history program, heimdal-history, requires Perl 5.010 or
+  later plus the following CPAN modules:
 
-      File::Slurp
+      DB_File::Lock
+      Crypt::PBKDF2
+      Getopt::Long::Descriptive
       IPC::Run
       JSON
+      Readonly
+
+  and their dependencies.
+
+  To run the test suite, you will need Perl 5.010 or later and the
+  dependencies of the heimdal-history program.  The following additional
+  Perl modules will also be used by the test suite if present:
+
+      Perl6::Slurp
       Test::MinimumVersion
       Test::Perl::Critic
       Test::Pod
       Test::Spelling
       Test::Strict
 
-  All are available on CPAN.  Those tests will be skipped if the modules
+  All are available on CPAN.  Some tests will be skipped if the modules
   are not available.
 
-  To enable tests that may be sensitive to the local environment or that
-  produce a lot of false positives without uncovering many problems, set
-  RRA_MAINTAINER_TESTS to a true value.
+  To enable tests that don't detect functionality problems but are used to
+  sanity-check the release, set the environment variable RELEASE_TESTING
+  to a true value.  To enable tests that may be sensitive to the local
+  environment or that produce a lot of false positives without uncovering
+  many problems, set the environment variable AUTHOR_TESTING to a true
+  value.
 
   To bootstrap from a Git checkout, or If you change the Automake files
   and need to regenerate Makefile.in, you will need Automake 1.11 or
   later.  For bootstrap or if you change configure.ac or any of the m4
   files it includes and need to regenerate configure or config.h.in, you
-  will need Autoconf 2.64 or later.
+  will need Autoconf 2.64 or later.  You will also need Perl 5.010 or
+  later and the DBI, DBD::SQLite, JSON, Perl6::Slurp, and Readonly modules
+  (from CPAN) to bootstrap the test suite data from a Git checkout.
 
 COMPILING AND INSTALLING
 
@@ -153,6 +189,11 @@ COMPILING AND INSTALLING
   also separately set the include and library path with
   --with-tinycdb-include and --with-tinycdb-lib.
 
+  Similarly, krb5-strength will automatically build with SQLite if it is
+  found.  To specify the installation path of SQLite, use --with-sqlite.
+  You can also separately set the include and library path with
+  --with-sqlite-include and --with-sqlite-lib.
+
   Normally, configure will use krb5-config to determine the flags to use
   to compile with your Kerberos libraries.  If krb5-config isn't found, it
   will look for the standard Kerberos libraries in locations already
@@ -198,12 +239,13 @@ COMPILING AND INSTALLING
 CONFIGURATION
 
   First, build and install either a CrackLib dictionary as described in
-  REQUIREMENTS above, or build a CDB dictionary with cdbmake-wordlist.
-  (Or both.)  The CrackLib dictionary will consist of three files, one
-  each ending in *.hwm, *.pwd, and *.pwi.  The CDB dictionary will consist
-  of a single file ending in *.cdb.  Install those files somewhere on your
-  system.  Then, follow the relevant instructions below for either Heimdal
-  or MIT Kerberos.
+  REQUIREMENTS above, or build a CDB or SQLite dictionary with
+  krb5-strength-wordlist.  (Or any combination thereof.)  The CrackLib
+  dictionary will consist of three files, one each ending in *.hwm, *.pwd,
+  and *.pwi.  The CDB and SQLite dictionaries will be single files,
+  conventionally ending in *.cdb and *.sqlite respectively.  Install those
+  files somewhere on your system.  Then, follow the relevant instructions
+  below for either Heimdal or MIT Kerberos.
 
   See "Other Settings" below for additional krb5.conf setting supported by
   both Heimdal and MIT Kerberos.
@@ -220,15 +262,28 @@ CONFIGURATION
   file is located):
 
       krb5-strength = {
-          password_dictionary     = /path/to/cracklib/dictionary
-          password_dictionary_cdb = /path/to/cdb/dictionary.cdb
+          password_dictionary        = /path/to/cracklib/dictionary
+          password_dictionary_cdb    = /path/to/cdb/dictionary.cdb
+          password_dictionary_sqlite = /path/to/sqlite/dictionary.sqlite
       }
 
-  The first setting configures a CrackLib dictionary and the second a CDB
-  dictionary.  The provided path should be the full path to the dictionary
-  files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
-  CrackLib dictionary.  You can use either or both settings.  If you use
-  both, CrackLib will be checked first, and then CDB.
+  The first setting configures a CrackLib dictionary, the second a CDB
+  dictionary, and the third a SQLite dictionary.  The provided path should
+  be the full path to the dictionary files, omitting the trailing *.hwm,
+  *.pwd, and *.pwi extensions for the CrackLib dictionary.  You can use
+  any combination of the three settings.  If you use more than one,
+  CrackLib will be checked first, then CDB, and then SQLite as
+  appropriate.
+
+  When checking against a CDB database, the password, the password with
+  the first character removed, the last character removed, the first and
+  last characters removed, the first two characters removed, and the last
+  two characters removed will all be checked against the dictionary.
+
+  When checking a SQLite database, the password will be rejected if it is
+  within edit distance one of any word in the dictionary, meaning that the
+  database word can be formed from the password by deleting, adding, or
+  changing a single character.
 
   Then, for the external password checking program, add a new section (or
   modify the existing [password_quality] section) to look like the
@@ -260,6 +315,30 @@ CONFIGURATION
   pass the --check-library argument to kpasswdd specifying the library to
   load.
 
+  Additional configuration is required to use the history implementation.
+  Ensure that its dependencies are installed, and then examine the local
+  configuration settings at the top of the heimdal-history program.  By
+  default, it requires a _history user and _history group be present on
+  the system, and all history information will be read and written as that
+  user and group.  It also requires a nobody user and nogroup group to be
+  present, and all strength checking will be done as that user and group.
+  It uses various files in /var/lib/heimdal-history to store history and
+  statistical information by default, so if using the defaults, create
+  that directory and ensure it is writable by the _history user.
+
+  Once that setup is done, change your [password_quality] configuration
+  to:
+
+      [password_quality]
+          policies         = external-check
+          external_program = /usr/local/bin/heimdal-history
+
+  The heimdal-history program will automatically also run heimdal-strength
+  as well, looking for it in /usr/local/bin, /usr/bin, and /bin.  Change
+  the PATH setting at the top of the script if you have different
+  requirements.  You should continue to configure heimdal-strength as if
+  you were running it directly.
+
  MIT Kerberos
 
   To add this module to the list of password quality checks, add a section
@@ -278,15 +357,28 @@ CONFIGURATION
   [appdefaults] section:
 
       krb5-strength = {
-          password_dictionary     = /path/to/cracklib/dictionary
-          password_dictionary_cdb = /path/to/cdb/dictionary.cdb
+          password_dictionary        = /path/to/cracklib/dictionary
+          password_dictionary_cdb    = /path/to/cdb/dictionary.cdb
+          password_dictionary_sqlite = /path/to/sqlite/dictionary.sqlite
       }
 
-  The first setting configures a CrackLib dictionary and the second a CDB
-  dictionary.  The provided path should be the full path to the dictionary
-  files, omitting the trailing *.hwm, *.pwd, and *.pwi extensions for the
-  CrackLib dictionary.  You can use either or both settings.  If you use
-  both, CrackLib will be checked first, and then CDB.
+  The first setting configures a CrackLib dictionary, the second a CDB
+  dictionary, and the third a SQLite dictionary.  The provided path should
+  be the full path to the dictionary files, omitting the trailing *.hwm,
+  *.pwd, and *.pwi extensions for the CrackLib dictionary.  You can use
+  any combination of the three settings.  If you use more than one,
+  CrackLib will be checked first, then CDB, and then SQLite as
+  appropriate.
+
+  When checking against a CDB database, the password, the password with
+  the first character removed, the last character removed, the first and
+  last characters removed, the first two characters removed, and the last
+  two characters removed will all be checked against the dictionary.
+
+  When checking a SQLite database, the password will be rejected if it is
+  within edit distance one of any word in the dictionary, meaning that the
+  database word can be formed from the password by deleting, adding, or
+  changing a single character.
 
   The second option is to use the normal dict_path setting.  In the
   [realms] section of your krb5.conf kdc.conf, under the appropriate realm
@@ -308,16 +400,25 @@ CONFIGURATION
   dictionary matching.
 
   You can also mix and match these settings, by using dict_path for the
-  CrackLib dictionary path and krb5.conf for the CDB dictionary path.  If
-  both settings are used, krb5.conf overrides the dict_path setting (so
-  that dict_path can be used for other password quality modules).  There
-  is no way to specify a CDB dictionary via the dict_path setting.
+  CrackLib dictionary path and krb5.conf for the CDB or SQLite dictionary
+  paths.  If both settings are used for the CrackLib path, krb5.conf
+  overrides the dict_path setting (so that dict_path can be used for other
+  password quality modules).  There is no way to specify a CDB or SQLite
+  dictionary via the dict_path setting.
 
  Other Settings
 
   The following additional settings are supported in the [appdefaults]
   section of krb5.conf when running under either Heimdal or MIT Kerberos.
 
+  minimum_different
+
+      If set to a numeric value, passwords with fewer than this number of
+      unique characters will be rejected.  This can be used to reject, for
+      example, passwords that are long strings of the same character or
+      repetitions of small numbers of characters, which may be too easy to
+      guess.
+
   minimum_length
 
       If set to a numeric value, passwords with fewer than that number of
@@ -336,6 +437,46 @@ CONFIGURATION
       interoperability problems with computers with different default
       character sets or Unicode normalization forms.
 
+  require_classes
+
+      This option allows specification of more complex character class
+      requirements.  The value of this parameter should be one or more
+      whitespace-separated rule.  Each rule has the syntax:
+
+          [<min>-<max>:]<class>[,<class>...]
+
+      where <class> is one of "upper", "lower", "digit", or "symbol"
+      (without the quote marks).  The symbol class includes all characters
+      other than alphanumeric characters, including space.  The listed
+      classes must appear in the password.  Separate multiple required
+      classes with a comma (and no space).
+
+      The character class checks will be done in whatever locale the
+      plugin or password check program is run in, which will normally be
+      the POSIX C locale but may be different depending on local
+      configuration.
+
+      A simple example:
+
+          require_classes = upper,lower,digit
+
+      This requires all passwords contain at least one uppercase letter,
+      at least one lowercase letter, and at least one digit.
+
+      If present, <min> and <max> specify the minimum password length and
+      maximum password length to which this rule applies.  This allows one
+      to specify character class requirements that change with password
+      length.  So, for example:
+
+          require_classes = 8-19:upper,lower 8-15:digit 8-11:symbol
+
+      requires all passwords from 8 to 11 characters long contain all four
+      character classes, passwords from 12 to 15 characters long contain
+      upper and lower case and a digit, and passwords from 16 to 19
+      characters long contain both upper and lower case.  Passowrds longer
+      than 20 characters have no character class restrictions.  (This
+      example is probably used in conjunction with minimum_length = 8.)
+
   require_non_letter
 
       If set to a true boolean value, the password must contain at least
@@ -359,7 +500,7 @@ SUPPORT
   will always have the current version of this package, the current
   documentation, and pointers to any additional resources.
 
-  I welcome bug reports and patches for this package at rra@stanford.edu.
+  I welcome bug reports and patches for this package at eagle@eyrie.org.
   However, please be aware that I tend to be extremely busy and work
   projects often take priority.  I'll save your mail and get to it as soon
   as I can, but it may take me a couple of months.
@@ -383,7 +524,7 @@ LICENSE
   The krb5-strength package as a whole is covered by the following
   copyright statement and license:
 
-    Copyright 2006, 2007, 2009, 2010, 2012, 2013
+    Copyright 2006, 2007, 2009, 2010, 2012, 2013, 2014
         The Board of Trustees of the Leland Stanford Junior University
 
     Permission is hereby granted, free of charge, to any person obtaining