logo资料库

tboot的安装配置流程.docx

第1页 / 共5页
第2页 / 共5页
第3页 / 共5页
第4页 / 共5页
第5页 / 共5页
资料共5页,全文预览结束
Tboot 安装配置流程分析
文档名称 文档密级 Tboot 安装配置流程分析 注:文中红色部分,需要根据自己的具体环境配置来替换。 1. 通过bios设置将tpm,txt等设置打开。Bios界面可能会根据pc厂商不同。 2. 通过yast 软件管理安装tboot,TrouSers,tpm_tools,intel -SINIT。 3. 第一次时执行modprobe tpm_tis,(有的环境需要加上force=1 interrupts=0)加载模块 4. 执行tcsd,启动TrouSers。 5. 检查tpm是否可用,执行tpm_version. 6. 然后执行tpm密码设置,执行tpm_takeownership,密码一定要牢记,只能初始化一次。 后续再尝试会失败。 7. 到此为止准备工作已经就绪。下面是设置tboot的nv index 和LCP policy以及verified launch policy。 8. Define tboot error TPM NV index: tpmnv_defindex -i 0x20000002 -s 8 -pv 0 -rl 0x07 -wl 0x07 -p TPM-owner-password 9. Define LCP and Verified Launch policy indices: tpmnv_defindex -i owner -s 0x36 -p TPM-owner-password tpmnv_defindex -i 0x20000001 -s 512 -pv 0x02 -p TPM-owner-password 2022-6-10 华为机密,未经许可不得扩散 第 1页, 共 5页
文档名称 文档密级 10. Create LCP policy, define a temp directory (e.g. /tmp/temp/tboot/): 11. Create an MLE element: lcp_mlehash -c "logging=serial,vga,memory" /boot/tboot.gz > mle_hash lcp_crtpolelt --create --type mle --ctrl 0x00 --minver 17 --out mle.elt mle_hash 12. Create a PCONF element: cat /sys/devices/platform/tpm_tis/pcrs |grep -e PCR-00 -e PCR-01 > pcrs lcp_crtpolelt --create --type pconf --out pconf.elt pcrs 13. Combine the elements into an unsigned list: lcp_crtpollist --create --out list_unsig.lst mle.elt pconf.elt 14. Use lcp_crtpollist to sign the list: openssl genrsa -out privkey.pem 2048 openssl rsa -pubout -in privkey.pem -out pubkey.pem cp list_unsig.lst list_sig.lst lcp_crtpollist --sign --pub pubkey.pem --priv privkey.pem --out list_sig.lst 15. Create policy and policy data files: lcp_crtpol2 --create --type list --pol list.pol --data list.data list_{unsig,sig}.lst 16. Create Verified Launch policy: tb_polgen --create --type nonfatal vl.pol tb_polgen --add --num 0 --pcr none --hash image --cmdline "" --image /boot/xen.gz vl.pol tb_polgen --add --num 1 --pcr 19 --hash image --cmdline "root=/dev/disk/by-id/ata-WDC_WD3200AAJS-08L7A0_WD-WMAV2CA81426-part3 resume=/dev/disk/by-id/ata-WDC_WD3200AAJS-08L7A0_WD-WMAV2CA81426-part2 splash=silent showopts" --image /boot/vmlinuz-3.0.13-0.27-xen vl.pol tb_polgen --add --num 2 --pcr 19 --hash image --cmdline "" --image /boot/initrd-3.0.13-0.27-xen vl.pol 17. Write LCP and Verified Launch policies to TPM: lcp_writepol -i owner -f list.pol -p TPM-owner-password lcp_writepol -i 0x20000001 -f vl.pol -p TPM-owner-password 18. Modify /boot/grub/menu.lst, add the following title: 2022-6-10 华为机密,未经许可不得扩散 第 2页, 共 5页
文档名称 文档密级 title Xen -- SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27(TBOOT) root (hd0,2) kernel /boot/tboot.gz logging=serial,vga,memory module /boot/xen.gz module /tmp/temp/tboot/list.data module /boot/vmlinuz-3.0.13-0.27-xen root=/dev/disk/by-id/ata-WDC_WD3200AAJS-08L7A0_WD-WMAV2CA81426-part3 resume=/dev/disk/by-id/ata-WDC_WD3200AAJS-08L7A0_WD-WMAV2CA81426-part2 splash=silent showopts module /boot/initrd-3.0.13-0.27-xen module /usr/lib/sinit/i5_i7_DUAL_SINIT_51.BIN 19. Restart system, choose this title, press enter. 20. You can see the TBOOT message displayed, followed by OS loading. 21. After logging in system, you can run txt-stat to get the TBOOT memory log. 22. Check the TBOOT log, you can see “ERRORCODE: 0x00000000” on line 17, it indicate TBOOT start without error. “TXT measured launch: TRUE secrets flag set: TRUE” on line 31, 32. Which indicate TBOOT do a measurement successfully. 23. Following will display detailed measurement message, such as a) b) c) verifying module "/boot/xen.gz " verifying module "/boot/vmlinuz-3.0.13-0.27-xen” verifying module "/boot/initrd-3.0.13-0.27-xen" 24. PCRS used by TBOOT PCR No. Usage 17 18 19 Measurement of MLE Measurement TBOOT and policy configuration Measurement policy for OS kernel. 2022-6-10 华为机密,未经许可不得扩散 第 3页, 共 5页
文档名称 文档密级 25. You can check the PCRS through the following statement: cat /sys/class/misc/tpm0/device/pcrs 26. 尝试过更改Verified Launch policy,用非启动内核文件进行hash作为policy的值(e.g. 步 骤18的第三条语句中的/boot/vmlinuz-3.0.13-0.27-xen换成 /boot/vmlinuz-3.0.13-0.27-default)。或者某个内核文件的command line参数配置不同。然 后重启进行校验,也可以启动系统,TBOOT的log会显示verification failed。参考如下log。 参考: 1. 2. 3. tboot-1.7.1\docs\ policy_v2.txt tboot-1.7.1\lcptools\ lcptools2.txt tboot-1.7.1\lcptools\ Linux_LCP_Tools_User_Manual.doc 2022-6-10 华为机密,未经许可不得扩散 第 4页, 共 5页
文档名称 文档密级 4. <<可信计算技术原理与应用>> 邹德清,羌卫中,金海 编著 – 第六章 5. http://www.suse.com/download-linux/ 6. http://software.intel.com/en-us/articles/intel-trusted-execution-technology/ 7. 432407_432407_TXT_Server_Design_Guide_1.4c.pdf 8. Trusted Execution Technology and Tboot Implementation(c01728320.pdf) 配置TBOOT环境遇到的问题及需要注意的事项 1. 我们的机器是thinkcenter, 处理器信息如下,用i5_i7_DUAL_SINIT_51.BIN 版本的。 SINIT 的版本和cpu芯片组有关系,请根据各自的环境配置 2. 开始的配置中,未将 LCP policy产生的list.data作为module加载到menu.lst当中, 所以若 校验LCP policy,则TBOOT启动失败。 3. 若规则设定错误,可以通过tpm_relindex 指令删除index, 重新设置index。 2022-6-10 华为机密,未经许可不得扩散 第 5页, 共 5页
分享到:
收藏