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。但是,您不應該在與 Sentinel 伺服器相同的機器上安裝 LDAP 伺服器。

    • 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 的 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 User Guide》(Sentinel Rapid Deployment 使用者指南) 中的 Creating an LDAP User Account for Sentinel (為 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 Attribute」(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 的詳細資訊,請參閱「Class LdapLogin Module」(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
    

    以 Base64 編碼格式的 LDAP 證書檔名取代 <certificate-file>,並以要輸入的證書別名取代 <alias_name>

    重要:請確定您指定了別名。如果未指定別名,Keytool 預設會將 mykey 用作別名。將多個證書輸入至 Keystore 而未指定別名時,Keytool 會報告一個錯誤,指出該別名已經存在。

  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 網域中,您可以採用下列方式將 Sentinel Rapid Deployment 伺服器設定為使用 LDAP 驗證:

  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 的詳細資訊,請參閱「Class LdapLogin Module」(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 中建立的 KeyStore ldap_server.keystore

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

    以 Base64 編碼格式的 LDAP 證書檔名取代 <certificate-file>,並以要輸入的證書別名取代 <alias_name>

    重要:請確定您指定了別名。如果未指定別名,Keytool 預設會將 mykey 用作別名。將多個證書輸入至 Keystore 而未指定別名時,Keytool 會報告一個錯誤,指出該別名已經存在。

  11. 啟動 Sentinel 服務。

    /etc/init.d/sentinel start
    

3.7.6 使用 LDAP 使用者身分證明登入

將 Sentinel 伺服器成功設定為使用 LDAP 驗證後,您可以在 Sentinel 控制中心中建立 Sentinel LDAP 使用者帳戶。如需建立 LDAP 使用者帳戶的詳細資訊,請參閱《Sentinel Rapid Deployment User Guide》(Sentinel Rapid Deployment 使用者指南) 中的 Creating an LDAP User Account for Sentinel (為 Sentinel 建立 LDAP 使用者帳戶)。

建立 LDAP 使用者帳戶後,便可使用您的 LDAP 使用者名稱與密碼登入 Sentinel Rapid Deployment Web 使用者介面、Sentinel 控制中心以及 Sentinel Solution Designer。

附註:若要修改現有的 LDAP 組態,請再次執行 ldap_auth_config 程序檔,然後指定新的參數值。