Patrick
February 6, 2023, 7:19pm
21
dracut support was implemented in grml-debootstrap.
Kicksecure will move to dracut with its next major release (when rebasing to Debian 12 / bookworm).
(required for ram-wipe - Wipe RAM on shutdown and reboot - Kicksecure )
1 Like
dracut support was completed in git tag 17.0.2.5-developers-only
.
This is a major issue for Kicksecure hosts (currently cannot use dracut):
Debian bug report:
unbootable system after installing dracut on a standard Debian installation
Not an issue for Kicksecure VMs or Whonix VMs because there dracut works for some reason.
Might be a duplicate of Debian bug report dracut: generic initrd does not work with encrypted root FS without further configuration .
Thanks to Laszlo Gombos, this has been reported upstream.
opened 01:31PM - 20 Jul 23 UTC
bug
crypt
Moving downstream discussion here upstream from https://bugs.debian.org/cgi-bin/… bugreport.cgi?bug=1029324
with an encrypted root fs, the system will end up with a configuration which
looks something like this:
```
/etc/crypttab:
<dev>_crypt UUID=<some_uuid> none luks,discard
/etc/fstab:
/dev/mapper/<some_LVM_LV> / ext4 <options>
/boot/grub/grub.cfg:
linux /vmlinuz-6.0.0-6-amd64 root=/dev/mapper/<some_LVM_LV> ro quiet
```
Now, after switching to dracut, the new initrd which is built will not
contain the necessary configuration to actually setup the "<dev>_crypt"
device, since autoconfiguration (rd.auto) is disabled and a hostonly
initrd (which would include a custom /etc/crypttab in the initrd) is not
built.
The result is an initrd which will hang waiting for
/dev/mapper/<some_LVM_LV> to show up, and which will eventually time
out.
A workaround for now is to change /etc/default/grub:
GRUB_CMDLINE_LINUX_DEFAULT="quiet rd.auto=1"
This, however, means that the name of the crypt device will change from
"<dev>_crypt" (as specified in /etc/crypttab) to "luks-<some_uuid>",
which will result in ugly error messages during boot (that's mostly
cosmetic though) since systemd will fail to setup the device
"<dev>_crypt".
That, in turn, can be fixed by changing /etc/crypttab from:
<dev>_crypt UUID=<some_uuid> none luks,discard
so that it reads:
luks-<some_uuid> UUID=<some_uuid> none luks,discard
A further problem with building the generic initrd is that custom crypt
addons (like the fido2 support) won't be included in the initrd even if
fido2 is defined in /usr/lib/dracut/modules.d/90crypt/module-setup.sh
("fido2-device=auto").
CC @Alphix
Patrick
November 22, 2023, 4:40am
27
Patrick
December 11, 2023, 3:42pm
28
Summary why Kicksecure was ported from initramfs-tools to dracut:
From the initrd generators I was aware of at the time, only dracut has an exitrd feature. Which means the system drops back into the initrd at shutdown time. It then (hopefully) cleanly unmounts encrypted devices. Then ram-wipe runs.
This couldn’t have been implemented with initramfs-tools unless contributing the exitrd functionality upstream first.
Switching to dracut was actually quite expensive. Specifically because nobody had shared in simple steps how to create a Debian based Live ISO using dracut.
Once dracut is running, writing initrd or exitrd modules is quite doable.
However, it’s best to not over invest into dracut as its days might be counted. One day it might get replaced by mkosi-initrd. On the other hand since Debian by default did not even move to dracut, it could take many Debian releases, years until that happens, if that ever happens.
Useful for dracut-ng builds from source code only for testing:
opened 03:52PM - 23 May 24 UTC
bug
git tags are signed, which is nice. But I could not find the signing key for the… e-mail address or key fingerprint.
```
git tag -v 101
```
```
object 2255bf3464536b02342d13398c5331999fcfd4fa
type commit
tag 101
tagger Laszlo Gombos <laszlo.gombos@gmail.com> 1712502326 -0400
101
gpg: Signature made Sun 07 Apr 2024 11:05:26 AM EDT
gpg: using EDDSA key 90060B4439A5A5C347FFBF1BAA698639643D9C14
gpg: Can't check signature: No public key
zsh: exit 1 git tag -v 101
```
Could you upload the link please and perhaps link to it from the documentation?
Perhaps https://keys.openpgp.org/?
Great news, Debian will likely switch dracut-ng in Debian trixie.
Debian feature request:
dracut: Consider switching to the fork dracut-ng
This will fix two important bugs.
One bug where migrating from initramfs-tools to dracut while using full disk encryption:
dracutdevs:master
← DanWin:encrypted-root-with-generic-initrd
opened 05:31PM - 16 Sep 23 UTC
This pull request adds missing modules potentially required for disk decryption … to a generic initrd. Additionally it changes the default for unlocking LUKS encrypted devices at boot from previously only doing so when rd.auto=1 was specified.
## Checklist
- [X] I have tested it locally
- [ ] I have reviewed and updated any documentation if relevant
- [ ] I am providing new code and test(s) for it
Fixes #2437
And a bug that matters for ram-wipe as per Is RAM Wipe possible inside Whonix? Cold Boot Attack Defense - #57 by Patrick .
opened 03:46PM - 19 Apr 24 UTC
closed 09:24PM - 25 May 24 UTC
bug
add a shutdown hook to close encrypted devices and wipe their encryption keys fr… om kernel memory.
Related work
- dracutdevs/dracut/issues/997
- dracutdevs/dracut#1888
- dracut-ng/dracut-ng/pull/94
CC @DanWin @adrelanos
Patrick
September 7, 2024, 1:40pm
37
Patrick
September 27, 2024, 1:15am
38