Skip to content

util: add support for GKLM KMS over KMIP#6048

Merged
mergify[bot] merged 4 commits into
ceph:develfrom
black-dragon74:gklm-kmip
Mar 6, 2026
Merged

util: add support for GKLM KMS over KMIP#6048
mergify[bot] merged 4 commits into
ceph:develfrom
black-dragon74:gklm-kmip

Conversation

@black-dragon74

@black-dragon74 black-dragon74 commented Feb 10, 2026

Copy link
Copy Markdown
Member

Describe what this PR does

This patch adds support for GKLM KMS using the KMIP protocol.

Details specific to GKLM:

  • Get RPC to encrypt and decrypt the KEK for LUKS.
  • KMS' USE_CRYPTO_RPC is used to distinguish between which RPC to
    call.
    • If USE_CRYPTO_RPC is true, Encrypt/Decrypt RPCs are called.
    • If USE_CRYPTO_RPC is false, Get RPC is called to fetch the key
      by its UUID and encryption/decryption is done locally.

@black-dragon74

black-dragon74 commented Feb 10, 2026

Copy link
Copy Markdown
Member Author

Testing

Setup the KMS

❯ oc get secrets gklm-kms -oyaml
apiVersion: v1
data:
  CA_CERT: XXXX
  CLIENT_CERT: XXXX
  CLIENT_KEY: XXXX
  UNIQUE_IDENTIFIER: S0VZ....MWE2NGVkMmNm <== This is UID of the key in KMS, set by ODF console
kind: Secret
metadata:
  name: gklm-kms
  namespace: openshift-storage
type: Opaque

❯ oc get cm csi-kms-connection-details -oyaml
apiVersion: v1
data:
  gklm: '{
  "KMS_PROVIDER": "kmip",
  "KMS_SERVICE_NAME": "gklm", 
  "KMIP_ENDPOINT": "sklmapp.sklm.svc.cluster.local:5696",
  "KMIP_SECRET_NAME": "gklm-kms",
  "USE_CRYPTO_RPC": "false", <== UI/Docs will ensure its consistency, MUST be "false" for GKLM
  "TLS_SERVER_NAME": "sklmapp.sklm.svc.cluster.local"
}'
kind: ConfigMap
metadata:
  name: csi-kms-connection-details
  namespace: openshift-storage

Check PVC and Pods are running:

❯ oc -n sklm get po
NAME                       READY   STATUS    RESTARTS   AGE
sklmapp-6456fcd4c9-qzpjn   1/1     Running   0          22h
ubuntu-pod                 1/1     Running   0          42s

Check image metadata, before and after

// Before
❯ oc exec -it po/rook-ceph-tools-689bfdf6d7-x6hjf -- rbd image-meta ls csi-vol-92c21a8d-73f2-465b-a584-f850a53c75d1 -p ocs-storagecluster-cephblockpool
There are 7 metadata on this image:

Key                               Value
csi.ceph.com/cluster/name         939a690f-4997-4952-90ee-7bac0156cadd
csi.storage.k8s.io/pv/name        pvc-2f367d4e-4887-4c35-bb61-89128e36a2d0
csi.storage.k8s.io/pvc/name       gklm-pvc
csi.storage.k8s.io/pvc/namespace  sklm
rbd.csi.ceph.com/dek              {"dek":"S19PUFFfT0JKLTVkMDI5MWEtY2UyMGM4NWEtMWI3Mi00YWU0LTk4MmQtNDJiMmQ1N2JhNzgz","nonce":"TkE="}
rbd.csi.ceph.com/encrypted        encryptionPrepared
rbd.csi.ceph.com/luks2HeaderSize  16777216

// After
❯ oc exec -it po/rook-ceph-tools-689bfdf6d7-x6hjf -- rbd image-meta ls csi-vol-92c21a8d-73f2-465b-a584-f850a53c75d1 -p ocs-storagecluster-cephblockpool
There are 8 metadata on this image:

Key                                                                                                                                 Value                                                                 
.rbd.csi.ceph.com/userid/0001-0011-openshift-storage-0000000000000003-92c21a8d-73f2-465b-a584-f850a53c75d1/perf7-vd2vw-ocs-0-49z42  csi-rbd-node-ceph-user-g1-7b3ce12c-6b61-4edf-8964-336786573717        
csi.ceph.com/cluster/name                                                                                                           939a690f-4997-4952-90ee-7bac0156cadd                                  
csi.storage.k8s.io/pv/name                                                                                                          pvc-2f367d4e-4887-4c35-bb61-89128e36a2d0                              
csi.storage.k8s.io/pvc/name                                                                                                         gklm-pvc                                                              
csi.storage.k8s.io/pvc/namespace                                                                                                    sklm                                                                  
rbd.csi.ceph.com/dek                                                                                                                {"dek":"S19PUFFfT0JKLTVkMDI5MWEtY2UyMGM4NWEtMWI3Mi00YWU0LTk4MmQtNDJiMmQ1N2JhNzgz","nonce":"TkE="}
rbd.csi.ceph.com/encrypted                                                                                                          encrypted                                                             
rbd.csi.ceph.com/luks2HeaderSize                                                                                                    16777216 

