3.7 LDAP 鉴定

除了数据库鉴定外,Sentinel Rapid Deployment 还支持 LDAP 鉴定。通过将 Sentinel Rapid Deployment 服务器配置为使用 LDAP 鉴定,可让用户使用其 Novell eDirectory 或 Microsoft Active Directory 身份凭证登录到 Sentinel Rapid Deployment。

3.7.1 概述

您可以将 Sentinel Rapid Deployment 服务器配置为通过安全 SSL 连接进行 LDAP 鉴定,既可使用 LDAP 目录匿名搜索,也可以不使用。

注:如果 LDAP 目录禁用匿名搜索,则请勿将 Sentinel Rapid Deployment 服务器配置为使用匿名搜索。

  • 匿名搜索: 在创建 Sentinel Rapid Deployment LDAP 用户帐户时,您必须指定目录用户名,但无需指定用户判别名 (DN)。

    当 LDAP 用户登录 Sentinel Rapid Deployment 时,Sentinel Rapid Deployment 服务器会根据指定的用户名在 LDAP 目录中执行匿名搜索,以寻找相应的 DN,然后使用该 DN 来针对 LDAP 目录鉴定用户登录。

  • 非匿名搜索: 在创建 Sentinel Rapid Deployment LDAP 用户帐户时,您必须同时指定目录用户名和用户 DN。

    当 LDAP 用户登录 Sentinel Rapid Deployment 时,Sentinel Rapid Deployment 服务器会使用指定的用户 DN 针对 LDAP 目录鉴定用户登录,并不会在 LDAP 目录中执行任何匿名搜索。

    另外,还有一种只适用于 Active Directory 的方法。有关详细信息,请参见使用 Active Directory 中的 UserPrincipalName 属性进行非匿名 LDAP 鉴定

3.7.2 先决条件

导出 LDAP 服务器 CA 证书

与 LDAP 服务器之间的安全 SSL 连接需要 LDAP 服务器 CA 证书,您必须将该证书导出为采用 Base64 编码的文件。

启用 LDAP 目录匿名搜索

要使用匿名搜索来执行 LDAP 鉴定,您必须启用 LDAP 目录匿名搜索。默认情况下,eDirectory 中会启用匿名搜索,Active Directory 中则会禁用。

要启用 LDAP 目录匿名搜索,请参考以下信息进行操作:

3.7.3 配置 Sentinel 服务器以进行 LDAP 鉴定

  1. 请确保您已满足部分 3.7.2, 先决条件中所述的先决条件。

  2. 用户身份登录 Sentinel Rapid Deployment 服务器。

  3. 将导出的 LDAP 服务器 CA 证书文件复制到 <安装目录>/config 目录。

  4. 以如下所示的方式设置证书文件的所有权和许可权限:

    chown novell:novell <安装目录>/config/<证书文件>

    chmod 700 <安装目录>/config/<证书文件>

  5. 切换为 novell 用户:

    su - novell
    
  6. 切换到 <安装目录>/bin 目录。

  7. 运行 LDAP 鉴定配置脚本:

    ./ldap_auth_config.sh

    该脚本会先对 config 目录中的 auth.loginconfiguration.xml 这两个配置文件进行备份,将它们分别保存为 auth.login.savconfiguration.xml.sav,然后才会对原文件进行修改以进行 LDAP 鉴定。

  8. 请指定下列信息:

    按 Enter 接受默认值,或指定一个新值以覆盖默认值。

    • Sentinel 安装位置: Sentinel 服务器上的安装目录。

    • LDAP 服务器主机名或 IP 地址: 安装了 LDAP 服务器的计算机的主机名或 IP 地址。默认值为 localhost。但是,您不可将 LDAP 服务器安装在与 Sentinel 服务器相同的计算机上。

    • LDAP 服务器端口: 安全 LDAP 连接的端口号。默认端口号是 636。

    • LDAP 目录匿名搜索: 要执行匿名搜索,请指定 y。否则请指定 n。默认值为 y

      如果指定 n,请完成 LDAP 配置,并执行不执行匿名搜索的 LDAP 鉴定一节中所述的步骤。

    • 使用的 LDAP 目录: 只有当您为匿名搜索指定了“y”时,此参数才会显示。请指定 1 以使用 Novell eDirectory,或指定 2 以使用 Active Directory。默认值是 1。

    • 要在其中搜索用户的 LDAP 子树: 只有当您为匿名搜索指定了“y”时,此参数才会显示。该子树即用户对象所在目录中的子树。以下是一些指定 eDirectory 和 Active Directory 子树的示例:

      • eDirectory:

        ou=users,o=novell
        

        注:对于 eDirectory,如果未指定子树,则将在整个目录中进行搜索。

      • Active Directory:

        CN=users,DC=TESTAD,DC=provo, DC=novell,DC=com
        

        注:对于 Active Directory,子树不能为空。

    • LDAP 服务器证书的文件名: 您在步骤 3 中复制的 eDirectory/Active Directory CA 证书的文件名。

  9. 输入以下内容之一:

    • y:接受所输入的值

    • n:输入新值

    • q:退出配置

    成功完成配置后:

    • LDAP 服务器证书会被添加到位于 <安装目录>/config/ldap_server.keystore 的密钥存储区。

    • <安装目录>/config 目录中的 auth.loginconfiguration.xml 配置文件会得到更新,以启用 LDAP 鉴定。

  10. 输入 y 以重新启动 Sentinel 服务。

    重要说明:如果出现任何错误,请还原对 config 目录中的 auth.loginconfiguration.xml 配置文件所做的更改:

    cp -p auth.login.sav auth.login
    cp -p configuration.xml.sav configuration.xml
    
  11. (视情况而定)如果为LDAP 目录匿名搜索:指定了 n,请继续不执行匿名搜索的 LDAP 鉴定

