---
title: Customer-managed keys for encryption
description: Learn about using your own key with a Databricks workspace to encrypt some types of data.
canonical_url: https://docs.databricks.com/aws/en/security/keys/customer-managed-keys
---

# Customer-managed keys for encryption

> [!NOTE]
>
> This feature requires the [Enterprise tier](https://databricks.com/product/pricing/platform-addons).

This page provides an overview of customer-managed keys for encryption. Some services and data support adding a customer-managed key to help protect and control access to encrypted data. You can use the key management service in your cloud to maintain a customer-managed encryption key.

For instructions on how to configure keys, see [Configure customer-managed keys for encryption](https://docs.databricks.com/aws/en/security/keys/configure-customer-managed-keys.md).

## Customer-managed key use cases

Databricks has three customer-managed key use cases that involve different types of data and locations:

* **Managed services**: Data in the [Databricks control plane](https://docs.databricks.com/aws/en/getting-started/high-level-architecture.md), including notebooks, secrets, SQL query data, and data stored in [default storage](https://docs.databricks.com/aws/en/storage/default-storage.md).
* **Workspace storage**: Your workspace storage bucket (which contains DBFS root) and the EBS volumes of compute resources in the classic compute plane. Does not apply to [default storage](https://docs.databricks.com/aws/en/storage/default-storage.md).
* **Unity Catalog**: Data in Unity Catalog catalogs backed by [default storage](https://docs.databricks.com/aws/en/storage/default-storage.md). You can use a separate key for each catalog. See [Customer-managed keys for Unity Catalog](https://docs.databricks.com/aws/en/security/keys/cmek-unity-catalog.md).

Unity Catalog also supports the ability to read from and write to S3 buckets with KMS encryption enabled. See [ Create a storage credential that accesses an AWS S3 bucket](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/s3/s3-external-location-manual.md#create-storage-credential)

> [!NOTE]
>
> For [serverless workspaces](https://docs.databricks.com/aws/en/admin/workspace/serverless-workspaces.md), you only need to configure keys for managed services, which applies to the workspace storage and root storage.

## <a id="managed-services" />Customer-managed keys for managed services

Managed services data in the Databricks [control plane](https://docs.databricks.com/aws/en/getting-started/high-level-architecture.md) is encrypted at rest. You can add a customer-managed key for managed services to help protect and control access to the following types of encrypted data:

* Notebook source in the Databricks [control plane](https://docs.databricks.com/aws/en/getting-started/high-level-architecture.md).
* Notebook results for notebooks run interactively (not as jobs) that are stored in the control plane. By default, larger results are also stored in your workspace root bucket. You can configure Databricks to [store all interactive notebook results in your cloud account](https://docs.databricks.com/aws/en/admin/workspace-settings/storage.md).
* Secrets stored in [Databricks secret scopes](https://docs.databricks.com/aws/en/security/secrets/workspace-secret-scopes.md).
* [AI/BI dashboards](https://docs.databricks.com/aws/en/dashboards/index.md).
* [Genie Agents](https://docs.databricks.com/aws/en/genie-agents/index.md).
* Databricks SQL [queries and query history](https://docs.databricks.com/aws/en/security/keys/sql-encryption.md).
* Personal access tokens (PAT) or other credentials used to [set up Git integration with Databricks Git folders](https://docs.databricks.com/aws/en/repos/repos-setup.md).
* [AI Search indexes and metadata](https://docs.databricks.com/aws/en/ai-search/ai-search.md).
* [Lakebase Autoscaling](https://docs.databricks.com/aws/en/oltp/projects/customer-managed-keys.md) project data at rest.
* For [serverless workspaces](https://docs.databricks.com/aws/en/admin/workspace/serverless-workspaces.md), the managed services use case also applies to the workspace storage and root storage, which includes job results, Databricks SQL results, notebook revisions, and other workspace data.

> [!NOTE]
>
> Setting up customer-managed keys for managed services causes certain fields in the metastore's [query history system table](https://docs.databricks.com/aws/en/admin/system-tables/query-history.md), such as `statement_text`, to appear empty until you also configure a customer-managed key in the system catalog. Account admins can configure the `system` catalog's data encryption settings to make these fields available. See [Reading encrypted fields](https://docs.databricks.com/aws/en/admin/system-tables/query-history.md#cmk).

AWS KMS key rotation, automatic or on-demand, is compatible with customer-managed keys for managed services. See [Rotate or replace a key](https://docs.databricks.com/aws/en/security/keys/configure-customer-managed-keys.md#rotate).

To configure customer-managed keys for managed services, see [Configure customer-managed keys for encryption](https://docs.databricks.com/aws/en/security/keys/configure-customer-managed-keys.md).

> [!NOTE]
>
> Only AI/BI dashboards created after November 1, 2024, are encrypted and compatible with customer-managed keys.

## <a id="workspace-storage" />Customer-managed keys for workspace storage

You can add a customer-managed key for workspace storage to protect and control access to the following types of encrypted data:

* **Your workspace storage bucket**: If you add a workspace storage encryption key, Databricks encrypts the data on the Amazon S3 bucket in your AWS account that you specified when you set up your workspace, which is known as the workspace storage bucket. This bucket contains [DBFS root](https://docs.databricks.com/aws/en/dbfs/dbfs-root.md), which includes the FileStore area, MLflow Models, and Lakeflow pipelines data in your DBFS root (not DBFS mounts). The bucket also includes workspace system data, which includes job results, Databricks SQL results, notebook revisions, and other workspace data. For more information, see [Create a storage configuration](https://docs.databricks.com/aws/en/admin/workspace/create-uc-workspace.md#storage).
* **Your cluster's EBS volumes (optional)**: For Databricks Runtime cluster nodes and other compute resources in the [classic compute plane](https://docs.databricks.com/aws/en/getting-started/high-level-architecture.md), you can optionally use the key to encrypt the VM's remote EBS volumes.

> [!NOTE]
>
> This feature affects your [DBFS root](https://docs.databricks.com/aws/en/dbfs/dbfs-root.md) but is not used for encrypting data on any additional DBFS mounts. For S3 DBFS mounts, you can use other approaches to writing encrypted data with your keys. For more information, see [Encrypt data in S3 buckets](https://docs.databricks.com/aws/en/dbfs/mounts.md#s3-encryption). Mounts are a legacy access pattern. Databricks recommends using Unity Catalog for managing all data access. See [Connect to cloud object storage using Unity Catalog](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/index.md).

## <a id="compare" />Compare customer-managed keys use cases

The following table lists which customer-managed key features are used for which types of data.

> [!NOTE]
>
> The encryption use cases can vary based on the type of workspace. [Serverless workspaces](https://docs.databricks.com/aws/en/admin/workspace/serverless-workspaces.md) only use the managed services use case.

| Type of data                                                                                                                                                      | Location                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Which customer-managed key feature to use                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AI/BI dashboards                                                                                                                                                  | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Notebook source and metadata                                                                                                                                      | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Personal access tokens (PAT) or other credentials used for [Git integration with Databricks Git folders](https://docs.databricks.com/aws/en/repos/repos-setup.md) | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Secrets stored by the [secret manager APIs](https://docs.databricks.com/aws/en/security/secrets/index.md)                                                         | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [Databricks SQL](https://docs.databricks.com/aws/en/sql/index.md) queries and query history                                                                       | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [AI Search indexes and metadata](https://docs.databricks.com/aws/en/ai-search/ai-search.md)                                                                       | Serverless compute plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [Lakebase Autoscaling](https://docs.databricks.com/aws/en/oltp/projects/customer-managed-keys.md) project data                                                    | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| The [remote EBS volumes](https://aws.amazon.com/ebs/) for Databricks Runtime cluster nodes and other compute resources.                                           | **Classic workspaces:** [Classic compute plane in your AWS account](https://docs.databricks.com/aws/en/getting-started/high-level-architecture.md)<br />**Serverless workspaces:** Not applicable (storage is ephemeral on serverless compute)                                                                                                                                                                                                                                                                                                                             | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Not applicable                                                                                                                                                                                                                                                                                                                                                                                  |
| [Root storage data](https://docs.databricks.com/aws/en/dbfs/dbfs-root.md)                                                                                         | **Classic workspaces:** [DBFS root](https://docs.databricks.com/aws/en/dbfs/dbfs-root.md) in your workspace storage bucket in your AWS account. This also includes the FileStore area.<br />**Serverless workspaces:** The workspace's default storage                                                                                                                                                                                                                                                                                                                     | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Managed services                                                                                                                                                                                                                                                                                                                                                                                |
| [Job](https://docs.databricks.com/aws/en/jobs/index.md) results                                                                                                   | **Classic workspaces:** Workspace storage bucket in your AWS account<br />**Serverless workspaces:** The workspace's default storage                                                                                                                                                                                                                                                                                                                                                                                                                                       | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Managed services                                                                                                                                                                                                                                                                                                                                                                                |
| [Databricks SQL](https://docs.databricks.com/aws/en/sql/index.md) query results                                                                                   | **Classic workspaces:** Workspace storage bucket in your AWS account<br />**Serverless workspaces:** The workspace's default storage                                                                                                                                                                                                                                                                                                                                                                                                                                       | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Managed services                                                                                                                                                                                                                                                                                                                                                                                |
| [MLflow Models](https://docs.databricks.com/aws/en/mlflow/models.md)                                                                                              | **Classic workspaces:** Workspace storage bucket in your AWS account<br />**Serverless workspaces:** The workspace's default storage                                                                                                                                                                                                                                                                                                                                                                                                                                       | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Managed services                                                                                                                                                                                                                                                                                                                                                                                |
| [Lakeflow pipelines](https://docs.databricks.com/aws/en/ldp/index.md)                                                                                             | **Classic workspaces:** If you use a DBFS path in your DBFS root, this is stored in the workspace storage bucket in your AWS account. This does not apply to [DBFS paths that represent mount points](https://docs.databricks.com/aws/en/dbfs/mounts.md) to other data sources.<br />**Serverless workspaces:** The workspace's default storage                                                                                                                                                                                                                            | **Classic workspaces:** Workspace storage<br />**Serverless workspaces:** Managed services                                                                                                                                                                                                                                                                                                                                                                                |
| [Interactive notebook results](https://docs.databricks.com/aws/en/admin/workspace-settings/notebook-results.md)                                                   | **Classic workspaces:** By default, when you run a notebook interactively (rather than as a job) results are stored in the control plane for performance with some large results stored in your workspace storage bucket in your AWS account. You can choose to configure Databricks to [store all interactive notebook results in your AWS account](https://docs.databricks.com/aws/en/admin/workspace-settings/notebook-results.md#configure-the-storage-location-for-all-interactive-notebook-results).<br />**Serverless workspaces:** The workspace's default storage | **Classic workspaces:** For partial results in the control plane, use a customer-managed key for managed services. For results in the workspace storage bucket, which you can [configure](https://docs.databricks.com/aws/en/admin/workspace-settings/notebook-results.md#configure-the-storage-location-for-all-interactive-notebook-results) for all result storage, use a customer-managed key for workspace storage.<br />**Serverless workspaces:** Managed services |
| [Model Serving container images and model artifacts](https://docs.databricks.com/aws/en/machine-learning/model-serving/manage-serving-endpoints.md)               | Control plane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Managed services                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Data in Unity Catalog catalogs backed by [default storage](https://docs.databricks.com/aws/en/storage/default-storage.md)                                         | Default storage                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | [Unity Catalog](https://docs.databricks.com/aws/en/security/keys/cmek-unity-catalog.md)                                                                                                                                                                                                                                                                                                                                                                                   |

## <a id="serverless" />Serverless compute and customer-managed keys

[Databricks SQL Serverless](https://docs.databricks.com/aws/en/compute/sql-warehouse/index.md) and [serverless compute](https://docs.databricks.com/aws/en/compute/serverless/index.md) support:

* Keys for managed services like Databricks SQL queries, query history, notebook source and metadata, and AI Search indexes and metadata.
* Workspace storage keys including root storage for Databricks SQL and notebook results.

Encryption for remote EBS volumes does not apply to serverless compute because disks for serverless compute resources are short-lived and tied to the lifecycle of the serverless workload. When serverless compute resources are stopped or scaled down, the VMs and their storage are destroyed.

### Model Serving

Resources for [Model Serving](https://docs.databricks.com/aws/en/machine-learning/model-serving/index.md), a serverless compute feature, are generally in two categories:

* **Resources you create**: Model artifacts and version metadata are stored in your workspace's root storage. Both Model Serving and MLflow use this storage. You can configure customer-managed key encryption for this data.
* **Resources Databricks creates**: Container images and model artifacts are stored in the Databricks managed registry. Customer-managed keys for managed services encrypt this data.
