For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.

Configure KMIP Encryption at Rest

You can configure encryption at rest for a MongoDB deployment managed by the Kubernetes Operator by using a KMIP server.

Before configuring encryption at rest, consider the following:

  • You must have a running KMIP server.

  • You can't transition your deployment that uses keyfile-based encryption at rest to KMIP-based encryption at rest.

  • If you want to enable KMIP encryption at rest for an already deployed MongoDB resource, contact MongoDB Support.

The following procedure describes how to configure a sample KMIP configuration for a MongoDB replica set. Adjust the file names and paths, Kubernetes namespace, resource names, and MongoDB version as necessary for your deployment.

1

Run the following command to create a ConfigMap to hold the CA that signed the KMIP server's certificate:

kubectl -n mongodb create configmap mongodb-kmip-certificate-authority-pem --from-file=ca.pem
2

Run the following command to create a secret to hold the concatenated client certificate and private key for checking out the master key from the KMIP server:

kubectl -n mongodb create secret generic mongodb-kmip-client-pem --from-file=cert.pem
3

Configure the additionalMongodConfig settings in your custom resource specification to use the KMIP server. For example:

apiVersion: mongodb.com/v1kind: MongoDBmetadata: name: kmip namespace: mongodbspec: type: ReplicaSet members: 3 backup: encryption: kmip: client: clientCertificatePrefix: "mdb" additionalMongodConfig: security: enableEncryption: true kmip: clientCertificateFile: /kmip/cert/cert.pem serverCAFile: /kmip/ca/ca.pem serverName: pykmip-server.pymongo port: 5696 featureCompatibilityVersion: '8.0' version: 8.0.0 opsManager: configMapRef: name: my-project credentials: my-credentials podSpec: podTemplate: spec: containers: - name: mongodb-enterprise-database volumeMounts: - name: mongodb-kmip-client-pem mountPath: /kmip/cert - name: mongodb-kmip-certificate-authority-pem mountPath: /kmip/ca volumes: - name: mongodb-kmip-client-pem secret: secretName: mongodb-kmip-client-pem - name: mongodb-kmip-certificate-authority-pem configMap: name: mongodb-kmip-certificate-authority-pem items: - key: ca.pem path: ca.pem

Important

If you set the spec.backup.encryption.kmip setting in your resource, the API keys linked with the value of spec.credentials must have the Global Owner role.

Rate this page