Google Cloud Key Management Encryption
Protect Secrets Manager connection details with Google Cloud Key Management

Keeper Secrets Manager integrates with Google Cloud Key Management in order to provide encryption for Keeper Secrets Manager configuration files. With this integration, you can protect connection details on your machine while taking advantage of Keeper's zero-knowledge encryption of all your secret credentials.
Features
Encrypt and Decrypt your Keeper Secrets Manager configuration files with Google Cloud Key Management.
Protect against unauthorized access to your Secrets Manager connections.
Requires only minor changes to code for immediate protection. Works with all Keeper Secrets Manager SDK functionality.
Prerequisites
To configure, Google Cloud Key Management with Keeeper Security you need service account keys ended with .json .
Key structure that is supported by this integration is `projects/<project_name>/locations/<location_name>/keyRings/<key_ring_name>/cryptoKeys/<key_name>/cryptoKeyVersions/<key_version>`
Support the Java/Kotlin Secrets Manager SDK.
Required GCP package
google-cloud-kmsGoogle Cloud Key Management needs
ENCRYPTandDECRYPTpermissions.
Supports the JavaScript Secrets Manager SDK
Requires the
@google-cloud/kmspackage from GCP SDK.GCP CKM Key needs
ENCRYPTandDECRYPTpermissions.
Supports the Python Secrets Manager SDK
Requires
google-cloud-kmspackageGCP CKM Key needs
ENCRYPTandDECRYPTpermissions.
Supports the .Net Secrets Manager SDK
Requires Google.Apis.CloudKMS.v1
GCP CKM Key needs
ENCRYPTandDECRYPTpermissions.
Supports the GoLang Secrets Manager SDK
GCP CKM Key needs
ENCRYPTandDECRYPTpermissions.
Setup
1. Install Module
Setting up project using Gradle or Maven
Gradle
Maven
The Secrets Manager Google Cloud Key Management module can be installed using npm
The Secrets Manager Google Cloud Key Management module can be installed using pip
The Secrets Manager Google Cloud Key Management module can be installed using dotnet nuget package manager.
The Secrets Manager Google Cloud Key Management module Integration can be installed using
2. Configure Google CKM Connection
To enable secure authentication with Google Cloud Platform (GCP), generate a Service Account key in JSON format. This credential file will serve as the authentication mechanism for interacting with GCP services programmatically.
3. Add GCP Key Vault Storage to Your Code
Once GCP connection has been configured, You can fetch the Key to encrypt / decrypt KSM configuration using integration and you need to tell the Secrets Manager SDK to utilize the KMS as storage.
Using GCP Key Vault Integration
Once setup, the Secrets Manager GCP Key Vault integration supports all Secrets Manager SDK functionality. Your code will need to be able to access the GCP CKM Keys in order to manage the encryption and decryption of the KSM configuration file. Using Specified Connection credentials
To do this, create GcpKeyValueStorage instance and use this in SecretManagerOptions constructor.
The GcpKeyValueStorage will require the name of the Secrets Manager configuration file , gcp credential file and key details of Cloud Key Management.
To do this, use GCPKeyValueStorage as your Secrets Manager storage in the SecretsManager constructor.
The storage will require an keyConfig , gcpsessionConfig(generated by GCPKSMClient) , and the name of the Secrets Manager configuration file which will be encrypted by GCP Cloud Key Management.
To do this, use GCPKeyValueStorage as your Secrets Manager storage in the SecretsManager constructor.
The storage will require gcp_key_config (generated by GCPConfig ), gcp_session_config object (generated by GCPKMSClientConfig ) and the name of the Secrets Manager configuration file which will be encrypted by GCP Cloud Key Management.
To do this, use GCPKeyValueStorage as your Secrets Manager storage in the SecretsManager constructor.
The storage will require an keyConfig (generated by GCPKeyConfig ), gcpSessionConfig object (generated by GCPKMSClient ), and the name of the Secrets Manager configuration file which will be encrypted by GCP Cloud Key Management.
To do this, use NewGCPKeyVaultStorage as your Secrets Manager storage in the NewSecretsManager
The NewGCPKeyVaultStorage requires the following parameters to encrypt the KSM configuration using GCP Cloud Key Management:
ksmConfigFileName : The file name of KSM configuration.
keyResourceName : ProvidekeyResourceName of Google Cloud Key Management
credentialFileWithPath : Provide file path with name of GCP credential file.
Additional Options
Change Key
We can change key that is used for encrypting the KSM configuration, examples below show the code needed to use it
Decrypt Config
We can decrypt the config if current implementation is to be migrated onto a different cloud or if you want your raw credentials back. The function accepts a boolean which when set to true will save the decrypted configuration to file and if it is false, will just return decrypted configuration.
You're ready to use the KSM integration 👍
Last updated
Was this helpful?