不执行匿名搜索的 LDAP 鉴定

在配置 Sentinel Rapid Deployment 以进行 LDAP 鉴定时,如果您针对 LDAP 目录匿名搜索选择了“n”,则 LDAP 鉴定将不会执行匿名搜索。

如果使用 Sentinel 控制中心创建 LDAP 用户帐户,请务必为非匿名 LDAP 鉴定指定 LDAP 用户 DN。对 eDirectory 和 Active Directory 都可使用此方法。

有关详细信息,请参见《Sentinel Rapid Deployment 用户指南》中的为 Sentinel 创建 LDAP 用户帐户

此外,对于 Active Directory,有一种备选的方法可以执行无需匿名搜索的 LDAP 鉴定。有关详细信息,请参见使用 Active Directory 中的 UserPrincipalName 属性进行非匿名 LDAP 鉴定

使用 Active Directory 中的 UserPrincipalName 属性进行非匿名 LDAP 鉴定

对于 Active Directory,您还可以使用 userPrinicipalName 属性执行无需匿名搜索的 LDAP 鉴定:

  1. 请确保针对 Active Directory 用户将 userPrinicipalName 属性设置为 <sAMAccountName@domain>。

    有关详细信息,请参见 User-Principal-Name 属性

  2. 请确保您执行了步骤 1步骤 10,并为LDAP 目录匿名搜索:指定了 n

  3. 在 Sentinel 服务器上,编辑 <安装目录>/config/auth.login 文件中的 LdapLogin 部分:

    LdapLogin { 
     com.sun.security.auth.module.LdapLoginModule required 
     userProvider="ldap://LDAP server IP:636/DN of the Container that contains the user objects" 
     authIdentity="{USERNAME}@Domain Name" 
     userFilter="(&(sAMAccountName={USERNAME})(objectclass=user))" 
     useSSL=true; 
     }; 
    

    例如:

    LdapLogin { 
     com.sun.security.auth.module.LdapLoginModule required 
     userProvider="ldap://137.65.151.12:636/DC=Test-AD,DC=provo,DC=novell,DC=com" 
     authIdentity="{USERNAME}@Test-AD.provo.novell.com" 
     userFilter="(&(sAMAccountName={USERNAME})(objectclass=user))" 
     useSSL=true; 
     }; 
    
  4. 重新启动 Sentinel 服务:

    /etc/init.d/sentinel stop
    
    /etc/init.d/sentinel start
    

3.7.4 配置多个 LDAP 服务器以实现故障转移

