ppm.c - OpenLDAP password policy module
version 2.0
ppm.c is an OpenLDAP module for checking password quality when they are modified.
Passwords are checked against the presence or absence of certain character classes.
This module is used as an extension of the OpenLDAP password policy controls,
see slapo-ppolicy(5) section pwdCheckModule.
contributions
-------------
* 2014 - 2021 - David Coutadeur <david.coutadeur@gmail.com> - maintainer
* 2015 - Daly Chikhaoui - Janua <dchikhaoui@janua.fr> - contribution on RDN checks
* 2017 - tdb - Tim Bishop - contribution on some compilation improvements
INSTALLATION
------------
See INSTALL file
USAGE
-----
Create a password policy entry and indicate the path of the ppm.so library
and the content of the desired policy.
Use a base64 tool to code / decode the content of the policy stored into
pwdCheckModuleArg. Here is an example:
```
dn: cn=default,ou=policies,dc=my-domain,dc=com
objectClass: pwdPolicy
objectClass: top
objectClass: pwdPolicyChecker
objectClass: person
pwdCheckQuality: 2
pwdAttribute: userPassword
sn: default
cn: default
pwdMinLength: 6
pwdCheckModule: /usr/local/lib/ppm.so
pwdCheckModuleArg:: bWluUXVhbGl0eSAzCmNoZWNrUkROIDAKZm9yYmlkZGVuQ2hhcnMKbWF4Q29uc2VjdXRpdmVQZXJDbGFzcyAwCnVzZUNyYWNrbGliIDAKY3JhY2tsaWJEaWN0IC92YXIvY2FjaGUvY3JhY2tsaWIvY3JhY2tsaWJfZGljdApjbGFzcy11cHBlckNhc2UgQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVogMCAxCmNsYXNzLWxvd2VyQ2FzZSBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5eiAwIDEKY2xhc3MtZGlnaXQgMDEyMzQ1Njc4OSAwIDEKY2xhc3Mtc3BlY2lhbCA8Piw/Oy46LyHCp8O5JSrCtV7CqCTCo8KyJsOpfiIjJ3soWy18w6hgX1zDp17DoEApXcKwPX0rIDAgMQ==
```
See slapo-ppolicy for more information, but to sum up:
- enable ppolicy overlay in your database.
This example show the activation for a slapd.conf file
(see slapd-config and slapo-ppolicy for more information for
cn=config configuration)
```
overlay ppolicy
ppolicy_default "cn=default,ou=policies,dc=my-domain,dc=com"
#ppolicy_use_lockout # for having more infos about the lockout
```
- define a default password policy in OpenLDAP configuration or
use pwdPolicySubentry attribute to point to the given policy.
Password checks
---------------
- 4 character classes are defined by default:
upper case, lower case, digits and special characters.
- more character classes can be defined, just write your own.
- passwords must match the amount of quality points.
A point is validated when at least m characters of the corresponding
character class are present in the password.
- passwords must have at least n of the corresponding character class
present, else they are rejected.
- the two previous criteria are checked against any specific character class
defined.
- if a password contains any of the forbidden characters, then it is
rejected.
- if a password contains tokens from the RDN, then it is rejected.
- if a password is too long, it can be rejected.
- if a password does not pass cracklib check, it can be rejected.
Configuration
-------------
Since OpenLDAP 2.5 version, ppm configuration is held in a binary
attribute of the password policy: pwdCheckModuleArg
The example file (/etc/openldap/ppm.example by default) is to be
considered as an example configuration, to import in the pwdCheckModuleArg
attribute. It is also used for testing passwords with the test program
provided.
If for some reasons, any parameter is not found, it will be given its
default value.
Note: you can still compile ppm to use the configuration file, by enabling
PPM_READ_FILE in ppm.h (but this is deprecated now). If you decide to do so,
you can use the PPM_CONFIG_FILE environment variable for overloading the
configuration file path.
The syntax of a configuration line is:
parameter value [min] [minForPoint]
with spaces being delimiters and Line Feed (LF) ending the line.
Parameter names ARE case sensitive.
The default configuration is the following:
```
# minQuality parameter
# Format:
# minQuality [NUMBER]
# Description:
# One point is granted for each class for which MIN_FOR_POINT criteria is fulfilled.
# defines the minimum point numbers for the password to be accepted.
minQuality 3
# checkRDN parameter
# Format:
# checkRDN [0 | 1]
# Description:
# If set to 1, password must not contain a token from the RDN.
# Tokens are separated by the following delimiters : space tabulation _ - , ; £
checkRDN 0
# forbiddenChars parameter
# Format:
# forbiddenChars [CHARACTERS_FORBIDDEN]
# Description:
# Defines the forbidden characters list (no separator).
# If one of them is found in the password, then it is rejected.
forbiddenChars
# maxConsecutivePerClass parameter
# Format:
# maxConsecutivePerClass [NUMBER]
# Description:
# Defines the maximum number of consecutive character allowed for any class
maxConsecutivePerClass 0
# useCracklib parameter
# Format:
# useCracklib [0 | 1]
# Description:
# If set to 1, the password must pass the cracklib check
useCracklib 0
# cracklibDict parameter
# Format:
# cracklibDict [path_to_cracklib_dictionary]
# Description:
# directory+filename-prefix that your version of CrackLib will go hunting for
# For example, /var/pw_dict resolves as /var/pw_dict.pwd,
# /var/pw_dict.pwi and /var/pw_dict.hwm dictionary files
cracklibDict /var/cache/cracklib/cracklib_dict
# classes parameter
# Format:
# class-[CLASS_NAME] [CHARACTERS_DEFINING_CLASS] [MIN] [MIN_FOR_POINT]
# Description:
# [CHARACTERS_DEFINING_CLASS]: characters defining the class (no separator)
# [MIN]: If at least [MIN] characters of this class is not found in the password, then it is rejected
# [MIN_FOR_POINT]: one point is granted if password contains at least [MIN_FOR_POINT] character numbers of this class
class-upperCase ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 1
class-lowerCase abcdefghijklmnopqrstuvwxyz 0 1
class-digit 0123456789 0 1
class-special <>,?;.:/!§ù%*µ^¨$£²&é~"#'{([-|è`_\ç^à@)]°=}+ 0 1
```
Example
-------
With this policy:
```
minQuality 4
forbiddenChars .?,
checkRDN 1
class-upperCase ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 5
class-lowerCase abcdefghijklmnopqrstuvwxyz 0 12
class-digit 0123456789 0 1
class-special <>,?;.:/!§ù%*µ^¨$£²&é~"#'{([-|è`_\ç^à@)]°=}+ 0 1
class-myClass :) 1 1``
```
the password
ThereIsNoCowLevel)
is working, because,
- it has 4 character classes validated : upper, lower, special, and myClass
- it has no character among .?,
- it has at least one character among : or )
but it won't work for the user uid=John Cowlevel,ou=people,cn=example,cn=com,
because the token "Cowlevel" from his RDN exists in the password (case insensitive).
Logs
----
If a user password is rejected by ppm, the user will get this type of message:
Typical user message from ldappasswd(5):
Result: Constraint violation (19)
Additional info: Password for dn=\"%s\" does not pass required number of strength checks (2 of 3)
A more detailed message is written to the server log.
Server log:
```
Feb 26 14:46:10 debian-10-64 slapd[1981]: conn=1000 op=16 MOD dn="uid=user,ou=persons,dc=my-domain,dc=com"
Feb 26 14:46:10 debian-10-64 slapd[1981]: conn=1000 op=16 MOD attr=userPassword
Feb 26 14:46:10 debian-10-64 slapd[1981]: ppm: entry uid=user,ou=persons,dc=my-domain,dc=com
Feb 26 14:46:10 debian-10-64 slapd[1981]: ppm: Reading pwdCheckModuleArg attribute
Feb 26 14:46:10 debian-10-64 slapd[1981]: ppm: RAW configuration: # minQuality parameter#012# Format:#012# minQuality [NUMBER]#012# Description:#012# One point is granted for each class for which MIN_FOR_POINT criteria is fulfilled.#012# defines the minimum point numbers for the password to be accepted.#012minQuality 3#012#012# checkRDN parameter#012# Format:#012# checkRDN [0 | 1]#012# Description:#012# If set to 1, password must not contain a token from the RDN.#012# Tokens are separated by the following delimiters : space tabulation _ - , ; £#012checkRDN 0#012#012# forbiddenChars parameter#012# Format:#012# forbiddenChars [CHARACTERS_FORBIDDEN]#012# Description:#012# Defines the forbidden characters list (no separator).#012# If one of them i
没有合适的资源?快使用搜索试试~ 我知道了~
openldap-2.5.4
需积分: 11 2 下载量 148 浏览量
2022-07-05
23:50:27
上传
评论
收藏 6.12MB TGZ 举报
温馨提示
共1954个文件
c:547个
h:168个
ldif:160个
openldap-2.5.4
资源详情
资源评论
资源推荐
收起资源包目录
openldap-2.5.4 (1954个子文件)
modrdn.out.provider.0 19KB
do_modify.0 429B
do_modrdn.0 295B
do_read.0 275B
do_search.0 241B
do_bind.0 233B
do_search.0 192B
do_read.0 126B
do_modrdn.0 74B
do_bind.0 39B
ldapsearch.1 13KB
ldapmodify.1 8KB
ldapmodrdn.1 6KB
ldapdelete.1 6KB
ldapcompare.1 6KB
ldapexop.1 6KB
ldappasswd.1 5KB
ldapwhoami.1 4KB
ldapurl.1 4KB
mdb_load.1 3KB
LICENSE-2.0.1 2KB
mdb_dump.1 2KB
mdb_stat.1 2KB
mdb_copy.1 1KB
modrdn.out.provider.1 623B
do_add.1 600B
do_add.1 228B
modrdn.out.provider.2 605B
do_add.2 600B
do_add.2 261B
ldap_get_option.3 21KB
lber-decode.3 12KB
ldap_bind.3 11KB
ldap_sync.3 10KB
lber-encode.3 9KB
ldap_schema.3 9KB
ldap.3 8KB
ldap_get_dn.3 6KB
lber-types.3 6KB
ldap_open.3 6KB
ldap_error.3 6KB
lber-sockbuf.3 5KB
ldap_search.3 4KB
ldap_result.3 4KB
ldap_parse_result.3 4KB
ldap_modify.3 4KB
ldap_dup.3 3KB
ldap_url.3 3KB
ldap_controls.3 3KB
ldap_get_values.3 2KB
ldap_rename.3 2KB
ldap_first_message.3 2KB
ldap_delete.3 2KB
ldap_extended_operation.3 2KB
ldap_first_entry.3 2KB
ldap_first_attribute.3 2KB
ldap_parse_reference.3 2KB
ldap_first_reference.3 2KB
ldap_parse_vlv_control.3 2KB
ldap_compare.3 2KB
ldap_modrdn.3 2KB
ldap_add.3 2KB
ldap_abandon.3 2KB
ldap_tls.3 1KB
ldap_parse_sort_control.3 1KB
ldap_memory.3 1KB
lber-memory.3 1KB
modrdn.out.provider.3 599B
do_add.3 578B
ldap_sort.3 543B
do_add.3 261B
do_add.4 568B
do_add.4 261B
slapd-config.5 71KB
slapd.conf.5 66KB
slapd-meta.5 45KB
slapo-ppolicy.5 30KB
slapd.access.5 29KB
slapd-sql.5 25KB
lloadd.conf.5 25KB
slapo-rwm.5 23KB
slapd-ldap.5 21KB
ldap.conf.5 16KB
slapd-asyncmeta.5 16KB
slapo-accesslog.5 13KB
slapo-pcache.5 13KB
slapo-variant.5 12KB
slapo-nssov.5 10KB
slapo-datamorph.5 9KB
slapd-mdb.5 9KB
slapo-dynlist.5 8KB
slapo-retcode.5 8KB
slapd-sock.5 7KB
slapo-dds.5 7KB
ldif.5 6KB
slapd-relay.5 6KB
slapd.overlays.5 6KB
slapo-chain.5 6KB
slapo-unique.5 5KB
slapd-perl.5 5KB
共 1954 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
ZSPIN_G
- 粉丝: 0
- 资源: 139
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0