概述:在当今的信息技术领域,确保系统的安全性至关重要。VMware ESXi 作为一款强大的虚拟化平台,其安全性更是备受关注。TPM (Trusted Platform Module,可信平台模块)是一种安全芯片,它可以存储加密密钥、密码和数字证书等敏感信息。TPM还可以提供硬件级别的安全启动(Secure Boot)功能,其基于UEFI固件的安全标准确保系统在启动过程中只加载经过加密签名和验证的可信软件。它通过防止未经授权的驱动程序、内核或应用程序启动,有效抵御恶意软件和篡改攻击,确保系统的完整性和安全性。本文以Dell PowerEdge R550安装VMware ESXi8.0 为例,介绍如何使用TPM安全启动ESXi。
前提条件:确保服务器已经安装了兼容的TPM且ESXi的版本是6.7或更高
配置步骤:
第1步,确认服务器的引导模式为UEFI

第2步,启用TPM安全

第3步,配置TPM的加密算法为SHA256

第4步,启用Intel可信执行技术 (TXT)

第5步,启用安全启动(Secure Boot)

第6步,安装ESXi操作系统,具体步骤参考:《如何在服务器上安装VMware ESXi》

第7步,安装完毕后,正常引导进入ESXi


第8步,备份安全启动的恢复密钥
(1) 访问ESXi的命令行,具体步骤参考:《如何开启VMware ESXi的SSH和Shell服务》
(2) 运行如下命令查看ESXi安全启动的运行状态
[root@localhost:~] esxcli system settings encryption get
Mode: TPM
Require Executables Only From Installed VIBs: false
Require Secure Boot: true
(3)运行如下命令查看安全启动的恢复密钥(Recovery Key)(强烈建议手动将恢复密钥保存到安全的地方)
[root@localhost:~] esxcli system settings encryption recovery list
Recovery ID Key
————————————– —
{B7A9CF47-BEC9-46E8-B891-E7BF336C1A7F} 697983-303920-212247-101159-049724-088148-668025-284599-379662-100769-376562-434500-278125-149668-388743-505003
[root@localhost:~]

第9步,备份BIOS的设置
如果是戴尔PowerEdge服务器可以借助Easy Restore功能实现更换主板前后BIOS的设置是一致的。
Easy Restore 功能允许您在更换系统主板后还原系统的服务编号、许可证、UEFI 配置和系统配置数据(BIOS、iDRAC和NIC)。所有数据将自动备份到备份闪存设备中。如果 BIOS 检测到新的系统主板和备份闪存设备中的服务编号,BIOS 会提示用户恢复备份信息。
https://www.dell.com/support/kbdoc/zh-cn/000142633/
注意:
(1)开启了安全加密启动的ESXi,如需更换服务器主板或TPM等硬件,需要在更换完后确保BIOS设置和更换前一致,且在引导ESXi的过程需要按shift+o中输入备份的恢复密钥(Recovery Key)

encryptionRecoveryKey=xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx

如果出现:BIOS设置不一致(例如,未启用TPM)、未输入恢复密钥或者输入错误的恢复密钥等情况,ESXi将无法正常引导并伴随如下紫屏报错
The system has found a problem on your machine and cannot continue.
Unable to restore the system configuration. A security violation was detected. https://via.wmw.com/security-violation

(2)如果忘记或者未备份恢复密钥,那么只能重装ESXi系统。
(3)VMware ESXi 7.0U2以及更高的版本一旦开启TPM加密后就不支持不支持关闭,详见VMware官方手册说明:
如果在安装或升级到 vSphere 7.0 Update 2 或更高版本时未激活 TPM,则可以稍后使用以下命令进行激活。激活 TPM 后,您将无法撤消该设置。
https://docs.vmware.com/cn/VMware-vSphere/7.0/com.vmware.vsphere.security.doc/GUID-82C6B841-8B38-4D7D-8EFA-83AB1605F59D.html