3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBM Cloud: VSI for VPCでSecure Bootを試してみた

Last updated at Posted at 2024-10-06

1. はじめに

IBM CloudのVSI for VPCでもSecure Bootがサポートされたので検証してみた。

なお、Secure Boot(セキュアブート)とは、コンピュータの起動時に、システムが信頼できるソフトウェアだけを実行することを確認するためのセキュリティ機能である。Secure Bootによって、ブート時に実行されるソフトウェアの署名を検証し、OSやドライバなどが改ざんされていたり、悪意のあるソフトウェアに置き換えられていた場合、それらをブロックすることで不正なアクセスやマルウェアの感染を防ぐ役割を果たす。

2. IBM CloudでSecure Bootを利用するためには

Secure Bootは、

  • 従来のBIOSではなく、UEFI(統一拡張ファームウェアインターフェース)を利用する必要がある。
  • Boot領域として、MBRではなくGPTを利用する必要がある。

この要件を満たすために、IBM Cloudでは、(IBM Cloudにとっての)第三世代CPUのVSIであるIntel Sapphire Rapidsベースのサーバー(bx3d, cx3d, mx3d 等のような3という数字が入っているプロファイル)を利用する必要がある。(第二世代のVSIはIntel CascadeLakeの環境であり、bx2, cx2, mx2 等のような2という数字が入っているプロファイルに相当する)

Secure boot is available on only third-generation Sapphire Rapids-based virtual servers with the exception of the following profiles.
mx3d-128x1280
mx3d-176x1760
bx3d-176x880

以下では、Secure Boot非対応の環境と、Secure Boot対応環境を比較してみる。

3. 注文画面

  • 第二世代環境(bx2とかになっているもの: CascadeLake環境)だと、SecureBootが選択画面に出てこない
    image.png
  • 第三世代環境(bx3とかになっているもの: Sapphire Rapids環境)だと、SecureBootが選択可能。
    image.png
  • なお、第三世代環境においては、注文後の画面はこのようになっており、後から有効・無効を切り替えることも可能。image.png

4. システム情報

4-1. まとめ

  • 第二世代環境ではLegacy BIOSが利用されており、Secure Bootはunsupported。
  • 第三世代環境ではUEFIが利用されており、Secure Bootはon/offが切り替えられる。

4-2. 出力結果

システム情報を見る方法
PS C:\> msinfo32.exe
  • bx2-2x8プロファイル

    • OS: Windows Server 2022 Standard
    • Processor: CascadeLake
    • BIOS Mode: Legacy(従来のBIOS)
    • Secure Boot State: Unsupported
      image.png
  • bx3d-2x10プロファイル(VSI for VPCでSecure Bootを有効にしている場合)

    • OS: Windows Server 2022 Standard
    • Processor: SapphireRapids
    • BIOS Mode: UEFI
    • Secure Boot State: On
      image.png
  • bx3d-2x10プロファイル(VSI for VPCでSecure Bootを無効にしている場合)

    • OS: Windows Server 2022 Standard
    • Processor: SapphireRapids
    • BIOS Mode: UEFI
    • Secure Boot State: Off
      image.png

(参考)Windows2016でもこの記事執筆時点でのImageで第三世代環境を利用すれば、UEFIをサポートしておりSecure Bootで起動できた。

  • bx3d-2x10プロファイル(VSI for VPCでSecure Bootを有効にしている場合)
    • OS: Windows Server 2016 Standard
    • Processor: SapphireRapids
    • BIOS Mode: UEFI
    • Secure Boot State: On
      image.png

5. Confirm-SecureBootUEFIの出力結果

5-1. まとめ

  • 第二世代環境ではConfirm-SecureBootUEFIは実行エラーになる。
  • 第三世代環境ではConfirm-SecureBootUEFIは、Secure Bootが有効なときはTrue、無効の時はFalseを返す。

5-2. 出力結果

bx2-2x8プロファイル
PS C:\> Confirm-SecureBootUEFI
Confirm-SecureBootUEFI : Cmdlet not supported on this platform: 0xC0000002
At line:1 char:1
+ Confirm-SecureBootUEFI
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (Microsoft.Secur...BootUefiCommand:ConfirmSecureBootUefiCommand) [Confir
   m-SecureBootUEFI], PlatformNotSupportedException
    + FullyQualifiedErrorId : GetFWVarFailed,Microsoft.SecureBoot.Commands.ConfirmSecureBootUefiCommand
bx3d-2x10プロファイル(VSI for VPCでSecure Bootを有効にしている場合)
PS C:\> Confirm-SecureBootUEFI
True
bx3d-2x10プロファイル(VSI for VPCでSecure Bootを無効にしている場合)
PS C:\> Confirm-SecureBootUEFI
False

6. Device Securityの出力結果

6-1. まとめ

  • 第二世代環境もしくは、第三世代環境でもSecure Bootが無効な時にはSecure Bootが表示されない。
  • 第三世代環境でSecure Bootを有効にしている時は、Secure Bootが表示される。

なお、Device Securityは、以下のようにして表示可能。
image.png

6-2. 出力結果

  • bx2-2x8プロファイル
    image.png
  • bx3d-2x10プロファイル(VSI for VPCでSecure Bootを有効にしている場合)
    image.png
  • bx3d-2x10プロファイル(VSI for VPCでSecure Bootを無効にしている場合)
    image.png

7. ディスク情報

7-1. まとめ

  • 第二世代環境ではMBRを利用している。
  • 第三世代環境ではGPTを利用している。

7-2. 出力結果

ディスク情報
PS C:\> diskmgmt.msc
  • bx2-2x8プロファイル
    image.png

  • bx3d-2x10プロファイル
    image.png

8. ブートローダー

