如何在 Windows Server 中啟用 LDAP 簽署

本文說明如何在 Windows Server 2022、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2、Windows 10 和 Windows 11 中啟用 LDAP 簽署。

適用於:Windows Server 2022、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2、Windows Server 11 - 所有版本、Windows 10 - 所有版本
原始 KB 編號: 935834

摘要

您可以藉由將伺服器設定為拒絕未要求籤署 (完整性驗證) 的簡單驗證和安全層 (SASL) LDAP 繫結,或拒絕在純文字 (非 SSL/TLS 加密) 連線上執行的 LDAP 簡單繫結,大幅改善目錄伺服器的安全性。 SASL 繫結可能包含交涉、Kerberos、NTLM 和摘要等通訊協定。

未簽署的網路流量很容易受到重新執行攻擊。 在這類攻擊中,入侵者會攔截驗證嘗試和票證發行。 入侵者可以重複使用票證來模擬合法的使用者。 此外,未簽署的網路流量很容易受到攔截式 (MIM) 攻擊,其中入侵者會擷取用戶端與伺服器之間的封包、變更封包,然後將其轉送到伺服器。 如果在 LDAP 伺服器上發生這種情況,攻擊者可能會導致伺服器根據來自 LDAP 用戶端的偽造要求做出決策。

如何探索未使用 [需要簽署] 選項的用戶端

進行此設定變更之後,依賴未簽署的 SASL (Negotiate、Kerberos、NTLM 或 Digest) LDAP 繫結或透過非 SSL/TLS 連線的 LDAP 簡單繫結的用戶端會停止運作。 為了協助識別這些用戶端,Active Directory 網域服務 (AD DS) 或輕量型目錄伺服器的目錄伺服器 (LDS) 每 24 小時記錄一次摘要事件識別碼 2887,以指出這類繫結發生的次數。 建議您將這些用戶端設定為不要使用這類繫結。 在長時間未觀察到這類事件之後,建議您將伺服器設定為拒絕這類繫結。

如果您必須有更多資訊才能識別這類用戶端,您可以設定目錄伺服器來提供更詳細的記錄。 當用戶端嘗試進行未簽署的 LDAP 繫結時,此額外記錄會記錄事件識別碼 2889。 記錄項目會顯示用戶端的 IP 位址,以及用戶端嘗試用來驗證的身分識別。 您可以將 [16 個 LDAP 介面事件] 診斷設定設為 2 (Basic) 來啟用此額外記錄。 如需如何變更診斷設定的詳細資訊,請參閱 如何設定 Active Directory 和 LDS 診斷事件記錄

如果目錄伺服器設定為拒絕未簽署的 SASL LDAP 繫結或透過非 SSL/TLS 連線的 LDAP 簡單繫結,則目錄伺服器會在發生這類繫結嘗試時,每隔 24 小時記錄一次摘要事件識別碼 2888。

如何設定目錄以要求 AD DS 的 LDAP 伺服器簽署

如需變更安全性設定可能產生的影響的相關資訊,請參閱 如果您變更安全性設定和使用者權限指派,可能會發生用戶端、服務和程式問題

使用群組原則

