How to use clevis for ZFS native encryption passphrase? #441
Replies: 8 comments 9 replies
-
I don't know how Clevis works, but the best approach would probably be using it to unlock keys on another partition that you could then copy to the path specified in the filesystems' Deeper integration with ZBM and Clevis is unlikely to happen because it would require special handling of specific, nonstandard unlocking methods. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tips. Does that mean, that if I build ZFSBootMenu in Ubuntu, than the resulting ZFSBootMenu will be Ubuntu-based and I can embed there some Ubuntu packages during the build process? |
Beta Was this translation helpful? Give feedback.
-
That's correct, if you don't use the containerized build process. Refer to https://docs.zfsbootmenu.org/en/v2.2.x/guides/ubuntu/uefi.html#install-zfsbootmenu for the list of packages / dependencies that should be installed if you're going to build from source. |
Beta Was this translation helpful? Give feedback.
-
Ok, got it, thank you
No, it is Fedora 38
Errors without systemd-boot-unsigned:
|
Beta Was this translation helpful? Give feedback.
-
I used Fedora package as it is written here
Yes, I used the one you mentioned. |
Beta Was this translation helpful? Give feedback.
-
In this case this hook will import and decrypt all the encrypted pools with automatic decryption flag set to yes. Would it be fine for rurther processing in zfsbootmenu? |
Beta Was this translation helpful? Give feedback.
-
Ok, I made it, Now it is fully automated and independent of the system it is booting. No maintenance needed unless something's changed in hardware configuration or there is a need to update zfsbootmenu itself. However, even though early_setup_hook is a working solution, it is not too much convenient for setting up. First, for the new installation of the booter It needs user interaction to provide a passphrase to seal it with clevis and tpm2. And if user does that via ssh he has to manually start the hook as it runs before zfsbootmenu. Second, If the hook is already running on the console and wait for user response while user is working over ssh, he needs to find this console running hook from ssh session, kill it, export all imported pools and then start the hook over from ssh. This makes the logic of the hook extra heavy. The optimal solution would be to call a special user defined hook just before asking a passphrase for a datset. It can be done based on the special user propery flag of this dataset, say latchset.clevis:decrypt. The hook is executed only if it is set to yes. The only argument for this hook is dataset name. In this case the logic of the hook would be very simple and setting it up will be convenient. Any help on how to make it easy would be very much appreciated. |
Beta Was this translation helpful? Give feedback.
-
I made a dirty hack in load_key() module in zfsbootmenu-core.sh It is very simple and just works. Just before
I put a call to a small function |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, ZFSBootMenu is OS-agnostic, has small footprint and is maintenance easy. Set it and forget it kind of things. To boot a system from an encrypted zfs root ZFSBootMenu at the moment can get a passphrase remotely via dropbear and localy from a console input. So all we need to make it full featured is to attach clevis to it to get passphrase automatically in trusted environment. What is the best way to make it?
Beta Was this translation helpful? Give feedback.
All reactions