要将一个或多个 LDAP 服务器配置为 LDAP 鉴定的故障转移服务器:

  1. 确保您执行了步骤 2步骤 10,将 Sentinel 服务器配置为针对 LDAP 主服务器进行 LDAP 鉴定。

  2. novell 用户身份登录 Sentinel 服务器。

  3. 停止 Sentinel 服务。

    /etc/init.d/sentinel stop
    
  4. 切换到 <安装目录>/config 目录:

    cd <install_directory>/config
    
  5. 打开 auth.login 文件进行编辑。

    vi auth.login
    
  6. 更新 LdapLogin 部分中的 userProvider,指定多个 LDAP URL。请以空格分隔各个 URL。

    例如:

    userProvider="ldap://ldap-url1 ldap://ldap-url2"
    

    对于 Active Directory,请确保 LDAP URL 中的子树不为空。

    有关指定多个 LDAP URL 的详细信息,请参见类 LdapLogin 模块中对 userProvider 选项的说明。

  7. 保存更改。

  8. 导出各 LDAP 故障转移服务器的证书,并将证书文件复制到 Sentinel 服务器上的 <安装目录>/config 目录。

    有关详细信息,请参见导出 LDAP 服务器 CA 证书

  9. 确保您针对各 LDAP 故障转移服务器的证书文件设置了所需的所有权和许可权限。

    chown novell:novell <install_directory>/config/<cert-file>
    
    chmod 700 <install_directory>/config/<cert-file>
    
  10. 将各 LDAP 故障转移服务器证书添加到配置 Sentinel 服务器以进行 LDAP 鉴定一节中步骤 8 创建的 ldap_server.keystore 密钥存储区。

    <install_directory>/jre64/bin/keytool -importcert -noprompt -trustcacerts -file <certificate-file> -alias <alias_name> -keystore ldap_server.keystore -storepass sentinel
    

    <certificate-file> 替换为 Base64 编码格式的 LDAP 证书文件名,并将 <alias_name> 替换为要导入的证书的别名。

    重要说明:请确保您指定了别名。如果未指定别名,密钥工具将默认采用 mykey 作为别名。在将多个证书导入密钥存储区而未指定别名时,密钥工具将报错,告知您该别名已经存在。

  11. 启动 Sentinel 服务。

    /etc/init.d/sentinel start
    

如果 Sentinel 服务器在发现 LDAP 主服务器停机之前就已超时,则服务可能不会连接到 LDAP 故障转移服务器。为确保 Sentinel 服务器可连接到 LDAP 故障转移服务器而不会发生超时:

  1. 用户身份登录 Sentinel 服务器。

  2. 打开 sysct1.conf 文件进行编辑:

    vi /etc/sysctl.conf
    
  3. 确保 net.ipv4.tcp_syn_retries 的值设置为 3。如果该条目不存在,请添加条目。保存文件:

    net.ipv4.tcp_syn_retries = 3
    
  4. 执行命令以使所做更改生效:

    /sbin/sysctl -p
    
    /sbin/sysctl -w net.ipv4.route.flush=1
    
  5. <安装目录>/bin 目录的 control_center.shsolution_designer.sh 中添加 -Desecurity.remote.timeout=60 参数,以设置 Sentinel 服务器超时值:

    control_center.sh:

    "<install_directory>/jre/bin/java" $MEMORY -Dcom.esecurity.configurationfile=$ESEC_CONF_FILE -Desecurity.cache.directory="<install_directory>/data/control_center.cache" -Desecurity.communication.service="sentinel_client" -Dfile.encoding=UTF8 -Desecurity.dataobjects.config.file="/xml/BaseMetaData.xml,/xml/WorkflowMetaData.xml,/xml/ActMetaData.xml" -Djava.util.logging.config.file="<install_directory>/config/control_center_log.prop" -Djava.security.auth.login.config="<install_directory>/config/auth.login" $SENTINEL_LANG_PROP $SENTINEL_CTRY_PROP -Dice.pilots.html4.baseFontFamily="Arial Unicode MS" -Desecurity.remote.timeout=60 -jar ../lib/console.jar 
    

    solution_designer.sh:

    "<install_directory>/jre/bin/java" -classpath $LOCAL_CLASSPATH $MEMORY -Dcom.esecurity.configurationfile="$ESEC_CONF_FILE" -Dsentinel.installer.jar.location="<install_directory>/lib/contentinstaller.jar" -Desecurity.communication.service="sentinel_client" -Dfile.encoding=UTF8 -Desecurity.dataobjects.config.file="/xml/BaseMetaData.xml,/xml/WorkflowMetaData.xml,/xml/ActMetaData.xml" -Djava.util.logging.config.file="<install_directory>/config/solution_designer_log.prop" -Djava.security.auth.login.config="<install_directory>/config/auth.login" $SENTINEL_LANG_PROP $SENTINEL_CTRY_PROP -Desecurity.cache.directory=../data/solution_designer.cache -Desecurity.remote.timeout=60 com.esecurity.content.exportUI.ContentPackBuilder
    

3.7.5 为多个 Active Directory 域配置 LDAP 鉴定

如果要鉴定的 LDAP 用户位于多个 Active Directory 域中,您可以按如下所述针对 LDAP 鉴定配置 Sentinel Rapid Deployment 服务器:

  1. 确保遵照步骤 2步骤 10,将 Sentinel 服务器配置为针对第一个域的 Active Directory 域控制器进行 LDAP 鉴定。另请确保为LDAP 目录匿名搜索:指定了 n

  2. novell 用户身份登录 Sentinel 服务器。

  3. 停止 Sentinel 服务。

    /etc/init.d/sentinel stop
    
  4. 切换到 <安装目录>/config 目录:

    cd <install_directory>/config
    
  5. 打开 auth.login 文件进行编辑。

    vi auth.login
    
  6. 编辑 LdapLogin 部分以指定多个 LDAP URL,并使用空格分隔每个 URL。

    例如:

    LdapLogin {
            com.sun.security.auth.module.LdapLoginModule required
            userProvider="ldap://<IP of the domain 1 domain controller>:636 ldap://<IP of the domain 2 domain controller>:636"
            authIdentity="{USERNAME}"
            useSSL=true;
    };
    

    有关指定多个 LDAP URL 的详细信息,请参见类 LdapLogin 模块中对 userProvider 选项的说明。

  7. 保存更改。

  8. 导出每个域的域控制器证书,并将证书文件复制到 Sentinel 服务器上的 <安装目录>/config 目录。

    有关详细信息,请参见导出 LDAP 服务器 CA 证书

  9. 确保您设置了证书文件的必要所有权和许可权限。

    chown novell:novell <install_directory>/config/<cert-file>
    
    chmod 700 <install_directory>/config/<cert-file>
    
  10. 将各证书添加到配置 Sentinel 服务器以进行 LDAP 鉴定一节中步骤 8 创建的 ldap_server.keystore 密钥存储区。

    <install_directory>/jre64/bin/keytool -importcert -noprompt -trustcacerts -file <certificate-file> -alias <alias_name> -keystore ldap_server.keystore -storepass sentinel
    

    <certificate-file> 替换为 Base64 编码格式的 LDAP 证书文件名,并将 <alias_name> 替换为要导入的证书的别名。

    重要说明:请确保您指定了别名。如果未指定别名,密钥工具将默认采用 mykey 作为别名。在将多个证书导入密钥存储区而未指定别名时,密钥工具将报错,告知您该别名已经存在。

  11. 启动 Sentinel 服务。

    /etc/init.d/sentinel start
    

3.7.6 使用 LDAP 用户身份凭证进行登录

成功将 Sentinel 服务器配置为使用 LDAP 鉴定后,您可以在 Sentinel 控制中心内创建 Sentinel LDAP 用户帐户。有关创建 LDAP 用户帐户的详细信息,请参见《Sentinel Rapid Deployment 用户指南》中的为 Sentinel 创建 LDAP 用户帐户

创建 LDAP 用户帐户后,您便可以使用自己的 LDAP 用户名和口令登录到 Sentinel Rapid Deployment Web 用户界面、Sentinel 控制中心和 Sentinel 解决方案设计器。

注:要修改现有 LDAP 配置,请重新运行 ldap_auth_config 脚本,为各个参数指定新的值。