Intel Trust Domain Extensions(TDX)介绍

Intel Trust Domain Extensions(TDX)介绍

TDX

Intel Trust Domain Extensions (Intel TDX) 其实是一套软硬件结合的解决方案,包含很多组件:

  • VMX指令集扩展
  • MKTME技术
  • CPU attestation模型
  • 软件集合: TXD module / Intel authenticated code module / Intel quoting enclave

Intel Trust Domain Extensions (Intel TDX) 提供的功能有:

  • CPU状态加密和完整性保护
  • 内存加密和完整性保护
  • 地址翻译完整性保护
  • 安全的中断和异常投递
  • RA(remote attestation)

通过Intel TDX提供的功能,可以构造出区别于传统VM的TD(Trusted Domain)

在这里插入图片描述

TD运行在SEAM的non-root模式下,TDX module运行在SEAM的root模式下,通过调用SEAM call可以让CPU进入SEAM root模式,并且加载TDX module

TDX module

TDX module是一个Intel提供的,使用动态签名机制的,CPU attestation的安全加固模型,TDX module有以下功能:

  • 向VMM提供接口,用来创建/销毁/执行TD,解决特权级应用的问题
  • CPU/内存保护attestation
  • TD密钥的申请和管理
  • 减少攻击面

TDX 通过对VMM访问TD的限制或者监控,来保证TD运行过程中的安全,主要包括两个方面的操作

  1. TDX module能够保证在运行过程中,拦截不受信的软件(比如VMM)对TD资源的访问,比如CPU控制寄存器,MSR寄存器,调试寄存器,性能监控寄存器,时间戳寄存器等
  2. TD创建的时候可以选择是否授权TD使用调试和性能监控功能,如果允许的话方可使用,同时,TD attestation report时,也会将这些行为进行report

SEAM

Secure Arbitration Mode (SEAM) is an extension to the Virtual Machines Extension (VMX) architecture to define a new, VMX root operation called SEAM VMX root and a new VMX non-root operation called SEAM VMX non-root. Collectively, the SEAM VMX root and SEAM VMX non-root execution modes are called operation in SEAM.

SEAM VMX root operation is designed to host a CPU-attested, software module called the Intel® Trust-Domain Extensions (Intel® TDX) module to manage virtual machine (VM) guests called Trust Domains (TD).

SEAM VMX root operation is designed to additionally host a CPU-attested, software module called the Intel Persistent SEAM Loader (Intel P-SEAMLDR) to load and update Intel TDX modules.

The Intel TDX module helps implement the functions to build, tear down, and start execution of TD VMs.

The VMM is designed to provide the memory resources to build the TD and schedule the TD executions using the API provided by the Intel TDX module.

同时还引入了一个特殊的内存区域,SEAM Range

只有运行在SEAM range中的软件,才能够访问SRAM range中的数据。TDX module运行在SEAM range种,从而进一步加强与VMM之间的隔离

SEAM range使用MKTME(multi-key total memory encryption)进行数据加密,使用28bit的MAC进行数据完整性保护

在这里插入图片描述

通过NP-SEAMLDR加载R_SEAMLDR image到SEAM range中,再通过SEAMLDR将TDX module加载SEAM range 中,加载过程中会存在一个校验过程

在这里插入图片描述

The SEAM range is further partitioned into two sub-ranges by the processor:

  • MODULE_RANGE

  • P_SEAMLDR_RANGE

The processor transitions from legacy VMX-root operation to SEAM VMX-root operation in response to a SEAMCALL instruction invoked by the VMM. The processor transitions out of SEAM VMX-root operation to legacy VMX-root operation in response to a SEAMRET instruction.

The VMRESUME/VMLAUNCH instructions are used to help transition to the SEAM VMX non-root operation from SEAM VMX root operation. VM exits are designed to then exit from the SEAM VMX non-root transition to SEAM VMX root operation. The transitions are shown in Figure 1-3.

在这里插入图片描述

MKTME

TME

Intel TME(Total memory encrypt)使用一个临时随机的key来加密整个内存。所有的传入传出CPU的内存数据都被加密。这些内存数据包括用户身份信息、密钥、以及其他IP或者个人信息。Intel TME被开发用来为系统内存提供更好的保护,抵御一些硬件攻击,例如cold boot attack

TME在启动进程的早期就被启动,一旦开启并锁定就会使用NIST 标准AES-XTS算法用128bit的密钥来加密一个CPU外部内存总线上的所有数据。在内存中以及外部内存总线中的数据只有在CPU中的时候才是明文状态,类似于硬盘和SSDs的存储加密。用来加密内存的密钥是使用CPU中的加强随机数生成器生成的。在更好保护内存的同时允许已有的软件可以不经修改便能运行。

AES XTS加密引擎位于通往外部内存总线的直接数据路径上,因此,总线上所有进入或者离开CPU的内存数据都会使用AES XTS加密

  • AES XTS引擎
  • cpu生成的临时随机密钥
  • BIOS配置
  • 对软件透明
  • 性能(工作负载相关)

全部内存使用同一把平台密钥

MKTME

  • AES XTS引擎
  • 支持多把密钥
  • 以页为粒度管理密钥
  • 对部分软件透明
  • 性能(工作负载相关)
  • 支持软件设置和管理密钥
  • KeyId字段包含在PET中
  • IA paging
  • PTE paging
  • Iommu paging
  • 其他内存结构

MAC

MKTME只提供了数据加密的能力,不提供数据完整性保护

MAC提供两种数据完整性保护方案

  • crptographic-integrity protection scheme【默认使用方式】

    既能够阻止来自host软件的访问,还能够发现来自于软件/硬件的非法数据篡改

    基于SHA3的MAC

  • logic-integrity protection scheme

    只在逻辑上进行数据完整性保护,只是阻止非法的软件访问

MAC:对于每一个cache line,使用sha-3-256算法生成一个256bit的校验码,截断成28位,成为最终的校验码,同时logical生成的1bit数据也会包含在mac中

Logical:对于每一个cache line,维护一个1bit的数据,表示这个cache line对应的page是否和TD相关

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Hack Rabbit

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值