3.10. 在复制环境中同步帐户锁定属性
目录服务器在本地存储帐户锁定属性。在具有多个服务器的环境中,为这些属性配置复制,以防止攻击者尝试登录到一台服务器,直到达到帐户锁定计数为止,然后在其他服务器上继续。
3.10.1. 目录服务器在复制环境中如何处理密码和帐户锁定策略 复制链接链接已复制到粘贴板!
目录服务器强制实施密码和帐户锁定策略,如下所示:
- 在数据供应商中强制执行密码策略
- 在复制拓扑中的所有服务器上强制实施帐户锁定策略
目录服务器复制以下密码策略属性:
-
passwordMinAge
-
passwordMaxAge
-
passwordExp
-
passwordWarning
但是,默认情况下,Directory 服务器不会复制常规帐户锁定属性:
-
passwordRetryCount
-
retryCountResetTime
-
accountUnlockTime
要防止攻击者尝试登录到一台服务器,直到达到帐户锁定计数,然后继续其他服务器,复制这些帐户锁定属性。
3.10.2. 配置目录服务器以复制帐户锁定属性 复制链接链接已复制到粘贴板!
如果您使用更新 passwordRetryCount
,retryCountResetTime
, 或 accountUnlockTime
属性的帐户锁定策略,请将 Directory 服务器配置为复制这些属性,使其值在所有服务器之间相同。
在复制拓扑中的所有供应商上执行此步骤。
前提条件
- 您已配置了帐户锁定策略,或配置了更新上述一个或多个属性的密码策略。
- 您可以在复制环境中使用 Directory 服务器。
流程
启用复制密码策略属性:
dsconf <instance_name> pwpolicy set --pwdisglobal="on"
# dsconf <instance_name> pwpolicy set --pwdisglobal="on"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果使用部分复制,显示复制中排除的属性列表:
dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"
# dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"dsconf <instance_name> repl-agmt get --suffix "dc=example,dc=com" example-agreement | grep "nsDS5ReplicatedAttributeList"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用默认设置时,不会显示输出,Directory 服务器会复制帐户锁定属性。但是,如果命令返回排除的属性列表,如下例所示,请验证属性列表:
nsDS5ReplicatedAttributeList: (objectclass=*) $ EXCLUDE accountUnlockTime passwordRetryCount retryCountResetTime example1 example2
nsDS5ReplicatedAttributeList: (objectclass=*) $ EXCLUDE accountUnlockTime passwordRetryCount retryCountResetTime example1 example2
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在本例中,
accountUnlockTime
、passwordRetryCount
和retryCountResetTime
lockout 策略属性从复制中排除,以及两个其他属性。如果上一命令的输出列出了任何帐户锁定属性,请更新分数复制设置,使其仅包含 lockout 策略属性以外的属性:
dsconf <instance_name> repl-agmt set --suffix "dc=example,dc=com" --frac-list "example1 example2" example-agreement
# dsconf <instance_name> repl-agmt set --suffix "dc=example,dc=com" --frac-list "example1 example2" example-agreement
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
尝试以使用无效密码的用户身份执行搜索:
ldapsearch -H ldap://server.example.com -D "uid=example,ou=People,dc=example,dc=com" -w "<invalid-password>" -b "dc=example,dc=com" -x
# ldapsearch -H ldap://server.example.com -D "uid=example,ou=People,dc=example,dc=com" -w "<invalid-password>" -b "dc=example,dc=com" -x ldap_bind: Invalid credentials (49)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 显示用户的
passwordRetryCount
属性:ldapsearch -H ldap://server.example.com -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com" -x passwordRetryCount
# ldapsearch -H ldap://server.example.com -D "cn=Directory Manager" -W -b "uid=example,ou=People,dc=example,dc=com" -x passwordRetryCount ... dn: uid=example,ou=People,dc=example,dc=com passwordRetryCount: 1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
在复制拓扑中的不同服务器上运行上一命令。如果
passwordRetryCount
属性的值相同,则 Directory 服务器会复制该属性。