如何创建 Amazon 二进制 blob - Amazon Elastic Compute Cloud
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

如何创建 Amazon 二进制 blob

您可以使用以下步骤在 AMI 创建期间自定义 UEFI 安全启动变量。这些步骤中使用的 KEK 截止到 2021 年 9 月。如果 Microsoft 更新 KEK,您必须使用最新的 KEK。

要创建 Amazon 二进制 blob
  1. 创建一个空的 PK 签名列表。

    touch empty_key.crt cert-to-efi-sig-list empty_key.crt PK.esl
  2. 下载 KEK 证书。

    https://go.microsoft.com/fwlink/?LinkId=321185
  3. 将 KEK 证书包装在 UEFI 签名列表中(siglist)。

    sbsiglist --owner 77fa9abd-0359-4d32-bd60-28f4e78f784b --type x509 --output MS_Win_KEK.esl MicCorKEKCA2011_2011-06-24.crt
  4. 下载 Microsoft 的 db 证书。

    https://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt https://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt
  5. 生成 db 签名列表。

    sbsiglist --owner 77fa9abd-0359-4d32-bd60-28f4e78f784b --type x509 --output MS_Win_db.esl MicWinProPCA2011_2011-10-19.crt sbsiglist --owner 77fa9abd-0359-4d32-bd60-28f4e78f784b --type x509 --output MS_UEFI_db.esl MicCorUEFCA2011_2011-06-27.crt cat MS_Win_db.esl MS_UEFI_db.esl > MS_db.esl
  6. 从以下链接下载更新的 dbx 更改请求。

    https://uefi.org/revocationlistfile
  7. 您在上一步中下载的 dbx 更改请求已使用 Microsoft KEK 签名,因此您需要删除或解压它。您可以使用以下链接。

    https://gist.github.com/out0xb2/f8e0bae94214889a89ac67fceb37f8c0
    https://support.microsoft.com/en-us/topic/microsoft-guidance-for-applying-secure-boot-dbx-update-e3b9e4cb-a330-b3ba-a602-15083965d9ca
  8. 使用 uefivars.py 脚本构建 UEFI 变量存储。

    ./uefivars.py -i none -o aws -O uefiblob-microsoft-keys-empty-pk.bin -P ~/PK.esl -K ~/MS_Win_KEK.esl --db ~/MS_db.esl --dbx ~/dbx-2021-April.bin
  9. 检查二进制 blob 和 UEFI 变量存储。

    ./uefivars.py -i aws -I uefiblob-microsoft-keys-empty-pk.bin -o json | less
  10. 您可以通过再次将 blob 传递给同一个工具来更新它。

    ./uefivars.py -i aws -I uefiblob-microsoft-keys-empty-pk.bin -o aws -O uefiblob-microsoft-keys-empty-pk.bin -P ~/PK.esl -K ~/MS_Win_KEK.esl --db ~/MS_db.esl --dbx ~/dbx-2021-April.bin

    预期输出

    Replacing PK Replacing KEK Replacing db Replacing dbx