For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 Keeper Security, you need a service account key file (.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-kms

  • GCP KMS key needs ENCRYPT and DECRYPT permissions.

Setup

1. Install Module

Setting up project using Gradle or Maven

Gradle

Maven

2. Configure GCP KMS 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.

See the Google documentation for more information on generating keys:

https://cloud.google.com/iam/docs/keys-create-delete

3. Add GCP KMS Storage to Your Code

Once GCP connection has been configured, you can use the GCP KMS integration to encrypt and decrypt the KSM configuration. Tell the Secrets Manager SDK to use GCP KMS as storage.

Using GCP KMS Integration

Once set up, the Secrets Manager GCP KMS integration supports all Secrets Manager SDK functionality. Your code will need to be able to access the GCP KMS 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.

Using Application Default Credentials

If you have configured credentials via gcloud auth application-default login, the GOOGLE_APPLICATION_CREDENTIALS environment variable, or are running on a GCP compute instance with a service account attached, you can omit the credentials file entirely.

Alternatively, you can pass the service account email and private key directly without a 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

You can decrypt the configuration file to migrate to a different cloud provider or to retrieve your raw credentials. Pass true to save the decrypted configuration back to the file, or false to return the plaintext without modifying the file.

Check out the KSM SDKs documentation for more examples and functionality

Last updated