如何設定伺服器 LDAP 簽署需求

  1. 選取 [開始]> [執行],輸入 mmc.exe,然後選取 [確定]
  2. 選取 [檔案]> [新增/移除嵌入式管理單元],選取 [群組原則管理編輯器],然後選取 [新增]
  3. 選取 [群組原則物件]> [瀏覽]
  4. 在 [瀏覽群組原則物件] 對話方塊中,選取 [網域]、[OU] 和 [連結群組原則物件] 區域底下的 [預設網域控制站原則],然後選取 [確定]
  5. 選取 [完成]
  6. 選取 [確定]
  7. 選取 [預設網域控制站原則> [電腦設定]> [原則]> [Windows 設定]> [安全性設定]> [本機原則],然後選取 [安全性選項]
  8. 以滑鼠右鍵按一下 [網域控制站:LDAP 伺服器簽署需求],然後選取 [屬性]
  9. 在 [網域控制站:LDAP 伺服器簽署需求內容] 對話方塊中,啟用 [定義此原則設定],選取 [定義此原則設定] 清單中的 [需要簽署],然後選取 [確定]
  10. 按一下 [確認設定變更] 對話方塊中的 [是]

如何使用本機電腦原則設定用戶端 LDAP 簽署需求

  1. 選取 [開始]> [執行],輸入 mmc.exe,然後選取 [確定]
  2. 選擇 [檔案]> [新增/移除嵌入式管理單元]
  3. 在 [新增或移除嵌入式管理單元] 對話方塊中,選取 [群組原則物件編輯器],然後選取 [新增]
  4. 選取 [完成]
  5. 選取 [確定]
  6. 選取[本機電腦原則]> [電腦設定]> [原則]> [Windows 設定]> [安全性設定]> [本機原則],然後選取 [安全性選項]
  7. 以滑鼠右鍵按一下 [網路安全性:LDAP 用戶端簽署需求],然後選取 [屬性]
  8. 在 [網路安全性:LDAP 用戶端簽署需求內容] 對話方塊中,在清單中選取 [需要登入],然後選取 [確定]
  9. 按一下 [確認設定變更] 對話方塊中的 [是]

如何使用網域群組原則物件來設定用戶端 LDAP 簽署需求

  1. 選取 [開始]> [執行],輸入 mmc.exe,然後選取 [確定]
  2. 選擇 [檔案]> [新增/移除嵌入式管理單元]
  3. 在 [新增或移除嵌入式管理單元] 對話方塊中,選取 [群組原則物件編輯器],然後選取 [新增]
  4. 選取 [瀏覽],然後選取 [預設網域原則] (或您要啟用用戶端 LDAP 簽署的 [群組原則物件])。
  5. 選取 [確定]
  6. 選取 [完成]
  7. 選取 [關閉]
  8. 選取 [確定]
  9. 選取 [預設網域原則]> [電腦設定]> [Windows 設定]> [安全性設定]> [本機原則],然後選取 [安全性選項]
  10. 在 [網路安全性:LDAP 用戶端簽署需求內容] 對話方塊中,在清單中選取 [需要登入],然後選取 [確定]
  11. 按一下 [確認設定變更] 對話方塊中的 [是]

如何使用登錄機碼來設定用戶端 LDAP 簽署需求

重要事項

請仔細依照本節中的步驟執行。 如果您不當地修改登錄,可能會發生嚴重的問題。 在您進行修改之前,請先備份登錄,做為還原之用,以免發生問題。

預設情況下,針對 Active Directory 輕量型目錄服務 (AD LDS) ,無法使用登錄機碼。 因此,您必須在下列登錄子機碼下建立 REG_DWORD 類型的 LDAPServerIntegrity 登錄項目:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<InstanceName>\Parameters

注意事項

預留位置 <InstanceName> 代表您想要變更的 AD LDS 執行個體名稱。

登入專案具有下列可能的值:

  • 0:已停用簽署。
  • 2:已啟用簽署。

當您變更此值時,新值會立即生效。 您不需要重新啟動電腦。

如何驗證設定變更

  1. 登入已安裝 AD DS 管理工具的電腦。

  2. 選取 [開始]> [執行],輸入 ldp.exe,然後選取 [確定]

  3. 選取 [連線]> [連接]

  4. 在 [伺服器] 和 [連接埠] 中,輸入您目錄伺服器的伺服器名稱和非 SSL/TLS 連接埠,然後選取 [確定]

    注意事項

    針對 Active Directory 網域控制站,適用的連接埠為 389。

  5. 建立連線之後,選取 [連線]> [繫結]

  6. 在 [繫結類型] 下,選取 [簡單繫結]

  7. 輸入使用者名稱和密碼,然後選取 [確定]

    如果您收到下列錯誤訊息,表示您已成功設定目錄伺服器:

    Ldap_simple_bind_s () 失敗:需要增強式驗證

LDAP 簽署需求的事件參考

事件標識碼 2886

啟動 DS 服務之後,會記錄事件標識碼 2886,以提醒系統管理員啟用簽署需求:

Log Name:      Directory Service
Source:        Microsoft-Windows-ActiveDirectory_DomainService
Event ID:      2886
Task Category: LDAP Interface
Level:         Warning
Keywords:      Classic
Description:
The security of this directory server can be significantly enhanced by configuring the server to reject SASL (Negotiate, Kerberos, NTLM, or Digest) LDAP binds that do not request signing (integrity verification) and LDAP simple binds that are performed on a clear text (non-SSL/TLS-encrypted) connection. Even if no clients are using such binds, configuring the server to reject them will improve the security of this server. 
 
Some clients may currently be relying on unsigned SASL binds or LDAP simple binds over a non-SSL/TLS connection, and will stop working if this configuration change is made. To assist in identifying these clients, if such binds occur this directory server will log a summary event once every 24 hours indicating how many such binds occurred. You are encouraged to configure those clients to not use such binds. Once no such events are observed for an extended period, it is recommended that you configure the server to reject such binds. 
 
For more details and information on how to make this configuration change to the server, please see http://go.microsoft.com/fwlink/?LinkID=87923. 
 
You can enable additional logging to log an event each time a client makes such a bind, including information on which client made the bind. To do so, please raise the setting for the "LDAP Interface Events" event logging category to level 2 or higher.

事件標識碼 2887

偵測到問題客戶端但允許時,會記錄摘要事件 (過去 24 小時內的事件識別碼 2887) :

Log Name:      Directory Service
Source:        Microsoft-Windows-ActiveDirectory_DomainService
Event ID:      2887
Task Category: LDAP Interface
Level:         Warning
Keywords:      Classic
Description:
During the previous 24 hour period, some clients attempted to perform LDAP binds that were either:
(1) A SASL (Negotiate, Kerberos, NTLM, or Digest) LDAP bind that did not request signing (integrity validation), or
(2) A LDAP simple bind that was performed on a clear text (non-SSL/TLS-encrypted) connection

This directory server is not currently configured to reject such binds. The security of this directory server can be significantly enhanced by configuring the server to reject such binds. For more details and information on how to make this configuration change to the server, please see http://go.microsoft.com/fwlink/?LinkID=87923.

Summary information on the number of these binds received within the past 24 hours is below.

You can enable additional logging to log an event each time a client makes such a bind, including information on which client made the bind. To do so, please raise the setting for the "LDAP Interface Events" event logging category to level 2 or higher.

Number of simple binds performed without SSL/TLS: <count of binds>
Number of Negotiate/Kerberos/NTLM/Digest binds performed without signing: <count of binds>

事件標識碼 2888

當問題用戶端遭到拒絕時,會記錄摘要事件 (過去 24 小時的事件標識碼 2888) :

Log Name:      Directory Service
Source:        Microsoft-Windows-ActiveDirectory_DomainService
Event ID:      2888
Task Category: LDAP Interface
Level:         Information
Keywords:      Classic
Description:
During the previous 24 hour period, some clients attempted to perform LDAP binds that were either:
(1) A SASL (Negotiate, Kerberos, NTLM, or Digest) LDAP bind that did not request signing (integrity validation), or
(2) A LDAP simple bind that was performed on a clear text (non-SSL/TLS-encrypted) connection

This directory server is configured to reject such binds.  This is the recommended configuration setting, and significantly enhances the security of this server. For more details, please see http://go.microsoft.com/fwlink/?LinkID=87923.

Summary information on the number of such binds received within the past 24 hours is below.

You can enable additional logging to log an event each time a client makes such a bind, including information on which client made the bind. To do so, please raise the setting for the "LDAP Interface Events" event logging category to level 2 or higher.

Number of simple binds rejected because they were performed without SSL/TLS: <count of binds>
Number of Negotiate/Kerberos/NTLM/Digest binds rejected because they were performed without signing: <count of binds>

事件標識碼 2889

當客戶端嘗試連線時,會記錄事件標識碼 2889:

Log Name:      Directory Service
Source:        Microsoft-Windows-ActiveDirectory_DomainService
Event ID:      2889
Task Category: LDAP Interface
Level:         Information
Keywords:      Classic
Description:
The following client performed a SASL (Negotiate/Kerberos/NTLM/Digest) LDAP bind without requesting signing (integrity verification), or performed a simple bind over a clear text (non-SSL/TLS-encrypted) LDAP connection. 
 
Client IP address:
<IP address>:<TCP port>
Identity the client attempted to authenticate as:
contoso\<username>
Binding Type:
0 – Simple Bind that does not support signing
1 – SASL Bind that does not use signing

參考