Feature: Key Management Service (KMS)#12711
Conversation
0a283c9 to
5112eea
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #12711 +/- ##
=============================================
- Coverage 18.02% 3.51% -14.52%
=============================================
Files 6029 465 -5564
Lines 542181 40311 -501870
Branches 66450 7597 -58853
=============================================
- Hits 97737 1415 -96322
+ Misses 433428 38706 -394722
+ Partials 11016 190 -10826
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ceb2913 to
d629f87
Compare
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.
ba00a5d to
943f19a
Compare
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16962 |
8ea09bb to
df2df4b
Compare
There 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.
75519c2 to
1fce0b2
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 16998 |
|
@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 17008 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@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 17520 |
|
@blueorangutan test keepEnv |
|
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
[SF] Trillian test result (tid-15899)
|
| } | ||
|
|
||
| public Map<String, String> getDetails() { | ||
| Map<String, String> detailsMap = new HashMap<>(); |
There was a problem hiding this comment.
| Map<String, String> detailsMap = new HashMap<>(); | |
| return convertDetailsToMap(details); |
use the common method
| private Date created; | ||
| @Column(name = GenericDao.REMOVED_COLUMN) | ||
| @Temporal(TemporalType.TIMESTAMP) | ||
| private Date removed; |
There was a problem hiding this comment.
@vishesh92 can maintain spacing between column parameters same as other VOs.
| private static final Logger logger = LogManager.getLogger(KMSManagerImpl.class); | ||
| private static final Map<String, KMSProvider> kmsProviderMap = new HashMap<>(); | ||
| private final ExecutorService kmsOperationExecutor = new ThreadPoolExecutor( | ||
| 2, 100, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), r -> { |
There was a problem hiding this comment.
any of these needs a config?
sureshanaparti
left a comment
There was a problem hiding this comment.
@vishesh92 minor comments, check/address them and resolve conflicts. overall clgtm.
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: