Skip to content

Commit

Permalink
Adding endpoint key for Thales and Azure KMS providers
Browse files Browse the repository at this point in the history
For Thales enterprise KMS (KMIP) and Azure KMS configurations,
endpoint address keys were missing. This caused the 'reachKMSProvider'
function, to ignore the provided endpoint address.

Now we have added the address keys (the key in the configmap where
KMS endpoint address is stored) for Thales ('KMIP_ENDPOINT') and
Azure ('AZURE_VAULT_URL') KMS providers.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
  • Loading branch information
aruniiird committed Aug 2, 2024
1 parent ad2eaa4 commit 858d548
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (obj *ocsCephCluster) ensureCreated(r *StorageClusterReconciler, sc *ocsv1.
sc.Status.KMSServerConnection.KMSServerAddress = kmsConfigMap.Data["VAULT_ADDR"]
} else if kmsConfigMap.Data["KMS_PROVIDER"] == AzureKSMProvider {
sc.Status.KMSServerConnection.KMSServerAddress = kmsConfigMap.Data["AZURE_VAULT_URL"]
} else if kmsConfigMap.Data["KMS_PROVIDER"] == ThalesKMSProvider {
sc.Status.KMSServerConnection.KMSServerAddress = kmsConfigMap.Data["KMIP_ENDPOINT"]
}
if err = reachKMSProvider(kmsConfigMap); err != nil {
sc.Status.KMSServerConnection.KMSServerConnectionError = err.Error()
Expand Down
4 changes: 3 additions & 1 deletion controllers/storagecluster/kms_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ const (
var (
// currently supported KMS providers mapped to their address key
kmsProviderAddressKeyMap = map[string]string{
VaultKMSProvider: "VAULT_ADDR",
VaultKMSProvider: "VAULT_ADDR",
AzureKSMProvider: "AZURE_VAULT_URL",
ThalesKMSProvider: "KMIP_ENDPOINT",
}
// Mapping of KMS providers and key where corresponding Secret name is stored
kmsProviderSecretKeyMap = map[string]string{
Expand Down

0 comments on commit 858d548

Please sign in to comment.