Uh oh!
There was an error while loading. Please reload this page.
Feature: Key Management Service (KMS) - #12711
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@## main #12711 +/- ##
============================================
+ Coverage 18.10% 18.74% +0.63% - Complexity 16750 18063 +1313
============================================
Files 6037 6189 +152 Lines 542798 556031 +13233 Branches 66457 67678 +1221 ============================================
+ Hits 98298 104247 +5949 - Misses 433453 440338 +6885 - Partials 11047 11446 +399
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:
|
There was a problem hiding this comment.
Pull request overview
This pull request introduces a comprehensive Key Management Service (KMS) framework for CloudStack that provides envelope encryption for volume encryption. KEKs (Key Encryption Keys) stored in PKCS#11-compliant HSMs or the CloudStack database wrap per-volume DEKs (Data Encryption Keys), ensuring key material is never stored in plaintext.
Changes:
- Adds KMS framework with HSM integration for envelope encryption
- Introduces 8 new admin/user APIs for KMS key and HSM profile management
- Creates 6 new database tables for storing KMS metadata
- Adds UI support for KMS key selection in volume and VM deployment workflows
Reviewed changes
Copilot reviewed 123 out of 123 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
framework/kms/ | Core KMS framework interfaces and exceptions |
plugins/kms/ | Database and PKCS#11 KMS provider implementations |
engine/schema/ | Database entities and DAOs for KMS tables |
api/src/main/java/org/apache/cloudstack/api/command/ | New API commands for KMS operations |
ui/src/views/ | UI components for KMS key selection |
server/src/main/java/ | KMS manager implementation and integration |
| Test files | Unit tests for KMS retry logic and key creation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
blueorangutan
commented
Feb 26, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16962 |
8ea09bb to
df2df4bCompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 124 out of 124 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
75519c2 to
1fce0b2Comparevishesh92
commented
Mar 4, 2026
@blueorangutan package |
blueorangutan
commented
Mar 4, 2026
@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. |
blueorangutan
commented
Mar 4, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16998 |
vishesh92
commented
Mar 5, 2026
@blueorangutan package |
blueorangutan
commented
Mar 5, 2026
@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. |
blueorangutan
commented
Mar 5, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17008 |
vishesh92
commented
Jun 8, 2026
@blueorangutan package |
blueorangutan
commented
Jun 8, 2026
@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. |
blueorangutan
commented
Jun 8, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18184 |
vishesh92
commented
Jun 8, 2026
@blueorangutan test |
blueorangutan
commented
Jun 8, 2026
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
Jun 9, 2026
[SF] Trillian test result (tid-16259)
|
vishesh92
commented
Jun 9, 2026
@blueorangutan package |
blueorangutan
commented
Jun 9, 2026
@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. |
blueorangutan
commented
Jun 9, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18207 |
vishesh92
commented
Jun 10, 2026
@blueorangutan package |
blueorangutan
commented
Jun 10, 2026
@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. |
blueorangutan
commented
Jun 10, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18214 |
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM
Tested the HSM, and kms key generation feature with Bouncy Castle, Soft HSM and the internal database HSM provider .
https://github.com/harrison314/BouncyHsm
https://github.com/softhsm/SoftHSMv2
| Test Case Execution | Result |
|---|---|
| Test the api addHSMProfile | Pass |
| Test the api listHSMProfiles | Pass |
| Test the api updateHSMProfile | Pass |
| Test the api deleteHSMProfile | Pass |
| Test the createKMSKey api call | Pass |
| Test the api call listKMSKeys | Pass |
| Test the api call updateKMSKey | Pass |
| Test the api call rotateKMSKey | Pass |
| Test the api call deleteKMSKey | Pass |
| Test the api call migrateVolumesToKMS | Pass |
| Test the creation of kms key from the database provider | Pass |
| Deploy VM with encrypted root and data volume using KMS key | Pass |
| Deploy VM with encrypted root volume using KMS key from database provider | Pass |
| Deploy VM with encrypted root volume using legacy encryption | Pass |
| Background rewrap processes wrapped keys in batches | Pass |
| validation of kms.dek.size.bits | Pass |
| KMS operation retries on transient failure | Pass |
| Perform stop/start/migrate of the vm deployed with kms key | Pass |
| Change the hsm profile of a kms key | Pass |
| Test the kms key and hsm profile events | Pass |
The kms key option is provided when deploying vm and also when creating a data volume.






weizhouapache
commented
Jun 23, 2026
@harikrishna-patnala |
weizhouapache
commented
Jun 23, 2026
@blueorangutan package |
blueorangutan
commented
Jun 23, 2026
@weizhouapache 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. |
weizhouapache
commented
Jun 23, 2026
this is ready for review @blueorangutan package |
weizhouapache
commented
Jun 23, 2026
@harikrishna-patnala |
blueorangutan
commented
Jun 23, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18347 |
DaanHoogland
commented
Jun 24, 2026
@blueorangutan test |
blueorangutan
commented
Jun 24, 2026
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
Jun 24, 2026
[SF] Trillian test result (tid-16421)
|
Key Management Service (KMS) with HSM Integration
Description
Introduces a Key Management Service (KMS) framework for CloudStack that provides envelope encryption for volume encryption. KEKs (Key Encryption Keys) stored in PKCS#11-compliant HSMs or the CloudStack database wrap per-volume DEKs (Data Encryption Keys), ensuring key material is never stored in plaintext.
Design Document: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Key+Management+Service+%28KMS%29+with+HSM+Integration
Docs PR: apache/cloudstack-documentation#634
New APIs
createKMSKeylistKMSKeysupdateKMSKeydeleteKMSKeyrotateKMSKeymigrateVolumesToKMSaddHSMProfilelistHSMProfilesupdateHSMProfiledeleteHSMProfileNew Database Tables
kms_hsm_profiles,kms_hsm_profile_details,kms_keys,kms_kek_versions,kms_wrapped_key,kms_database_kek_objectsModified:
cloud.volumes— addedkms_key_idandkms_wrapped_key_idcolumns.New Global Settings
kms.dek.size.bits256kms.retry.count3kms.retry.delay.ms1000kms.operation.timeout.sec30kms.rewrap.batch.size50kms.rewrap.interval.ms300000UI Changes
How to Test
Tested with: