Skip to content
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

Feature-request: native encryption with ZFS #177

Open
kvaps opened this issue Aug 25, 2020 · 9 comments
Open

Feature-request: native encryption with ZFS #177

kvaps opened this issue Aug 25, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@kvaps
Copy link

kvaps commented Aug 25, 2020

OpenZFS does support native encryption since 0.8.0.

Encryption can be enabled for whole pool, dataset or per ZVOL (our case).
It would be nice to add its support in roadmap for LINSTOR.

Here is examples:
https://blog.heckel.io/2017/01/08/zfs-encryption-openzfs-zfs-on-linux/

@ghernadi
Copy link
Contributor

For me this sounds like a feature request for the linstor physical-storage create-device-pool command.

As for an encryption of the whole zpool, the user would have to enable encryption before linstor sp c zfs ...
and for per ZVOL, you should be able to use the new StorDriver/ZfscreateOptions #128

@kvaps
Copy link
Author

kvaps commented Aug 25, 2020

Yes looks like StorDriver/ZfscreateOptions #128 is exactly what we need, but the questions is how to input encryption password :)

@ghernadi
Copy link
Contributor

So you also want to have a password?

Well.. in that case, I have to agree, that makes it a bit more difficult.

I am not a zfs expert, but if I understand this zfs-encryption correctly (for some reasons I could test it myself for now, I'll have to look into my test-setup) and you need to re-enter the password when you are mounting / start using the device, that will cause some problems in Linstor which would require quite a lot of changes...

First, right now, basically every layer in Linstor might be "on top" of the StorageLayer with a ZFS provider (except the StorageLayer itself).
That means, all of those layers have to be ready to enter that password before they start using the device.
This is something we highly tried to avoid, as basically every layer would have to access layer-specific data from the storage layer. Right now, (with only several small exceptions) every layer can "do its own thing" with its own layer specific data without having to rely on any other layer apart from "I need a device 'this' large" or "delete this device" or similar highly generic commands.

Second, storing / managing the password itself is a problem. The LuksLayer requires the user to remember only one passphrase (the master-passphrase), which Linstor never remembers and keeps in memory as short as possible. The actual Luks-passwords are generated, salted and encrypted (with the master-passphrase) before stored in the database.
With zfs-encryption, Linstor has to either let the user enter the password (upon resource create ..?) and has to provider an API showing the password in plaintext.
Yes, Linstor could somehow "securely" store that password, similar to the way LuksLayer's passwords are stored, but also that would require quite some rework.

All in all, although I do understand that one might want to use the feature especially "if it is already there". But on the other hand, Linstor already has a dedicated LuksLayer for encryption, which also works fine with ZFS. Unless someone explains me what other differences there are than "it is not the ZFS built in encryption", I guess this issue will get such a low priority, that it most likely will never get implemented.

@gmelikov
Copy link

gmelikov commented Aug 25, 2020

Some small notes on topic:

@ghernadi
Copy link
Contributor

Thanks for the info.

The load-key sounds interesting, especially if it can be used without the Linstor-changes I mentioned above.

Regarding the benefits: Linstor does not call / use scrub, but Linstor does use send/recv for snapshot shipping. But as you mentioned, if that also works without keys, load-key could be the answer to kvaps request :)

@ggzengel
Copy link

@kvaps What do you expect with encryption?

I use encryption to send disks to repair or throw away broken disks or protect data on stolen hardware.
For this the root filesystem is installed on a encrypted LUKS LV and asks for keys on boot. The keys for ZFS are stored on root filesystem and inherited to sub volumes.

@kvaps
Copy link
Author

kvaps commented Aug 25, 2020

Well, right now I don't need an encryption for the LINSTOR.
But possible it will be needed in the future, I would prefer to choose native ZFS encryption instead of addition layer of LUKS

@ggzengel
Copy link

Only my root filesystem is LVM LUKS EXT4, because I don't trust to boot with ZFS and it's easier to repair grub and initramfs with debian's netinst.iso thru an IPMI session.
Everything else is native ZFS encryption.

If you encouraged you can boot from an encrypted ZFS.

@rp- rp- added the enhancement New feature or request label Jun 2, 2022
@zrav
Copy link

zrav commented Jul 18, 2024

Another vote for ZFS encryption handling.
We need encryption at rest, so my suggestion as to how this would work is based on that: The password should only have to be entered once on cluster start, then Linstor keeps the key in RAM and automatically handles any load-key operations. That would mean the same key is used for all storage pools/volumes, but that would be fine in our case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants