19.11. 在 Windows 虚拟机上启用增强的硬件安全
为进一步保护 Windows 虚拟机(VM),您可以启用基于虚拟化的代码完整性保护,也称为 hypervisor 保护的代码完整性(HVCI)。
先决条件
- 确保启用了标准硬件安全。如需更多信息,请参阅在 Windows 虚拟机上启用标准硬件安全性。
- 确保启用了 Hyper-V enlightenments。如需更多信息,请参阅启用 Hyper-Vlightenments。
流程
打开 Windows 虚拟机的 XML 配置。以下示例打开 Example-L1 虚拟机的配置:
virsh edit Example-L1
# virsh edit Example-L1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在
<cpu>
部分下,指定 CPU 模式并添加策略标记。重要-
对于 Intel CPU,启用
vmx
策略标记。 -
对于 AMD CPU,启用
svm
策略标记。 -
如果您不想指定一个自定义 CPU,您可以将
<cpu mode>
设置为host-passthrough
。
<cpu mode='custom' match='exact' check='partial'> <model fallback='allow'>Skylake-Client-IBRS</model> <topology sockets='1' dies='1' cores='4' threads='1'/> <feature policy='require' name='vmx'/> </cpu>
<cpu mode='custom' match='exact' check='partial'> <model fallback='allow'>Skylake-Client-IBRS</model> <topology sockets='1' dies='1' cores='4' threads='1'/> <feature policy='require' name='vmx'/> </cpu>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
对于 Intel CPU,启用
- 保存 XML 配置并重启虚拟机。
在虚拟机操作系统中,进入到 Core 隔离详情页 :
settings > Update & Security > Windows Security > Device Security > Core isolated details
- 切换开关以启用 内存完整性。
- 重启虚拟机。
注意
有关启用 HVCI 的其他方法,请查看相关的 Microsoft 文档。
验证
确保 Windows 虚拟机上的 Device Security 页面显示以下信息:
settings > Update & Security > Windows Security > device Security
Your device meets the requirements for enhanced hardware security.
Your device meets the requirements for enhanced hardware security.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 或者,检查有关 Windows 虚拟机的系统信息:
-
在命令提示符下运行
msinfo32.exe
。 - 检查 Credential Guard, Hypervisor enforced Code Integrity 是否在 Virtualization-based security Services Running 下列出。
-
在命令提示符下运行