-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ZFS encryption #373
base: master
Are you sure you want to change the base?
Conversation
Update: I had a succesful boot using the clevis binding on a zfs user property with a TPM binding, but that was on my arch laptop. (i.e. |
@npmccallum do you (or other maintainers) know if this PR would be welcome at all? If not, I'll close it, but If it is, I'll try to finish it in the next few weeks. |
Keeping an eye on this. |
I would say it is definitely useful, your work is much appreciated. Consider making a fork, if needed. |
Might be easy enough to port to initramfs hooks. I'm finally looking into this... Why has the pull req been ignored? |
I haven't worked on this for a while, because it's been working for me fine on Arch+clevis+mkinitramfs :p |
quick questions, what is the status for initramfs hooks integration? Thanks. |
The scripts in my branch are functional. There is mostly some polish missing. I haven't worked on this PR at all, and I don't have time anytime soon. |
For an initramfs hook I think the zfs-initramfs script would need changes. I see two main issues:
As a workaround to have some sort of support I just include a jwe in the initramfs and have it decrypt to file location. The zfs script then runs as normal and imports the key from the file location. The decryption of the jwe happens pre-import and I haven't thought through the implications of writing to the initramfs. This is probably not the correct way to do things but it does "work". |
@npmccallum @techhazard I'd love to give some time to look into this. I'll give it a shot over the next couple days. Should I rebase @techhazard's changes onto the latest tip of master? |
@techhazard did you commit
|
@m2Giles It appears that your concern about having a hook in the initramfs script has been merged: openzfs/zfs@6e01593, available in zfs 2.2+ |
See reworked PR at #467. |
Why
As I stated a while ago in #218, I would like clevis to be able to unlock ZFS datasets that have native encryption enabled. This is my attempt at adding this by storing the data in zfs properties.
How
This is achieved by storing the clevis data (output of
clevis-encrypt
) in ZFS User Properties.From
zfsprops(8)
:Properties
All clevis user properties are prefixed with
latchset.clevis
latchset.clevis:labels
, should be a space-separated list of bound labels. or absent when unbound.latchset.clevis.label:LABEL_NAME[-N]
where-N
is an integer suffix when the data for label LABEL_NAME is too large for one property.If there are more than 10 properties needed, the integer will be
0
-padded to help with sorting to easily combine them when unlocking.As noted above (at the end), the limit of the value of a user property is 8192 bytes.
A simple 1-host
tang
setup will probably not go over this limit, but with a more complicated setup withclevis-encrypt-sss
, it is possible.Because of that, the clevis data is split in 8k chunks, and saved in multiple user-properties.
These are combined upon unlock.
"Works": (works on my machine, needs more testing)
clevis-zfs-bind
clevis-zfs-unbind
clevis-zfs-unlock
To Do: