vtpm使用手册

Copyright (c) 2010-2012 United States Government, as represented by
the Secretary of Defense.  All rights reserved.
November 12 2012
Authors: Matthew Fioravante (JHUAPL), Daniel De Graaf (NSA)

This document describes the virtual Trusted Platform Module (vTPM) subsystem
for Xen. The reader is assumed to have familiarity with building and installing
Xen, Linux, and a basic understanding of the TPM and vTPM concepts.
该文档用于介绍xen平台上的虚拟vtpm子系统
------------------------------
INTRODUCTION
------------------------------
The goal of this work is to provide a TPM functionality to a virtual guest
operating system (a DomU).  This allows programs to interact with a TPM in a
virtual system the same way they interact with a TPM on the physical system.
Each guest gets its own unique, emulated, software TPM.  However, each of the
vTPM‘s secrets (Keys, NVRAM, etc) are managed by a vTPM Manager domain, which
seals the secrets to the Physical TPM.  If the process of creating each of these
domains (manager, vTPM, and guest) is trusted, the vTPM subsystem extends the
chain of trust rooted in the hardware TPM to virtual machines in Xen. Each
major component of vTPM is implemented as a separate domain, providing secure
separation guaranteed by the hypervisor. The vTPM domains are implemented in
mini-os to reduce memory and processor overhead.
 
This mini-os vTPM subsystem was built on top of the previous vTPM
work done by IBM and Intel corporation.
 
------------------------------
DESIGN OVERVIEW
------------------------------

The architecture of vTPM is described below:

+------------------+
|    Linux DomU    | ...
|       |  ^       |
|       v  |       |
|   xen-tpmfront   |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
|  vtpm-stubdom    | ...
|       |  ^       |
|       v  |       |
| mini-os/tpmfront |
+------------------+
        |  ^
        v  |
+------------------+
| mini-os/tpmback  |
|       |  ^       |
|       v  |       |
| vtpmmgr-stubdom  |
|       |  ^       |
|       v  |       |
| mini-os/tpm_tis  |
+------------------+
        |  ^
        v  |
+------------------+
|   Hardware TPM   |
+------------------+
 * Linux DomU: The Linux based guest that wants to use a vTPM. There many be
               more than one of these.

* xen-tpmfront.ko: Linux kernel virtual TPM frontend driver. This driver
                    provides vTPM access to a para-virtualized Linux based DomU.

* mini-os/tpmback: Mini-os TPM backend driver. The Linux frontend driver
                    connects to this backend driver to facilitate
                    communications between the Linux DomU and its vTPM. This
                    driver is also used by vtpmmgr-stubdom to communicate with
                    vtpm-stubdom.

* vtpm-stubdom: A mini-os stub domain that implements a vTPM. There is a
                 one to one mapping between running vtpm-stubdom instances and
                 logical vtpms on the system. The vTPM Platform Configuration
                 Registers (PCRs) are all initialized to zero.

* mini-os/tpmfront: Mini-os TPM frontend driver. The vTPM mini-os domain
                     vtpm-stubdom uses this driver to communicate with
                     vtpmmgr-stubdom. This driver could also be used separately to
                     implement a mini-os domain that wishes to use a vTPM of
                     its own.

* vtpmmgr-stubdom: A mini-os domain that implements the vTPM manager.
               There is only one vTPM manager and it should be running during
               the entire lifetime of the machine.  This domain regulates
               access to the physical TPM on the system and secures the
               persistent state of each vTPM.

* mini-os/tpm_tis: Mini-os TPM version 1.2 TPM Interface Specification (TIS)
                    driver. This driver used by vtpmmgr-stubdom to talk directly to
                    the hardware TPM. Communication is facilitated by mapping
                    hardware memory pages into vtpmmgr-stubdom.

* Hardware TPM: The physical TPM that is soldered onto the motherboard.

------------------------------
INSTALLATION
------------------------------

Prerequisites:
--------------
You must have an x86 machine with a TPM on the motherboard.
The only software requirement to compiling vTPM is cmake.
You must use libxl to manage domains with vTPMs. ‘xm‘ is
deprecated and does not support vTPM.

Compiling the XEN tree:
-----------------------

Compile and install the XEN tree as usual. Be sure to build and install
the stubdom tree.

Compiling the LINUX dom0 kernel:
--------------------------------

The Linux dom0 kernel should not try accessing the TPM while the vTPM
Manager domain is accessing it; the simplest way to accomplish this is
to ensure the kernel is compiled without a driver for the TPM, or avoid
loading the driver by blacklisting the module.

Compiling the LINUX domU kernel:
--------------------------------

The domU kernel used by domains with vtpms must include the xen-tpmfront.ko
driver. It can be built directly into the kernel or as a module; however, some
features such as IMA require the TPM to be built in to the kernel.

CONFIG_TCG_TPM=y
CONFIG_TCG_XEN=y

------------------------------
VTPM MANAGER SETUP
------------------------------

Manager disk image setup:
-------------------------

The vTPM Manager requires a disk image to store its
encrypted data. The image does not require a filesystem
and can live anywhere on the host disk. The image does not need
to be large. 8 to 16 Mb should be sufficient.

# dd if=/dev/zero of=/var/vtpmmgr-stubdom.img bs=16M count=1

Manager config file:
--------------------

The vTPM Manager domain (vtpmmgr-stubdom) must be started like
any other Xen virtual machine and requires a config file.
The manager requires a disk image for storage and permission
to access the hardware memory pages for the TPM. An
example configuration looks like the following.

kernel="/usr/lib/xen/boot/vtpmmgr-stubdom.gz"
memory=16
disk=["file:/var/vtpmmgr-stubdom.img,hda,w"]
name="vtpmmgr"
iomem=["fed40,5"]

The iomem line tells xl to allow access to all of the TPM IO memory
pages, which are 5 pages (one per locality) that start at 0xfed40000. By
default, the TPM manager uses locality 0 (so only the page at 0xfed40 is
needed); this can be changed on the domain‘s command line.

Starting and stopping the manager:
----------------------------------

The vTPM manager should be started at boot, you may wish to
create an init script to do this.

# xl create -c vtpmmgr-stubdom.cfg

Once initialization is complete you should see the following:
INFO[VTPM]: Waiting for commands from vTPM‘s:

To shutdown the manager you must destroy it. To avoid data corruption,
only destroy the manager when you see the above "Waiting for commands"
message. This ensures the disk is in a consistent state.

# xl destroy vtpmmgr-stubdom

------------------------------
VTPM AND LINUX PVM SETUP
------------------------------

In the following examples we will assume we have Linux
guest named "domu" with its associated configuration
located at /home/user/domu. It‘s vtpm will be named
domu-vtpm.

vTPM disk image setup:
----------------------

The vTPM requires a disk image to store its persistent
data. The image does not require a filesystem. The image
does not need to be large. 8 Mb should be sufficient.

# dd if=/dev/zero of=/home/user/domu/vtpm.img bs=8M count=1

vTPM config file:
-----------------

The vTPM domain requires a configuration file like
any other domain. The vTPM requires a disk image for
storage and a TPM frontend driver to communicate
with the manager. An example configuration is given:

kernel="/usr/lib/xen/boot/vtpm-stubdom.gz"
memory=8
disk=["file:/home/user/domu/vtpm.img,hda,w"]
name="domu-vtpm"
vtpm=["backend=vtpmmgr,uuid=ac0a5b9e-cbe2-4c07-b43b-1d69e46fb839"]

The vtpm= line sets up the tpm frontend driver. The backend must set
to vtpmmgr. You are required to generate a uuid for this vtpm.
You can use the uuidgen unix program or some other method to create a
uuid. The uuid uniquely identifies this vtpm to manager.

If you wish to clear the vTPM data you can either recreate the
disk image or change the uuid.

Linux Guest config file:
------------------------

The Linux guest config file needs to be modified to include
the Linux tpmfront driver. Add the following line:

vtpm=["backend=domu-vtpm"]

Currently only Linux guests are supported (PV or HVM with PV drivers).

Launching and shut down:
------------------------

To launch a Linux guest with a vTPM we first have to start the vTPM domain.

# xl create -c /home/user/domu/vtpm.cfg

After initialization is complete, you should see the following:
Info: Waiting for frontend domain to connect..

Next, launch the Linux guest

# xl create -c /home/user/domu/domu.cfg

If xen-tpmfront was compiled as a module, be sure to load it
in the guest.

# modprobe xen-tpmfront

After the Linux domain boots and the xen-tpmfront driver is loaded,
you should see the following on the vtpm console:

Info: VTPM attached to Frontend X/Y

If you have trousers and tpm_tools installed on the guest, you can test the
vtpm.

On guest:
# tcsd (if tcsd is not running already)
# tpm_version

The version command should return the following:
  TPM 1.2 Version Info:
  Chip Version:        1.2.0.7
  Spec Level:          2
  Errata Revision:     1
  TPM Vendor ID:       ETHZ
  TPM Version:         01010000
  Manufacturer Info:   4554485a

You should also see the command being sent to the vtpm console as well
as the vtpm saving its state. You should see the vtpm key being
encrypted and stored on the vtpmmgr console.

You may wish to write a script to start your vtpm and guest together and
to destroy the vtpm when the guest shuts down.

------------------------------
INTEGRATION WITH PV-GRUB
------------------------------

The vTPM currently starts up with all PCRs set to their default values (all
zeros for the lower 16).  This means that any decisions about the
trustworthiness of the created domain must be made based on the environment that
created the vTPM and the domU; for example, a system that only constructs images
using a trusted configuration and guest kernel be able to provide guarantees
about the guests and any measurements done that kernel (such as the IMA TCB
log).  Guests wishing to use a custom kernel in such a secure environment are
often started using the pv-grub bootloader as the kernel, which then can load
the untrusted kernel without needing to parse an untrusted filesystem and kernel
in dom0.  If the pv-grub stub domain succeeds in connecting to a vTPM, it will
extend the hash of the kernel that it boots into PCR #4, and will extend the
command line and initrd into PCR #5 before booting so that a domU booted in this
way can attest to its early boot state.

------------------------------
MORE INFORMATION
------------------------------

See stubdom/vtpmmgr/README for more details about how
the manager domain works, how to use it, and its command line
parameters.

See stubdom/vtpm/README for more specifics about how vtpm-stubdom
operates and the command line options it accepts.

时间: 2024-10-16 15:02:57

vtpm使用手册的相关文章

angular参考手册拷贝

AngularJS 参考手册 AngularJS 指令 本教程用到的 AngularJS 指令 : 指令 描述 ng-app 定义应用程序的根元素. ng-bind 绑定 HTML 元素到应用程序数据 ng-bind-html 绑定 HTML 元素的 innerHTML 到应用程序数据,并移除 HTML 字符串中危险字符 ng-bind-template 规定要使用模板替换的文本内容 ng-blur 规定 blur 事件的行为 ng-change 规定在内容改变时要执行的表达式 ng-check

Exchange 2013迁移SOP手册

Exchange 2013迁移SOP手册 阶段1:环境部署 OUTLOOK升级方式 统计版本低于SP3的OUTLOOK客户端信息 记录计算机在域中所在OU信息 域中创建临时升级用OU,如MAILUPGRADE 采用如下命令移动计算机到MAILUPGRADE OU dsmove "CN=Aidong Qi,OU=Users,OU=TESTP,OU=Hitech,DC=hitechad,DC=com" -newparent OU=MAILUPGRADE,DC=hitechad,DC=com

oracle11g dataguard 完全手册

一.前言: 网络上关于dataguard的配置文章很多,但是很多打着oracle11g的文章实际都是只能在9 10 上运行,比如FAL_CLIENT在11g中已经废弃,但是现在网络上的文章都是没有标注这一点.而且对于具体含义语焉不详对于新手只能知其然而不知其所以然.这篇文章我就想让像我这样的人对于dataguard配置不仅仅知道怎么配置,还要知道为什么需要这样配置,这样的效果才是最好的. 这篇文章不仅仅是记录如何配置,还介绍了为什么是这样,以及注意要点,我希望这个文章可以作为进行dataguar

小书匠语法使用手册

小书匠语法使用手册 小书匠 语法 MARKDOWN 帮助 常用语法 标题 1这是 H1 一级标题 2------ 3这是 H2 二级标题 4====== 5# 这是 H1 一级标题 6## 这是 H2 二级标题 7### 这是 H3 三级标题 8#### 这是 H4 四级标题 9##### 这是 H5 五级标题 10###### 这是 H6 六级标题 11 快捷键: [ctrl + h] 列表 无序列表 1* 项目1 2 * 子项目1.1 3 * 子项目1.2 4 * 子项目1.2.1 5* 项

[笔记][Java7并发编程实战手册]3.2 资源的并发访问控制Semaphore信号量

[笔记][Java7并发编程实战手册]系列目录 简介 本文学习信号量Semaphore机制. Semaphore 本质是一个共享锁 内部维护一个可用的信号集,获取信号量之前需要先申请获取信号数量:用完之后,则需要释放信号量:如果不释放,那么其他等待线程则一直阻塞直到获取信号量或则被中断为止 本人的理解是:互斥锁是同一时间只能一个线程访问,而在这里,是同一时间允许获取到了信号量的线程并发访问,而没有获取到信号量的则必须等待信号量的释放: 将信号量初始化为 1,使得它在使用时最多只有一个可用的许可,

SVN Server环境安装配置手册

SVN Server环境安装配置手册_百度文库 http://wenku.baidu.com/link?url=923bv1olSkznh1gWd7Gqoxxwj18IHIlTXcEbNiPSLM5H32k93UtQ22rAVppNIlVv89ru4E1cPFe1yESSEkSsR4NfDMMRgpA2d3GI_KcV37m

《开源分享1》:前端开发必备《Html-CSS中文手册》

一直想做一些优秀的资源分享内容,今天尝试整理了一下,以后会每天抽点时间发一些自认为不错的资料出来.帮助大家提高学习效率. 今天分享的内容:前端开发:<Html-CSS中文手册>! 本手册针对的是已有一定网页设计制作经验的读者.其目的是提供完整清晰的样式表内容的快速索引及进阶帮助.所以对于网页制作和样式表的基础知识,仅简单介绍,恕不赘述. 手册提供了完整的 CSS2.0 的属性(Properties).规则(At-Rules).伪类(Pseudo-Classes).伪元素(Pseudo-Elem

LINUX基本命令行手册一

linux基本命令行手册一    1.1基本的网络命令        1>wget 从服务器上检索或下载文件,支持HTTP,HTTPS,FTP协议,服务器响应后,会将请求到的文件下载到当前用户所处的目录下        语法:wget [option]... [URL]...        option:            -t:尝试请求服务器的次数,若在指定的次数内,未响应,则断开链接            -o:将信息输出保存在记录文件中            -nc:支持断点下载,当下

linux 打造man中文帮助手册

步骤 下载开源的man-pages 中文手册包 配置解压手册包 安装 测试 参考资料 学IT的同学都知道, Linux是一个好东西, 但初学者往往会因为太多的命令觉得头疼, 更头疼的是所有的帮助文档都是英文. 其实Linux之所以强大, 就在于其强大的命令行, 如此繁杂的命令让一个六级以下英语水平的同学去看实在是一件很残忍的事, 甚至极大打消了很多同学学习Linux的热情. 这篇文章就为广大英语不好的Linux初学者们提供了一个简便的方法把man帮助信息变成中文. 步骤 下载开源的man-pag