Question about full disk encryption and TPM 2.0 WITHOUT secureboot

Hi, I’ve never used opensuse before but am considering installing tumbleweed because it seems that opensuse takes things like FDE and secure boot seriously/makes that stuff easier to use.

I don’t want to enable secure boot because it feels like a hassle, especially considering I have an nvidia gpu, and I’m not under any risk from an attacker gaining physical access (I’m under the assumption that secure boot only protects against physical-access based attacks, but I’m not entirely sure that that’s true).

I want to enable disk encryption with systemd-boot and TPM 2.0, with an encrypted /boot, as is probably done here: Quickstart in Full Disk Encryption with TPM and YaST2 - openSUSE News

I have a few questions about this:

  1. I’ve heard that the TPM 2.0 will only release its key if the boot chain is ‘okay’, but exactly what does it measure? Would it prevent me from booting a liveISO/another OS and mounting the encrypted partition there?

  2. If the answer to the above is ‘no’, then what is the point? If the answer is ‘yes’, does that mean I’ll have no way to fix my system (e.g. changing the root password if I’ve forgotten it) by booting from a liveISO and chrooting in?

  3. If I follow the guide above, what does systemd-boot ‘boot’, exactly? A unified kernel image? Does it boot grub again?

  4. Because I’m not using secure boot, which part of my system is vulnerable? The things that reside on the ESP, right?

Sorry if some of what I said is nonsense, I don’t fully understand these things.

You are mistaken. Actually, anyone having physical access can trivially bypass Secure Boot by simply disabling it. There is no single silver bullet, defense in depth still applies.

It measures what is defined in the corresponding policy (or more precisely, it will compare only the measured data that you asked for).

It depends on which data you decided to measure to allow unlocking. But this directly contradicts your previous statement that “I’m not under any risk from an attacker gaining physical access”.

LUKS container can have multiple methods to unlock it.

systemd-boot boots an UEFI binary. It may be UKI, it may be a normal kernel with EFI stub, it may be grub (although the latter probably makes little sense).

Secure Boot measures binaries that are loaded by firmware from ESP. Secure Boot mitigates some of the attacks. Measured boot mitigates other types of attacks.

Sorry for not being more direct; I was wondering if secure boot can help protect against any software based attacks (like malware).

Interesting. in the link in my original post, there’s no mention of specifying policies. Is there a default policy? Or, where do I set it?

For the liveISO part, sure, but say I’m booted into a regular OS (not live), like linux or windows. Theoretically wouldn’t there be a chance of malware gaining access to my encrypted opensuse partition (assuming, under default behaviour, that the TPM will allow that)?

Oh so I can have it so that I can decrypt it with a regular password when I need to?

I get that, but I wanted to know, what opensuse does by default (when I follow the guide linked above).

Ok so I followed the quick setup guide in a VM, but didn’t use btrfs (used ext4 instead) for the root partition, still used LVM. Apparently, the ESP is installed under /boot/efi, and the kernel and initramfs are in /boot, which means /boot is unencrypted. in /boot/efi/loader/entries, these are the contents:

title      openSUSE Tumbleweed 20250502
version    @6.14.4-1-default
sort-key   opensuse-tumbleweed
options    root=UUID=22f75838-c309-479e-8542-65502bfbd91b splash=silent quiet security=selinux selinux=1 mitigations=auto systemd.machine_id=dde88ec724364aaa9faaa087984df18b
linux      /opensuse-tumbleweed/6.14.4-1-default/linux-33132300c491a998f047656a3b200c7b1edef304
initrd     /opensuse-tumbleweed/6.14.4-1-default/initrd-21305a153fa6d8751e88d30d8bb11bdba91417bb

This probably means that systemd-boot is booting an efi-stub kernel.

I followed the rest of the guide, and indeed I’m not asked for my LUKS passphrase anymore. However when I ran sdbootutil enroll --method tpm2, it complained of not detecting a GPT partition table. Don’t know how to make sense of that, since fdisk says the disk is partitioned with gpt.

Secure boot only checks that the boot stack has not been altered. Something that is hard to do in Linux unless the attacker has boot access. If he does then all bets are off, he already owns your machine and has no need to fool around with the boot stack.

Hard to do in linux maybe, but I intend to dual boot windows and my main concern is a programme gaining admin privileges there and then messing with my boot stack.

Of course not. Secure Boot protects the EFI binaries that are directly loaded by firmware. it is by far not the only software based attacks possible.

When using systemd-boot with systemd-pcrlock default PCRs are 0, 1, 2, 3, 4, 5, 7, 9, 12 (I may have missed some). Without systemd-pcrlock default PCRs are 4,7,9.

Without systemd-pcrlock:
FDE_SEAL_PCR_LIST in the /etc/sysconfig/fde-tools
or
sdbootutil --pcr=1,2,3 ....
With systemd-pcrlock - you cannot; they are really hard coded (as long as you are using sdbootutil).

This will change at least PCR 4, so TPM should refuse to unlock the key.

Yes.

Normal kernel. There is work in progress to support UKI, I have no idea about its state.

So I found this page: Portal:MicroOS/FDE - openSUSE Wiki

It’s for MicroOS but works for tumbleweed too I guess. fde-tools doesn’t seem to exist on tumbleweed, but the relevant section in that page is Full re-enrollment (lost recovery key). In the last command I can just run systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+3+5+6+7+8+9 $DEV, or whatever pcrs I choose. I don’t know what is going to happen every time I update my system, however.

Could you point me to the documentation where this is mentioned? Also, why isn’t PCR 8 used? Under default settings (no PCR 8), I was able to add rw init=/bin/bash to my kernel command line before booting, and I got access to a root shell, without having to supply any passwords! Then I manually added PCR 8 using the command mentioned above and was no longer able to do that.

Sorry?

https://download.opensuse.org/tumbleweed/repo/oss/x86_64/fde-tools-0.7.2-13.1.x86_64.rpm

Not really. You need to trace systemd-pcrlock calls in sdbootutil and check systemd-pcrlock manual which PCR is used by which invocation. Which is why I mentioned “unless I have missed some”.

Because PCR 8 is used by GRUB and your question was about systemd-boot. Kernel EFI stub measures command line into PCR 9.

Sure you can, but that is not what the sdbootutil does and the result is not equivalent (i.e. the statement “the last two commands are equivalent of” will no more be true).

That’s pretty vague. Full message please.

And show the actual output of whatever command you used. Together with the full command line.

Using the full re-enrollment guide in the link in my previous comment, the last command to run was this: PIN=<pin> sdbootutil enroll --method=tpm2

And the output was this: /usr/bin/sdbootutil: line 620: snapper: command not found /usr/bin/sdbootutil: line 620: snapper: command not found Disk does not have GPT partition table, refusing. NVIndex policy created 🔐 Please enter current passphrase for disk /dev/vda2: •••••••• New TPM2 token enrolled as key slot 1.

And the output of fdisk /dev/vda is this:

Command (m for help): p

Disk /dev/vda: 35 GiB, 37580963840 bytes, 73400320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B469F3E8-8C04-427F-ACA7-E837E0080C75

Device       Start      End  Sectors Size Type
/dev/vda1     2048  2099199  2097152   1G EFI System
/dev/vda2  2099200 73400286 71301087  34G Linux LVM

Show

lsblk -f -o +partuuid
hexdump -C -n 1024 /dev/vda

lsblk -f -o +partuuid:

NAME FSTYPE FSVER LABEL                   UUID                                   FSAVAIL FSUSE% MOUNTPOINTS PARTUUID
sr0  iso966 Jolie d-live 12.10.0 ld amd64 2025-03-15-09-09-36-00                                            
vda                                                                                                         
├─vda1
│    vfat   FAT32                         4525-C62C                               964.7M     6% /boot/efi   265cc1a6-0b90-43cc-8530-16509cadb841
└─vda2
  │  crypto 2                             92ff4b48-ce02-4959-96ab-0ac64fb6d4bd                              b790d094-63e7-4b6d-b399-cf84debaba34
  └─cr_vda2
    │  LVM2_m LVM2                          frdfQz-en1V-rkce-BcVz-OJZG-LMEE-HcA2cd                            
    ├─system-root
    │  ext4   1.0                           22f75838-c309-479e-8542-65502bfbd91b      5.1G    49% /           
    └─system-home
       ext4   1.0                           4d709de2-a774-432f-98ce-51980b390ade     20.8G     1% /home       

hexdump -C -n 1024 /dev/vda:

00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001c0  02 00 ee ff ff ff 01 00  00 00 ff ff 5f 04 00 00  |............_...|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200  45 46 49 20 50 41 52 54  00 00 01 00 5c 00 00 00  |EFI PART....\...|
00000210  40 0a 95 16 00 00 00 00  01 00 00 00 00 00 00 00  |@...............|
00000220  ff ff 5f 04 00 00 00 00  22 00 00 00 00 00 00 00  |.._.....".......|
00000230  de ff 5f 04 00 00 00 00  e8 f3 69 b4 04 8c 7f 42  |.._.......i....B|
00000240  ac a7 e8 37 e0 08 0c 75  02 00 00 00 00 00 00 00  |...7...u........|
00000250  80 00 00 00 80 00 00 00  69 4d 10 cf 00 00 00 00  |........iM......|
00000260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000400
 

The GPT header is correct. You may consider opening a bug report for this error. It actually may cause failure to unlock the LUKS key - if firmware measures GPT and systemd-pcrlock not. I do not see how this check could fail.

The functionality is working (I think), I don’t get prompted for a passphrase on boot.

However I don’t think PCR 9 is used; under default settings (that is, when I haven’t manually set any PCRs), I can edit the kernel command line and add rw init=/bin/bash

Show

bootctl