@nixpanic

Copy link
Copy Markdown
Member

What is GKLM? Is that a particular Open Source project, or a product from some vendor? Any documentation/example updates that would benefit users?

@black-dragon74 black-dragon74 marked this pull request as draft February 10, 2026 13:56
@black-dragon74 black-dragon74 changed the title kms: add support for GKLM KMS over KMIP util: add support for GKLM KMS over KMIP Feb 10, 2026
@black-dragon74 black-dragon74 force-pushed the gklm-kmip branch 3 times, most recently from 8637705 to 706774a Compare February 17, 2026 08:44
Comment thread internal/kms/kmip.go Outdated
@Rakshith-R

Copy link
Copy Markdown
Contributor

What is GKLM? Is that a particular Open Source project, or a product from some vendor? Any documentation/example updates that would benefit users?

@nixpanic this change will support all kms that supports kmip but do not support the encrypt decrypt rpcs (one of them being GKLM).

Comment thread internal/kms/kmip.go Outdated
@black-dragon74 black-dragon74 marked this pull request as ready for review February 19, 2026 10:28
Comment thread docs/design/proposals/encryption-with-gklm.md Outdated
Comment thread docs/design/proposals/encryption-with-gklm.md Outdated
Comment thread internal/kms/kmip.go Outdated
Comment thread internal/rbd/encryption.go Outdated
Comment thread internal/kms/kmip.go
Comment thread docs/design/proposals/encryption-with-gklm.md Outdated
Comment thread docs/design/proposals/encryption-with-gklm.md Outdated
Comment thread internal/kms/kmip.go Outdated
@black-dragon74 black-dragon74 force-pushed the gklm-kmip branch 5 times, most recently from e509442 to eba6c52 Compare February 23, 2026 14:48
Comment thread docs/design/proposals/encryption-with-gklm.md
Comment thread internal/rbd/encryption.go Outdated
Comment thread internal/kms/kmip.go Outdated
@mergify

mergify Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏

@black-dragon74 black-dragon74 force-pushed the gklm-kmip branch 2 times, most recently from af7986d to b9b5ca3 Compare February 24, 2026 11:50
Comment thread internal/kms/vault.go
Rakshith-R
Rakshith-R previously approved these changes Mar 2, 2026

@Rakshith-R Rakshith-R left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@Rakshith-R Rakshith-R requested review from a team, iPraveenParihar and nixpanic March 2, 2026 06:48
@nixpanic

nixpanic commented Mar 6, 2026

Copy link
Copy Markdown
Member

@Mergifyio rebase

This patch adds support for GKLM KMS using the KMIP protocol.

Details specific to GKLM:
- Get RPC to encrypt and decrypt the KEK for LUKS.
- KMS' `USE_CRYPTO_RPC` is used to distinguish between which RPC to
  call.
  - If `USE_CRYPTO_RPC` is true, `Encrypt/Decrypt` RPCs are called.
  - If `USE_CRYPTO_RPC` is false, `Get` RPC is called to fetch the key
    by its UUID and encryption/decryption is done locally.
- Increase the key size to 256bits to be RSA compatible.

Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
This patch modifies the secrets KMS to use the helpers
for local symmetric encryption/decryption.

Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
@mergify

mergify Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

rebase

✅ Branch has been successfully rebased

@nixpanic nixpanic added the ok-to-test Label to trigger E2E tests label Mar 6, 2026
@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-cephfs

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/k8s-e2e-external-storage/1.33

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/upgrade-tests-rbd

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.33

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e-helm/k8s-1.35

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.34

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.33

@ceph-csi-bot

Copy link
Copy Markdown
Collaborator

/test ci/centos/mini-e2e/k8s-1.35

@nixpanic

nixpanic commented Mar 6, 2026

Copy link
Copy Markdown
Member

@Mergifyio refresh

@nixpanic

nixpanic commented Mar 6, 2026

Copy link
Copy Markdown
Member

@Mergifyio queue

@mergify

mergify Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

🛑 Queue command has been cancelled

@nixpanic

nixpanic commented Mar 6, 2026

Copy link
Copy Markdown
Member

@Mergifyio refresh

multi-arch-build has passed?

@mergify

mergify Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@mergify mergify Bot added the queued label Mar 6, 2026
@mergify mergify Bot merged commit 6fda146 into ceph:devel Mar 6, 2026
39 checks passed
@mergify

mergify Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

Rule: default


  • Entered queue2026-03-06 16:06 UTC
  • Checks passed · in-place
  • Merged2026-03-06 16:06 UTC · at 01e052eeb4699e2ab6baa29c4d779948ed686dd2

This pull request spent 10 seconds in the queue, with no time running CI.

Required conditions to merge

@mergify mergify Bot removed the queued label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants