The Password Policy for LDAP Directories is a RFC draft that has been designed for the very first version in 1999, and the latest version is from 2009. Although it‘s still a draft, and it’s currently noted as inactive, it has been implemented by many existing LDAP servers.
ApacheDS implements most of the draft.
Always try to think about better alternatives than force users to always define a password with 10 or more characters, including numbers, upper and lower case, special chars, and to change it every month...
A long sentence (4 or 5 words), like “The horse has won the race three time” is most certainly a better password than any other combination, and is easy to remember...
As explained on wikipedia:
A password policy is a set of rules designed to enhance computer security by encouraging users to employ strong passwords and use them properly.
Basically, the system, once activated, will enforce some rules and check the password strength. We will list the various options in this chapter.
There are different aspects to consider:
Those aspects are exposed in the following paragraphs.
The Password Policy can be configured in two ways. First of all, it‘s important to know that it’s activated by default. Let's see the default configuration first.
There is an entry containing all the default configuration values for the Password Policy, under the DN “ou=passwordPolicies, ads-interceptorId=authenticationInterceptor, ou=interceptors, ads-directoryServiceId=<default>, ou=config”, which corresponds to the following hierarchy:
* ou=config * ads-directoryServiceId=<default> * ou=interceptors * ads-interceptorId=authenticationInterceptor * ou=passwordPolicies
This entry contains the following values:
Attribute | Default value | Comment |
---|---|---|
ads-pwdAllowUserChange | TRUE | Tells if the user can change its password |
ads-pwdCheckQuality | 1 | The kind of quality we want for the password (0, 1, or 2) |
ads-pwdExpireWarning | 600 | |
ads-pwdFailureCountInterval | 30 | The duration of failure logs we keep in the entry |
ads-pwdGraceAuthnLimit | 5 | |
ads-pwdGraceExpire | 0 | |
ads-pwdInHistory | 5 | The number of passwords we keep in the password history |
ads-pwdLockout | TRUE | Tells if the password should be locked or not on failures |
ads-pwdLockoutDuration | 0 | The delay in seconds we wait before allowing a new attempt when the password hs been locked |
ads-pwdMaxAge | 0 | |
ads-pwdMaxDelay | 0 | The maximum we wait before sending the BindResponse |
ads-pwdMaxFailure | 5 | The maximum number of failure we accept before locking the password |
ads-pwdMaxIdle | 0 | |
ads-pwdMaxLength | 0 | |
ads-pwdMinAge | 0 | The delay between two password changes |
ads-pwdMinDelay | 0 | The minimum we wait before sending the BindResponse |
ads-pwdMinLength | 5 | |
ads-pwdMustChange | FALSE | |
ads-pwdSafeModify | FALSE |
Here is the entry in LDIF format:
dn: ads-pwdId=default,ou=passwordPolicies,ads-interceptorId=authenticationIn terceptor,ou=interceptors,ads-directoryServiceId=default,ou=config objectclass: top objectclass: ads-base objectclass: ads-passwordPolicy ads-pwdAttribute: userPassword ads-pwdId: default ads-enabled: TRUE ads-pwdAllowUserChange: TRUE ads-pwdCheckQuality: 1 ads-pwdExpireWarning: 600 ads-pwdFailureCountInterval: 30 ads-pwdGraceAuthnLimit: 5 ads-pwdGraceExpire: 0 ads-pwdInHistory: 5 ads-pwdLockout: TRUE ads-pwdLockoutDuration: 0 ads-pwdMaxAge: 0 ads-pwdMaxDelay: 0 ads-pwdMaxFailure: 5 ads-pwdMaxIdle: 0 ads-pwdMaxLength: 0 ads-pwdMinAge: 0 ads-pwdMinDelay: 0 ads-pwdMinLength: 5 ads-pwdMustChange: FALSE ads-pwdSafeModify: FALSE
In the draft, it is said that the passwordPolicy can apply to one user or to many. It's also suggested that some Administrative Area could be used for that purpose : the users present in such an area will be constrained but the associated PasswordPolicy. At the moment, ApacheDS does not implement such a mechanism, and will rely on either the global configuration, stored in the ou=config partition, or we can define a specific Password Policy for a user. In this case, we will store in each user the reference to the Password Policy to use into the pwdPolicySubentry attribute (it contains a reference -a DN - to an entry storing the specific configuration).
This specific configuration is stored into an entry having the pwdPolicy Auxiliary ObjectClass, which description is :
( 1.3.6.1.4.1.42.2.27.8.2.1 NAME 'pwdPolicy' SUP top AUXILIARY MUST ( pwdAttribute ) MAY ( pwdMinAge $ pwdMaxAge $ pwdInHistory $ pwdCheckQuality $ pwdMinLength $ pwdMaxLength $ pwdExpireWarning $ pwdGraceAuthNLimit $ pwdGraceExpiry $ pwdLockout $ pwdLockoutDuration $ pwdMaxFailure $ pwdFailureCountInterval $ pwdMustChange $ pwdAllowUserChange $ pwdSafeModify $ pwdMinDelay $ pwdMaxDelay $ pwdMaxIdle ) )
The PasswordPolicy is enabled by default. It's possible to disable it by setting the ads-enabled value to FALSE, with a server restart.
This part is exposing the various techniques the system uses to protect your password from an attack.
The idea is to protect the password against multiple guess attempts. The following rules are applied:
When the account is locked, it can remain locked, or be unlocked after a grace period.
Each failed attempt will be logged in the entry, in the ads-pwdFailureTime Attribute (it will contain the date and time of the attempt). When the attribute contains more values than the maximum number of failed attempts, the entry will be locked (the ads-pwdAccountLockedTime Attribute will contain the date and time the entry has been locked).
The following table expose the various possible cases, with three failed attempts:
ads-pwdmaxfailure | ads-pwdLockout | ads-pwdFailureTime | ads-pwdAccountLockedTime | Locked | Comment |
---|---|---|---|---|---|
3 | true | date1 | - | No | Failure 1 |
date1, date2 | - | No | Failure 2 | ||
date1, date2, date3 | date3 | Yes | Failure 3: account locked | ||
3 | false | date1 | - | No | Failure 1 |
date1, date2 | - | No | Failure 2 | ||
date1, date2, date3 | - | No | Failure 3 |
As we can see, the account is locked only when we reach the number of failure, and the ads-pwdLockout flag is TRUE. If the ads-pwdLockoutDuration flag is set, then the password will remain locked for the delay stored in this attribute.
When we have reached a number of failed attempt, the account will be locked. We can set another attribute to tell the server that the locked out account can be unlocked after a delay: the ads-pwdLockoutDuration Attribute stores this delay.
When the account is locked, no further attempt will succeed, even if the correct password is sent. After the delay, the user will be unlocked.
As we store all the failures within the entry, at some point we may want to purge those failures. This is done either because we have successfully logged, or because the ads-pwdFailureCountInterval value has expired. In this last case, all the failures older than the current time minus the set interval will be removed.
Those rules are used to enforce some constraints on the password, so that weak passwords can't be used.
The system can be enabled or disabled, and when enabled, two different level of checks can be done: relaxed or strict. We use a parameter to specify the kind of check we do on the password: ads-pwdCheckQuality, which can take three values:
The server can keep a backlog of passwords, so that a user can‘t keep a password for ever. When requested to do so the user will have to change his/her password, and the old password will be stored in the user’s entry password history.
We can specify the number of passwords we keep in the password history by configuring the ads-pwdInHistory attribute.
When the password history is activated, some users may change their passwords many times to get their old password out of the history, and add it as their password again. Setting a delay between two password changes may protect the password against such action.
The ads-pwdMinAge attribute is used for this purpose, and it keeps a value in seconds.
You can control the minimum and maximum length for a password by setting the ads-pwdMinLength and ads-pwdMaxLength attributes.
We now have to expose the rules that apply to the password during it's life.
A password may have a limited life expectation, and when this age is reached, the password will be invalidated. This is configured through the ads-pwdMaxAge parameter, which contains the number of second a password will last.
This password invalidation can be overruled by the two next parameters.
When the password has expired, this parameter (ads-pwdGraceAuthNLimit) tells how many times a user will still be allowed to bind before the password is definitively locked. Each attempt will decrement the associated counter.
Another option when the password has expired is to give the user the possibility to log in during a certain period of time. This is mainly useful when the ads-pwdGraceAuthNLimit is set: not only there is a limited number of attempts, but those attempts must be done in a limited period of time, ortherwise the password will be locked.
If the configuration of the ads-pwdGraceAuthNLimit is 0, the ads-pwdGraceExpire value is simply added to the ads-pwdMaxAge value.
You can set a maximum inactivity delay for a password, before this password expires. This is set using the ads-pwdMaxIdle parameter
The ads-pwdExpireWarning parameter will be used to send back a warning if the password if the password is going to expire in a given delay. This is convenient as soon as the client sends the PasswordPolicy control to the server, and as soon as the client reads the response's control.
The ads-pwdAllowUserChange parameter can be used to allow - or forbid - a user to change his/her own password. When this parameter is set to TRUE, the user can't change his/her password.
A few parameters are described in the specification, but aren't supported. Here is the list :