8-1. まとめ

  • 第二世代環境では「winload.exe」を利用している。
  • 第三世代環境では「winload.efiを利用している。

8-2. 出力結果

bx2-2x8プロファイル
PS C:\> bcdedit.exe

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
bootshutdowndisabled    Yes
default                 {current}
resumeobject            {337b601d-cbdc-11ec-a7f6-e1c772454792}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows Server
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {ec410426-0777-11ef-b280-b6436a9c2cf4}
displaymessageoverride  Recovery
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {337b601d-cbdc-11ec-a7f6-e1c772454792}
nx                      OptOut
ems                     Yes
bx3d-2x10プロファイル
PS C:\> bcdedit.exe

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume3
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
bootshutdowndisabled    Yes
default                 {current}
resumeobject            {8ebb67d0-ddd7-11eb-bde8-9b9ca07185bc}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows Server
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {e0d2100f-82b8-11ef-b28f-ea5ca280764d}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {8ebb67d0-ddd7-11eb-bde8-9b9ca07185bc}
nx                      OptOut

9.(参考)Linux環境

Linux環境でもSecure Bootは有効である。RHEL9でbx3d-2x10プロファイル(VSI for VPCでSecure Bootを有効にしている場合)を利用した際の結果は以下のとおり。

image.png

Secure Bootが有効になっている時と無効になっている時の比較
#SecureBootが有効な時
[root@syasuda-rhel9-sec ~]# mokutil --sb-state
SecureBoot enabled

#SecureBootが無効な時
[root@syasuda-rhel9-sec ~]# mokutil --sb-state
SecureBoot disabled
Platform is in Setup Mode
UEFIが利用されている
[root@syasuda-rhel9-sec ~]# [[ -d /sys/firmware/efi ]] && echo UEFI || echo BIOS
UEFI
Secure Bootが有効になっている時と無効になっている時の比較
#SecureBootが有効な時
[root@syasuda-rhel9-sec ~]# dmesg | grep -i "EFI"
[    0.000000] efi: EFI v2.7 by Ubuntu distribution of EDK II
[    0.000000] efi: SMBIOS=0x7e9d4000 ACPI=0x7eb7d000 ACPI 2.0=0x7eb7d014 MEMATTR=0x7d1b0018 MOKvar=0x7e980000 RNG=0x7eb70018
[    0.000000] Kernel is locked down from EFI Secure Boot mode; see man kernel_lockdown.7
[    0.047068] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.520892] pci 0000:00:01.0: BAR 0: assigned to efifb
[    0.599894] Registered efivars operations
[    0.953443] efifb: probing for efifb
[    0.953469] efifb: framebuffer at 0x80000000, using 1876k, total 1875k
[    0.953471] efifb: mode is 800x600x32, linelength=3200, pages=1
[    0.953472] efifb: scrolling: redraw
[    0.953472] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    0.956606] fb0: EFI VGA frame buffer device
[    0.956623] EFI Variables Facility v0.08 2004-May-17
[    1.607126] integrity: Loading X.509 certificate: UEFI:db
[    1.607568] integrity: Loading X.509 certificate: UEFI:db
[    1.607605] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    1.616495] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.616809] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.617008] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.617514] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    4.866328] systemd[1]: TPM2 PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionPathExists=/sys/firmware/efi/efivars/StubPcrKernelImage-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f).

#SecureBootが無効な時
[root@syasuda-rhel9-sec ~]# dmesg | grep -i "EFI"
[    0.000000] efi: EFI v2.7 by Ubuntu distribution of EDK II
[    0.000000] efi: SMBIOS=0xbf920000 ACPI=0xbfb7d000 ACPI 2.0=0xbfb7d014 MEMATTR=0xbe228018 MOKvar=0xbf91a000 RNG=0xbfb70018
[    0.000000] efi: Remove mem141: MMIO range=[0xffc00000-0xffffffff] (4MB) from e820 map
[    0.052919] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.513043] pci 0000:00:02.0: BAR 0: assigned to efifb
[    0.541045] Registered efivars operations
[    0.964287] efifb: probing for efifb
[    0.964307] efifb: framebuffer at 0xc0000000, using 1876k, total 1875k
[    0.964309] efifb: mode is 800x600x32, linelength=3200, pages=1
[    0.964310] efifb: scrolling: redraw
[    0.964310] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    0.967430] fb0: EFI VGA frame buffer device
[    0.967449] EFI Variables Facility v0.08 2004-May-17
[    1.382631] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.382800] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.382911] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    1.383377] integrity: Loading X.509 certificate: UEFI:MokListRT (MOKvar table)
[    5.059180] systemd[1]: TPM2 PCR Machine ID Measurement was skipped because of an unmet condition check (ConditionPathExists=/sys/firmware/efi/efivars/StubPcrKernelImage-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f).

UEFIが利用されている
[root@syasuda-rhel9-sec ~]# efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0003,0001,0000,0002
Boot0000* UiApp
Boot0001* UEFI Misc Device
Boot0002* EFI Internal Shell
Boot0003* redhat
/dev/vdaはGPT
[root@syasuda-rhel9-sec ~]# parted -l
Error: /dev/vdd: unrecognised disk label
Model: Virtio Block Device (virtblk)
Disk /dev/vdd: 45.1kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/vdb: unrecognised disk label
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 65.0GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/vdc: unrecognised disk label
Model: Virtio Block Device (virtblk)
Disk /dev/vdc: 399kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Model: Virtio Block Device (virtblk)
Disk /dev/vda: 107GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  212MB   210MB   fat16              boot, esp
 3      212MB   736MB   524MB   xfs                bls_boot
 4      736MB   107GB   107GB   xfs

3
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?