Setting up pw quality check - clhedrick/kerberos GitHub Wiki
Back to Setting up FreeIPA, KDC and LDAP
The same rules are enforced by two completely separate things: a Kerberos plugin, used for kpasswd, and code in the web password change tools. These contain separate implementation of the same rules, with separate databases of prohibited passwords.
I'm using https://www.eyrie.org/~eagle/software/krb5-strength/krb5-strength.html, with changes. Our changed version is in krb5-strength-3.1. Here are the instructions to set up the original:
- install source
- ./configure
- ./make
- yum install perl-DBI perl-DBD-SQLite
- for test script, also do yum install perl-File-Slurp perl-Test-MinimumVersion perl-Test-Pod perl-Test-Perl-Critic perl-Test-Spelling
- make check-local runs tests
It uses an SQLlite database. That is built in the tools directory in krb5-strength-3.1. Note that it has a file top1000000 that comes from NIST. The build is simple:
- ./krb5-strength-wordlist -s strengthcheck.sqlite -l 10 top1000000
To install:
- cp ./plugin/.libs/strength.so /usr/local/libexec/
- cp strengthcheck.sqlite /usr/local/etc/strengthcheck.sqlite
- The default IPA password policy requires multiple character classes, and has a minimum password life of an hour. Change it in IPA to one class and minimum of zero. Testing is very painful with a wait between changes, and I don't quite see why that policy would be needed.
- got a long list of words from weakpass, merged with /usr/share/dict/words, result in /usr/share/dict/words-crack
- tools/krb5-strength-wordlist -s database /usr/share/dict/words
- cp database /usr/local/etc
- cracklib/mkdict /usr/share/dict/words-crack | packer. This puts its output into /usr/share/cracklib
To install on a new server you need
- /usr/local/libexec/strength.so
- /usr/local/etc/strengthcheck.sqlite
- /usr/share/dict/words-crack
- /usr/share/dict/words.*
In krb5.conf
[appdefaults] krb5-strength = { password_dictionary = /usr/share/cracklib/pw_dict password_dictionary_sqlite = /usr/local/etc/strengthcheck.sqlite } [plugins] pwqual = { module = strength:/usr/local/libexec/strength.so disable = dict }
There appears to be a bug in the plugin. Despite documentation, you have to use cracklib, and it seems to ignore the password_dictionary spec in krb5.conf.
The password rules are also built into the web tool for changing your password.
It needs an HSQL database. it uses the same top1000000 file, but is built separately. See accounts/src/main/database. There's a README there telling how to build /var/www/tomcat/db.