Commit Graph

10 Commits

Author SHA1 Message Date
Ilya Dryomov
8d5d478532 qa/workunits/rbd: add encryption-aware resize test
Note that we are hitting https://tracker.ceph.com/issues/58160 here
because by the time we get to "rbd resize" RAW_DEV mapping owns the
lock (due to a write to /dev/mapper/cryptsetupdev being last).

While at it, resurrect the ability to easily run this script on
vstart clusters -- see commit f737c2855a ("qa/workunits/rbd: make
luks-encryption test work on vstart cluster").

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-12-04 18:24:10 +01:00
Ilya Dryomov
a27ee2bdf8 rbd, rbd-nbd: make --encryption-format optional
If no --encryption-format specified at all, default to "luks" for each
specified --encryption-passphrase-file.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-12-04 18:19:19 +01:00
Ilya Dryomov
e62e3b6613 rbd, rbd-nbd: accept "luks", "luks1" and "luks2" formats
Since RBD_ENCRYPTION_FORMAT_LUKS1, RBD_ENCRYPTION_FORMAT_LUKS2
and RBD_ENCRYPTION_FORMAT_LUKS aren't treated the same when loading
encryption anymore, "luks1" and "luks2" formats need to be accepted
in addition to "luks" format.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-12-04 18:19:19 +01:00
Ilya Dryomov
d642f7804b rbd, rbd-nbd: don't strip trailing newline in passphrase files
One of the stated goals is compatibility with standard LUKS tools,
in particular being able to load encryption on images formatted with
cryptsetup.  cryptsetup doesn't do this and this really interferes
with randomly generated (binary) passphrases.

While at it, open passphrase files as binary -- it communicates the
intent if nothing else on POSIX.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2022-12-04 18:19:19 +01:00
Or Ozeri
1d3de19c40 tools/rbd: add encryption format support for cloned image
This commit adds the encryption format support for cloned images via the RBD cli,
making the child image be encrypted with a key different from it parent,
while keeping the child thinly-provisioned.
Additionally, other APIs are extended to support flattening of such images.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2022-08-25 18:41:47 +03:00
Or Ozeri
9892ead7fc librbd/crypto: allow loading luks format without specifying version
This commits extends rbd API's to allow the user to load encryption
using either LUKS1 or LUKS2 formats, without explicitly specifying which.
Prior, the user had to specify explicitly LUKS1 or LUKS2.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2022-08-04 10:36:07 +03:00
Or Ozeri
40f6f5224b qa/workunits/rbd: fix issues in luks-encryption.sh
This commit fixes 2 issues in luks-encryption.sh:
1. Fix sporadic comparison failures due to stale data read from kernel buffer cache.
2. Fix test skipping condition (when journaling is enabled)

Additionally, sudo is removed from most commands.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2022-08-04 10:36:07 +03:00
Mykola Golub
f737c2855a qa/workunits/rbd: make luks-encryption test work on vstart cluster
When running as non-root, it might not find the `rbd` binary.

Signed-off-by: Mykola Golub <mgolub@suse.com>
2021-02-15 15:03:00 +00:00
Or Ozeri
2f1eb8eba0 test/librbd: fix luks encryption cli test on unsupported runs
This commit changes the luks encryption cli test to return success instead of failure when not supported.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-26 18:54:05 +02:00
Or Ozeri
4f438f0dc3 test/librbd: add luks encryption cli test
This commit adds a cli test for rbd encryption verifying LUKS compatbility with cryptsetup

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2021-01-24 09:11:50 +02:00