!DBFhtjpqmJNENpLDOv:nixos.org

NixOS systemd

626 Members
NixOS ❤️ systemd175 Servers

Load older messages


SenderMessageTime
6 Oct 2024
@elvishjerricco:matrix.orgElvishJerricco so we might as well set up /etc 21:05:36
@elvishjerricco:matrix.orgElvishJerricco like the reason systemd can boot with just /usr is because it puts all these things in their equivalent /usr locations 21:07:26
@elvishjerricco:matrix.orgElvishJerricco e.g. /usr/lib/systemd/journald.conf 21:07:41
7 Oct 2024
@elvishjerricco:matrix.orgElvishJerricco Huh, here's a neat trick. Useful for exactly one device, i.e. probably your root device. You can use tpm2-measure-pcr=yes in crypttab options and bind the volume to pcr 15:sha256=000...000 to get poor-man's pcrphase. You get exactly one phase :P 03:28:52
@lehmanator:tchncs.deSam Lehman changed their profile picture.14:24:17
@elvishjerricco:matrix.orgElvishJerricco mjm: I think there's a problem with the bcachefs generator's credential based unlocking. Not that it's buggy; just that you probably have a vulnerability in your setup. I mean frankly it's probably pretty common in a lot of auto-unlock setups. 23:13:10
@mjm:midna.devmjm
In reply to @elvishjerricco:matrix.org
mjm: I think there's a problem with the bcachefs generator's credential based unlocking. Not that it's buggy; just that you probably have a vulnerability in your setup. I mean frankly it's probably pretty common in a lot of auto-unlock setups.
what's the vulnerability?
23:23:16
@elvishjerricco:matrix.orgElvishJerricco

basically, if I replace your disk with my own and trick your initrd into mounting my bcachefs, you'll mount it and boot it without error because the unlock service silently skips unencrypted file systems. Then my OS can freely use the TPM, which means it can decrypt the original disk.

The two ways to fix this are to validate the identity of the root fs before booting it somehow, or the less error-prone method IMO is just systemd-pcrphase since that just always puts the TPM in a state that won't decrypt your drive.

23:26:05
@elvishjerricco:matrix.orgElvishJerriccoThat's why I was looking at that "neat trick" last night.23:26:13
@elvishjerricco:matrix.orgElvishJerriccothough even that's not engouh23:26:16
@elvishjerricco:matrix.orgElvishJerricco * though even that's not enough23:26:18
@elvishjerricco:matrix.orgElvishJerriccoactually no that one's probably fine23:27:00
@elvishjerricco:matrix.orgElvishJerricco but pcrphase is a pain in the ass because it involves signing individual phases with a key that's unique to that phase 23:28:43
@elvishjerricco:matrix.orgElvishJerriccowhich is why I just did the poor-man's thing23:28:49
@mjm:midna.devmjmokay i see what you mean23:29:03
@mjm:midna.devmjmi think the clevis set up also had that issue?23:30:27
@mjm:midna.devmjmyeah, it also uses an exec condition in the same way23:31:28
@elvishjerricco:matrix.orgElvishJerricco mjm: The clevis setup might not have, because it probably bailed if it didn't do the decryption? 23:31:33
@elvishjerricco:matrix.orgElvishJerriccooh23:31:33
@elvishjerricco:matrix.orgElvishJerriccothen no23:31:35
@elvishjerricco:matrix.orgElvishJerriccoheh23:31:36
@mjm:midna.devmjmhttps://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/filesystems/bcachefs.nix#L9023:31:44
@elvishjerricco:matrix.orgElvishJerriccooh, right, yea, it wouldn't affect that I guess23:32:06
@elvishjerricco:matrix.orgElvishJerriccoI bet it bails for LUKS or ZFS though23:32:14
@elvishjerricco:matrix.orgElvishJerricco(maybe)23:32:18
@elvishjerricco:matrix.orgElvishJerriccobut yea, the 3 main options are probably: 1) Ensure the decryption goes as planned, 2) Verify the identity of the root fs, 3) Change the TPM before leaving initrd23:32:58
@elvishjerricco:matrix.orgElvishJerriccoof course all three would be nice23:33:07
@elvishjerricco:matrix.orgElvishJerricco mjm: I have this for #2, but it's not for lanzaboote yet and it relies on a self-signed OS rather than any kind of machine ID. 23:34:51
@elvishjerricco:matrix.orgElvishJerriccohttps://github.com/NixOS/nixpkgs/pull/27359323:34:52
@mjm:midna.devmjm the || true suggests to me that maybe this would affect zfs too? https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/tasks/filesystems/zfs.nix#L156 23:35:12

Show newer messages


Back to Room ListRoom Version: 6