2021 年 7 月 13 日,AD FS 发布了用于解决令牌重播攻击的更新,如 CVE-2021-33779 中所述。 这些更新引入了新的设置,用于启用和控制名为“KDFv2”的新密钥派生函数(KDF)。 此新版本的 KDF 比以前的版本更安全。 本文档介绍 CVE-2021-33779 安全修补程序启用的新设置,以及如何在不同的部署方案中启用这些设置。 有关特定于产品的 KB 编号和相关下载,请参阅 CVE 文章中提供的链接。
KDFv2 设置:
KDFv2 可由 AD FS 服务器上的管理员配置,以多种模式之一运行,如下所示:
- 无 - (默认值) 这用于跟踪 KDFv2 设置值是否已更改。 管理员可能无法设置此值。
- 已禁用 - 可以设置此值以将 Key Derivation 函数还原为其原始行为,以防启用 KDFv2 时遇到任何问题。
- 已启用 - 启用 KDFv2 支持。 ADFS 服务器将公告它支持的新功能。 如果使用原始 KDF 版本从客户端发送初始主刷新令牌(PRT)请求,ADFS 将接受请求并使用原始 KDF。 这样就能够支持未修补的客户端。
- 已强制启用 - 启用 KDFv2 支持并禁止(拒绝)使用原始 KDF 的初始 PRT 请求。 管理员确信所有客户端都已修补后,他们可以切换到强制模式。
AD FS 服务器上的管理员可以通过以下 PowerShell 命令更改 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.