什麼是適用於 AD FS 的 KDFv2?

2021 年 7 月 13 日,AD FS 已發行更新以解決權杖重新執行攻擊,如 CVE-2021-33779 中所述。 這些更新引進了新的設定,以啟用和控制名為 "KDFv2" 的新金鑰衍生函式 (KDF)。 這個新版本的 KDF 比舊版更安全。 此文件說明 CVE-2021-33779 安全性修正所啟用的新設定,以及如何在不同的部署案例中啟用這些設定。 如需產品特定的 KB 號碼和相關下載,請參閱 CVE 文章中提供的連結。

KDFv2 設定:

AD FS 伺服器上的系統管理員可能會設定 KDFv2,以下列其中一種模式執行:

  • 無 - (預設值) 這是用來追蹤 KDFv2 設定值是否已變更。 系統管理員可能不會設定此值。
  • 已停用 - 此值可能會設定為將金鑰衍生函式還原為其原始行為,以防啟用 KDFv2 時發生任何問題。
  • 已啟用 - 啟用 KDFv2 支援。 ADFS 伺服器會公告它支援新的功能。 如果使用原始 KDF 版本從用戶端傳送初始主要重新整理權杖 (PRT) 要求,ADFS 將會接受要求並使用原始 KDF。 這允許支援未修補的用戶端。
  • 已強制執行 - 使用原始 KDF 來啟用 KDFv2 支援,並且不允許 (拒絕) 初始 PRT 要求。 一旦系統管理員確認所有用戶端都已修補,就可以切換至已強制執行模式。

透過下列 PowerShell 命令,AD FS 伺服器上的系統管理員可能會變更 KDFv2 模式:

  • 啟用 KDFv2:
Set-AdfsProperties -KdfV2Support enable 
  • 停用 KDFv2:
Set-AdfsProperties -KdfV2Support disable 
  • 強制執行 KDFv2:
Set-AdfsProperties -KdfV2Support enforce  

系統管理員可以執行 Get-AdfsProperties 來檢查目前的 KDFv2 設定。 傳回的 KdfV2Support 值將會符合設定的模式。

部署案例

取決於 AD FS 伺服器在修補以支援 KDFv2 時執行的 OS 版本,KDFv2 可能會自動啟用。 此外,可能會記錄 OS 版本相依事件,以指出伺服器陣列中的 KDFv2 狀態。 以下是可能的部署案例和預期的行為。

案例 1:Windows Server 2019 或更高版本安裝在伺服器陣列中的所有 AD FS 伺服器上。 未修補一或多個伺服器陣列節點。

預期的行為:如果未修補伺服器陣列中的所有節點,則會記錄下列錯誤事件,指出建議的補救動作。 此事件會每隔 24 小時記錄一次,直到已修補伺服器陣列中的所有節點為止。 修補所有節點之後,會透過 [啟用] 模式自動為伺服器陣列中的所有系統啟用 KDFv2。

 Source: AD FS  
 Level: Error 
 ID: 181 
 Message: AD FS could not enable the new KDFv2 feature automatically because of missing Windows Updates on one or more nodes of the farm. Please make sure that all the farm nodes are patched with the latest Windows Updates. AD FS checks regularly for the required updates to enable the new KDFv2 feature. An event 182 will be logged when a check is successful. For more information on this, please see  https://go.microsoft.com/fwlink/?linkid=2153807. 

案例 2:Windows Server 2016 安裝在伺服器陣列中的一或多個伺服器上。 所有伺服器都在執行 Windows 2016 或更高版本。 未修補一或多個伺服器陣列節點。

預期的行為:如果未修補伺服器陣列中的所有節點,則會記錄下列錯誤事件,指出建議的補救動作。 此事件會每隔 24 小時記錄一次,直到已修補伺服器陣列中的所有節點為止。 修補所有節點之後,必須在伺服器陣列中的所有伺服器上手動啟用 KDFv2。

 Source: AD FS  
 Level: Error 
 ID: 185 
 Message: KDFv2 feature is not enabled on AD FS farm. Please make sure that all the farm nodes are patched with latest Windows Updates and the KDFv2 feature is enabled to enhance the security of the farm. For more information on this, please see  https://go.microsoft.com/fwlink/?linkid=2153807. 

案例 3:Windows Server 2019 或更高版本安裝在伺服器陣列中的所有 ADFS 伺服器上。 已修補伺服器陣列中的所有伺服器。

預期的行為:如上述案例 1 所述,在伺服器陣列上自動啟用 KDFv2 之後,將會記錄下列事件。

 Source: AD FS 
 Level: Information 
 ID: 182 
 Message: AD FS enabled the new KDFv2 feature successfully. For more information on this, please see https://go.microsoft.com/fwlink/?linkid=2153807. 

注意

如果伺服器陣列中的任何伺服器正在執行 Windows Server 2016,則不會記錄事件 182。

案例 4:系統管理員已在其環境中的一或多部伺服器上停用 KDFv2。

預期的行為:下列記錄訊息將會記錄在 ADFS 服務啟動時已停用 KDFv2 之伺服器陣列中的每個系統。

 Source: AD FS 
 Level: Warning 
 ID: 183 
 Message: KDFv2 feature is disabled on AD FS farm. Please make sure that all the farm nodes are patched with latest Windows Updates and the KDFv2 feature is enabled to enhance the security of the farm. For more information on this, please see https://go.microsoft.com/fwlink/?linkid=2153807. 

下一筆