```System:
      Firmware: UEFI 2.70 (EDK II 1.00)
 Firmware Arch: x64
   Secure Boot: disabled (setup)
  TPM2 Support: yes
  Measured UKI: no
  Boot into FW: supported

Current Boot Loader:
      Product: systemd-boot 257.5+suse.8.gc10a66fb4d
     Features: ✓ Boot counting
               ✓ Menu timeout control
               ✓ One-shot menu timeout control
               ✓ Default entry control
               ✓ One-shot entry control
               ✓ Support for XBOOTLDR partition
               ✓ Support for passing random seed to OS
               ✓ Load drop-in drivers
               ✓ Support Type #1 sort-key field
               ✓ Support @saved pseudo-entry
               ✓ Support Type #1 devicetree field
               ✓ Enroll SecureBoot keys
               ✓ Retain SHIM protocols
               ✓ Menu can be disabled
               ✓ Multi-Profile UKIs are supported
               ✓ Boot loader set partition information
    Partition: /dev/disk/by-partuuid/265cc1a6-0b90-43cc-8530-16509cadb841
       Loader: └─/EFI/systemd/grub.efi
Current Entry: opensuse-tumbleweed-6.14.4-1-default.conf

Random Seed:
 System Token: set
       Exists: yes

Available Boot Loaders on ESP:
          ESP: /boot/efi (/dev/disk/by-partuuid/265cc1a6-0b90-43cc-8530-16509cadb841)
         File: ├─/EFI/systemd/MokManager.efi
               ├─/EFI/systemd/shim.efi
               ├─/EFI/systemd/grub.efi (systemd-boot 257.5+suse.8.gc10a66fb4d)
               ├─/EFI/BOOT/MokManager.efi
               ├─/EFI/BOOT/fallback.efi
               └─/EFI/BOOT/BOOTX64.EFI

Boot Loaders Listed in EFI Variables:
        Title: openSUSE Boot Manager
           ID: 0x0008
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/265cc1a6-0b90-43cc-8530-16509cadb841
         File: └─/EFI/systemd/shim.efi

        Title: openSUSE Boot Manager (systemd-boot)
           ID: 0x0003
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/265cc1a6-0b90-43cc-8530-16509cadb841
         File: └─/EFI/systemd/shim.efi

Boot Loader Entries:
        $BOOT: /boot/efi (/dev/disk/by-partuuid/265cc1a6-0b90-43cc-8530-16509cadb841)
        token: opensuse-tumbleweed

Default Boot Loader Entry:
         type: Boot Loader Specification Type #1 (.conf)
        title: openSUSE Tumbleweed 20250502
           id: opensuse-tumbleweed-6.14.4-1-default.conf
       source: /boot/efi//loader/entries/opensuse-tumbleweed-6.14.4-1-default.conf (on the EFI System Partition)
     sort-key: opensuse-tumbleweed
      version: @6.14.4-1-default
        linux: /boot/efi//opensuse-tumbleweed/6.14.4-1-default/linux-33132300c491a998f047656a3b200c7b1edef304
       initrd: /boot/efi//opensuse-tumbleweed/6.14.4-1-default/initrd-21305a153fa6d8751e88d30d8bb11bdba91417bb
      options: root=UUID=22f75838-c309-479e-8542-65502bfbd91b splash=silent quiet security=selinux selinux=1 mitigations=auto systemd.machine_id=dde88ec724364aaa9faaa087984df18b

Can you upload

tpm2_eventlog /sys/kernel/security/tpm0/binary_bios_measurements

to https://paste.opensuse.org/

https://paste.opensuse.org/pastes/a967af2b80b2

- EventNum: 37
  PCRIndex: 12
  EventType: EV_IPL
  DigestCount: 1
  Digests:
  - AlgorithmId: sha256
    Digest: "2312bbfdfbdd24f82fd1d788515cdeddd3c983ab72f4ab5e2a5678f37b33e412"
  EventSize: 512
  Event:
    String: "i\0n\0i\0t\0r\0d\0=\0\\\0o\0p\0e\0n\0s\0u\0s\0e\0-\0t\0u\0m\0b\0l\0e\0w\0e\0e\0d\0\\\06\0.\01\04\0.\04\0-\01\0-\0d\0e\0f\0a\0u\0l\0t\0\\\0i\0n\0i\0t\0r\0d\0-\02\01\03\00\05\0a\01\05\03\0f\0a\06\0d\08\07\05\01\0e\08\08\0d\03\00\0d\08\0b\0b\01\01\0b\0d\0b\0a\09\01\04\01\07\0b\0b\0 \0r\0o\0o\0t\0=\0U\0U\0I\0D\0=\02\02\0f\07\05\08\03\08\0-\0c\03\00\09\0-\04\07\09\0e\0-\08\05\04\02\0-\06\05\05\00\02\0b\0f\0b\0d\09\01\0b\0 \0s\0p\0l\0a\0s\0h\0=\0s\0i\0l\0e\0n\0t\0 \0q\0u\0i\0e\0t\0 \0s\0e\0c\0u\0r\0i\0t\0y\0=\0s\0e\0l\0i\0n\0u\0x\0 \0s\0e\0l\0i\0n\0u\0x\0=\01\0 \0m\0i\0t\0i\0g\0a\0t\0i\0o\0n\0s\0=\0a\0u\0t\0o\0 \0s\0y\0s\0t\0e\0m\0d\0.\0m\0a\0c\0h\0i\0n\0e\0_\0i\0d\0=\0d\0d\0e\08\08\0e\0c\07\02\04\03\06\04\0a\0a\0a\09\0f\0a\0a\0a\00\08\07\09\08\04\0d\0f\01\08\0b\0\0\0"
- EventNum: 38
  PCRIndex: 9
  EventType: EV_EVENT_TAG
  DigestCount: 1
  Digests:
  - AlgorithmId: sha256
    Digest: "2312bbfdfbdd24f82fd1d788515cdeddd3c983ab72f4ab5e2a5678f37b33e412"
  EventSize: 34
  Event: "ed223b8f1a0000004c4f414445445f494d4147453a3a4c6f61644f7074696f6e7300"
- EventNum: 39
  PCRIndex: 9
  EventType: EV_EVENT_TAG
  DigestCount: 1
  Digests:
  - AlgorithmId: sha256
    Digest: "74326bf5dc410a2c7ffdef766cf50634ca94b1baaddc6a6cb0311ea1fee79f43"
  EventSize: 21
  Event: "ec223b8f0d0000004c696e757820696e6974726400"

Those are the command line and initrd measurements. The first (PCR 12) is measured by systemd-boot binary, the latter two (PCR 9) - by kernel EFI stub. Try booting with custom kernel parameters and compare the final PCR values and digests in the events.

Show

cryptsetup luksDump /dev/vda2
jq . /var/lib/systemd/pcrlock.json