Repository navigation
Conversation
|
@blueorangutan package |
|
@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14453 +/- ##
============================================
+ Coverage 20.45% 20.48% +0.02%
- Complexity 21417 21457 +40
============================================
Files 6487 6487
Lines 589329 589676 +347
Branches 72246 72282 +36
============================================
+ Hits 120554 120796 +242
- Misses 455642 455741 +99
- Partials 13133 13139 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19644 |
90b18fc to
6abe098
Compare
a3121b3 to
743cc40
Compare
|
@blueorangutan package |
|
@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19656 |
743cc40 to
efb1c68
Compare
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19659 |
|
@blueorangutan test |
|
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
Fixes a set of problems in the KMS feature shipped in 4.23.0.0, plus an upgrade path for 4.23 databases.
Volumes migrated with
migrateVolumesToKMScould not be opened. Migration wrapped the base64 text of the legacy passphrase.VolumeObject.getPassphrase()base64-encodes the unwrapped bytes again, so qemu got a different passphrase than the one the LUKS header was created with (Invalid password, cannot unlock any keyslot). Migration now wraps the 48 decoded bytes, and the old passphrase row is deleted in the same transaction. Blobs already migrated on 4.23 are repaired by a background task after the upgrade (see Upgrade).Keys were removed while still needed.
VolumeDaoImpl.remove()removed the wrapped key. Volume migration (duplicateVolumeOnAnotherStorage) gives the new volume the same key, so expunging the source broke the migrated volume.SnapshotObjectTOunwraps it eagerly), but expunging released the key anyway. The legacy passphrase had the same problem, sincedeletePassphrase()hard-deleted the row.Now
remove()leaves the key alone, anddeleteKMSWrappedKey/deletePassphrasekeep it while another live volume or a non-destroyed snapshot still needs it. The storage GC callsVolumeService.releaseKeysOfRemovedVolumes()to release such keys once nothing needs them anymore. For a removed volume whose key is already gone,getPassphrase()returns an empty passphrase, so its snapshots can still be deleted.Wrap algorithm. PKCS#11 wrapped keys were AES-CBC with no authentication, and
kms_keys.algorithmwas hardcoded to GCM even for PKCS#11 keys.wrap_algorithmdetail:AES/GCM/NoPadding(default),AES/KWP/NoPadding(needs Java 18+ on the management server) orAES/CBC/PKCS5Padding(4.23's format). It can't be changed after the profile is created, and each wrapped key records the algorithm it was written with inkms_wrapped_key.wrap_algorithm.createKMSKeyandrotateKMSKeywrap and unwrap a random test key right after creating the KEK and refuse the key (and delete the KEK again) if the HSM can't do the profile's algorithm.KMSKey.algorithmnow comes from the provider.C_GenerateRandom), with the JVM'sSecureRandomas fallback for tokens without one.kms.dek.size.bitsis validated.C_Decryptactive, which made every later operation on that session fail withCKR_OPERATION_ACTIVE.Smaller fixes
deleteKMSKeyno longer removes the DB row when deleting a KEK from the HSM fails (a KEK that is already gone is skipped).deleteKeynow reportsKEK_NOT_FOUND.getPassphrase()no longer copies the key into an immutableString.HSM Database ProvidertoDatabase Provider.token_labelis gone from the UI. The provider wrotetokenLabel=into the SunPKCS11 config, which SunPKCS11 doesn't have (any JDK 17-25), so profiles using it never connected. A profile needsslotorslot_list_index.Upgrade (4.23.0.0 -> 24.0.0)
No HSM access is needed during the upgrade.
kms_wrapped_keygetswrap_algorithm(existing PKCS#11 keys are set to CBC, database-provider keys to GCM) andformat_check_pending(set to 1 on all existing rows).wrap_algorithm=AES/CBC/PKCS5Paddingand theirkms_keys.algorithmis corrected, so nothing changes for them. To move to GCM or KWP, create a profile with the new algorithm and runrotateKMSKeyonto it. The existing rewrap worker converts the blobs.Upgrade42300to2400restores wrapped keys that 4.23 removed while a live volume or non-destroyed snapshot still needed them, as long as the KMS key and KEK still exist. For the others it logs a WARN with the wrapped key and volume UUIDs.KMSKeyFormatRepair, shares thekms.rewrap.workerlock) checks every flagged key once, using the unwrapped length and format. Keys that 4.23 migrated wrongly are rewrapped with the raw bytes, and an event is added for the volume. A key whose volume was created after the key is not touched: that is a copy made by a storage migration on 4.23, which was encrypted with the wrong passphrase, so rewrapping would make it unreadable. It logs a WARN and leaves it to the admin. A key that can't be unwrapped (HSM down) stays flagged and is retried. The task stops when nothing is flagged.Things to know
memcpythat trips_GLIBCXX_ASSERTIONS; Ubuntu's 2.6.1 is fine). bouncyhsm's client library rejects the GCM parameters JDK 17 sends first, so GCM there needs Java 21; the wrap test reports it cleanly on 17. Use CBC for such HSMs.C_Encrypt. openCryptoki 3.26 does; SoftHSM 2.7.0 and bouncyhsm don't, and the wrap test refuses the key.LibvirtStorageAdaptor.copyPhysicalDiskignores the passphrases. That is not KMS-specific and goes back to 4.18.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?