-
Notifications
You must be signed in to change notification settings - Fork 545
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
RBD fscrypt support #3310
RBD fscrypt support #3310
Commits on Oct 17, 2022
-
util: Make encryption passphrase size a parameter
fscrypt support requires keys longer than 20 bytes. As a preparation, make the new passphrase length configurable, but default to 20 bytes. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 33fffa3 - Browse repository at this point
Copy the full SHA 33fffa3View commit details -
util: Add util to fetch encryption type from vol options
Fetch encryption type from vol options. Make fallback type configurable to support RBD (default block) and Ceph FS (default file) Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 20081ca - Browse repository at this point
Copy the full SHA 20081caView commit details -
kms: Add GetSecret() to metadata KMS
Add GetSecret() to allow direct access to passphrases without KDF and wrapping by a DEKStore. This will be used by fscrypt, which has its own KDF and wrapping. It will allow users to take a k8s secret, for example, and use that directly as a password in fscrypt. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 9b0cdf4 - Browse repository at this point
Copy the full SHA 9b0cdf4View commit details -
kms: testing: add KMS test dummy registry
Add registry similar to the providers one. This allows testers to add and use GetKMSTestDummy() to create stripped down provider instances suitable for use in unit tests. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 7f083c2 - Browse repository at this point
Copy the full SHA 7f083c2View commit details -
kms: Add basic GetSecret() test
Add rudimentary test to ensure that we can get a valid passphrase from the GetSecret() feature Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 2f57e5e - Browse repository at this point
Copy the full SHA 2f57e5eView commit details -
rbd: Rename encryption to blockEncryption prep for fscrypt
In preparation of fscrypt support for RBD filesystems, rename block encryption related function to include the word 'block'. Add struct fields and IsFileEncrypted. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 0551c0b - Browse repository at this point
Copy the full SHA 0551c0bView commit details -
journal: Store encryptionType in Config struct
Add encryptionType next to kmsID to support both block and file encryption. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 8827105 - Browse repository at this point
Copy the full SHA 8827105View commit details -
Integrate google/fscrypt into Ceph CSI KMS and encryption setup. Adds dependencies to google/fscrypt and pkg/xattr. Be as generic as possible to support integration with both RBD and Ceph FS. Add the following public functions: InitializeNode: per-node initialization steps. Must be called before Unlock at least once. Unlock: All steps necessary to unlock an encrypted directory including setting it up initially. IsDirectoryUnlocked: Test if directory is really encrypted Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 259b4d0 - Browse repository at this point
Copy the full SHA 259b4d0View commit details -
vendor: vendor fscrypt integration dependencies
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for ea13d57 - Browse repository at this point
Copy the full SHA ea13d57View commit details -
fscrypt: Unlock: Fetch keys early
Fetch keys from KMS before doing anything else. This will catch KMS errors before setting up any fscrypt metadata. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 13073f0 - Browse repository at this point
Copy the full SHA 13073f0View commit details -
fscrypt: Fetch passphrase when keyFn is invoked not created
Fetch password when keyFn is invoked, not when it is created. This allows creation of the keyFn before actually creating the passphrase. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 3d9cd65 - Browse repository at this point
Copy the full SHA 3d9cd65View commit details -
fscrypt: Determine best supported fscrypt policy on node init
Currently fscrypt supports policies version 1 and 2. 2 is the best choice and was the only choice prior to this commit. This adds support for kernels < 5.4, by selecting policy version 1 there. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for e165c9e - Browse repository at this point
Copy the full SHA e165c9eView commit details -
fscrypt: Update mount info before create context
NewContextFrom{Mountpoint,Path} functions use cached `/proc/self/mountinfo` to find mounted file systems by device ID. Since we run fscrypt as a library in a long-lived process the cached information is likely to be stale. Stale entries may map device IDs to mount points of already destroyed RBDs and fail context creation. Updating the cache beforehand prevents this. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 1d781fd - Browse repository at this point
Copy the full SHA 1d781fdView commit details -
fscrypt: Use constant protector name
Use constant protector name 'ceph-csi' instead of constant prefix concatenated with the volume ID. When cloning volumes the ID changes and fscrypt protected directories become inunlockable due to the protector name change Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for bfd397d - Browse repository at this point
Copy the full SHA bfd397dView commit details -
fscrypt: fsync encrypted dir after setting policy [workaround]
Revert once our google/fscrypt dependency is upgraded to a version that includes google/fscrypt#359 gets accepted Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for c63133e - Browse repository at this point
Copy the full SHA c63133eView commit details -
fscrypt: fix metadata directory permissions
Call Mount.Setup with SingleUserWritable constant instead of 0o755, which is silently ignored and causes the /.fscrypt/{policy,protector}/ directories to have mode 000. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 802d766 - Browse repository at this point
Copy the full SHA 802d766View commit details -
rbd: fscrypt file encryption support
Integrate basic fscrypt functionality into RBD initialization. To activate file encryption instead of block introduce the new 'encryptionType' storage class key. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 65c8787 - Browse repository at this point
Copy the full SHA 65c8787View commit details -
rbd: Handle encryption type default at a more meaningful place
Different places have different meaningful fallback. When parsing from user we should default to block, when parsing stored config we should default to invalid and handle that as an error. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for d8e94c3 - Browse repository at this point
Copy the full SHA d8e94c3View commit details -
rbd: Document new encryptionType storage class example
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 8e49c77 - Browse repository at this point
Copy the full SHA 8e49c77View commit details -
rbd: Add volume journal encryption support
Add fscrypt support to the journal to support operations like snapshotting. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for ca3fabe - Browse repository at this point
Copy the full SHA ca3fabeView commit details -
rbd: support file encrypted snapshots
Support fscrypt on RBD snapshots Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 2bb1f66 - Browse repository at this point
Copy the full SHA 2bb1f66View commit details -
rbd: Add context to fscrypt errors
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for a6c459d - Browse repository at this point
Copy the full SHA a6c459dView commit details -
e2e: Add fscrypt on rbd helper
Add validation functions for fscrypt on RBD volumes Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 92ba6c2 - Browse repository at this point
Copy the full SHA 92ba6c2View commit details -
e2e: Add helper to run encryption tests on block and file
Add a `By` wrapper to parameterize encryption related test functions and run them on both block and file encryption Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for a5a17fd - Browse repository at this point
Copy the full SHA a5a17fdView commit details -
e2e: Add PVC validator to ByFileAndBlockEncryption
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for d27f137 - Browse repository at this point
Copy the full SHA d27f137View commit details -
e2e: Run encryption related tests on file and block type
Replace `By` with `ByFileAndBlockEncryption` in all encryption related tests to parameterize them to file and block encryption. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 656af96 - Browse repository at this point
Copy the full SHA 656af96View commit details -
e2e: Add encrypted PVC with default settings test
Add test that enables encryption with default type. Check that we set up block encryption. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for d94e75e - Browse repository at this point
Copy the full SHA d94e75eView commit details -
e2e: Apply formatting to rbd suite and helper
Apply formatting for previous changes separately to make the commit diffs easier to read. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for b179a13 - Browse repository at this point
Copy the full SHA b179a13View commit details -
e2e: Use utilEncryptionType instead of string in rbd suite
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for e4c561b - Browse repository at this point
Copy the full SHA e4c561bView commit details -
kms: Add GetSecret() to KMIP KMS
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 7fa6046 - Browse repository at this point
Copy the full SHA 7fa6046View commit details -
scripts: Add env to set minikube iso url
Make iso url configurable to use pre-release minikube images or local-built (file://) Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 829414c - Browse repository at this point
Copy the full SHA 829414cView commit details -
util: Add EncryptionTypeNone and unit tests
Add type none to distinguish disabled encryption (positive result) from invalid configuration (negative result). Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 12bd495 - Browse repository at this point
Copy the full SHA 12bd495View commit details -
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 8a23075 - Browse repository at this point
Copy the full SHA 8a23075View commit details -
cephfs: Add placeholder journal fscrypt support
Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for 1dff9a6 - Browse repository at this point
Copy the full SHA 1dff9a6View commit details -
e2e: Feature flag RBD fscrypt tests (default disabled)
Add test-rbd-fscrypt feature flag to e2e suite. Default disabled as the current CI system's kernel doesn't have the required features enabled. Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
Configuration menu - View commit details
-
Copy full SHA for eccb1a7 - Browse repository at this point
Copy the full SHA eccb1a7View commit details