Skip to content

Commit e3338f8

Browse files
authored
Add Azure CMEK support and improve documentation structure (#20022)
1 parent a94c619 commit e3338f8

File tree

4 files changed

+132
-19
lines changed

4 files changed

+132
-19
lines changed

src/current/cockroachcloud/cmek.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ You can manage your CMEK keys using one or more of the following services:
1212

1313
- Amazon Web Services (AWS) KMS
1414
- Google Cloud Platform (GCP) KMS
15+
- Microsoft Azure Key Vault
1516

1617
To learn more, visit [Managing Customer-Managed Encryption Keys (CMEK) for CockroachDB {{ site.data.products.advanced }}]({% link cockroachcloud/managing-cmek.md %}).
1718

18-
CockroachDB {{ site.data.products.advanced }} includes support for referring to CMEK keys in [HashiCorp Vault Secrets Manager](https://www.vaultproject.io/docs/secrets/key-management), which can distribute keys stored in multiple KMS systems, as long as the actual keys are stored in AWS KMS or GCP KMS.
19+
CockroachDB {{ site.data.products.advanced }} includes support for referring to CMEK keys in [HashiCorp Vault Secrets Manager](https://www.vaultproject.io/docs/secrets/key-management), which can distribute keys stored in multiple KMS systems, as long as the actual keys are stored in AWS KMS, GCP KMS, or Azure Key Vault.
1920

2021
{{site.data.alerts.callout_success}}
2122
You can learn more about the [supported integrations between CockroachDB and HashiCorp Vault]({% link {{site.current_cloud_version}}/hashicorp-integration.md %}).
@@ -40,7 +41,7 @@ This section describes some of the ways that CMEK can help you protect your data
4041

4142
You can use your KMS platform's controls to configure the regions where the CMEK key is available, enable automatic rotation schedules for CMEK keys, and view audit logs that show each time the CMEK key is used by CockroachDB {{ site.data.products.cloud }}. CockroachDB {{ site.data.products.cloud }} does not need any visibility into these details.
4243
- **Separation of concerns**: With CMEK, you give CockroachDB {{ site.data.products.cloud }} permission to encrypt and decrypt using the CMEK, but Cockroach Labs has no access to the CMEK's key material. The ability to create keys and manage IAM access to them can be delegated to a limited group of trusted individuals, who may be distinct from the organization's cluster admins.
43-
- **Infrastructure flexibility**: If your CMEK keys are stored in multiple KMS systems or tenants, you can use HashiCorp Vault Key Management Secrets Engine to give your cluster access to your CMEK keys, as long as the cluster and keys are stored in the same deployment environment (GCP or AWS).
44+
- **Infrastructure flexibility**: If your CMEK keys are stored in multiple KMS systems or tenants, you can use HashiCorp Vault Key Management Secrets Engine to give your cluster access to your CMEK keys, as long as the cluster and keys are stored in the same deployment environment (AWS, GCP, or Azure).
4445

4546
The following example shows some of the ways that CMEK can help you meet business and regulatory requirements.
4647

@@ -166,7 +167,6 @@ Not yet. To restore a failed CMEK-enabled cluster, please create a support ticke
166167

167168
CMEK has the following limitations:
168169

169-
- CMEK is not yet available for [CockroachDB {{ site.data.products.advanced }} on Azure]({% link cockroachcloud/cockroachdb-advanced-on-azure.md %}). To express interest, contact your Cockroach Labs account team.
170170
- To enable or revoke a CMEK on a cluster, you must use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) or the [CockroachDB Terraform provider](https://registry.terraform.io/providers/cockroachdb/cockroach/latest). It's not possible to enable a CMEK using the CockroachDB {{ site.data.products.cloud }} Console.
171171
- If you add a new region to a cluster with CMEK enabled, you must configure a CMEK for the new region to protect its data.
172172
- If the CMEK is not available due to a misconfiguration or a KMS outage, a cluster's managed backups will begin to fail, but no customer notification is sent from CockroachDB {{ site.data.products.cloud }} via email. However, Cockroach Labs support is notified if such a failure occurs.

src/current/cockroachcloud/cockroachdb-advanced-on-azure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ To express interest or request more information about a given limitation, contac
1313
CockroachDB {{ site.data.products.advanced }} clusters on Azure have the following temporary limitations. To express interest or request more information about a given limitation, contact your Cockroach Labs account team.
1414

1515
- A cluster must have at minimum three nodes. A multi-region cluster must have at minimum three nodes per region. Single-node clusters are not supported on Azure.
16-
- The following [PCI-Ready]({% link cockroachcloud/pci-dss.md %}) and HIPAA features are not yet available on Azure. However, CockroachDB {{ site.data.products.advanced }} on Azure meets or exceeds the requirements of SOC 2 Type 2. Refer to [Regulatory Compliance in CockroachDB {{ site.data.products.advanced }}]({% link cockroachcloud/compliance.md %}).
17-
- [Customer Managed Encryption Keys (CMEK)]({% link cockroachcloud/cmek.md %})
16+
- CockroachDB {{ site.data.products.advanced }} on Azure meets or exceeds the requirements of SOC 2 Type 2. (Refer to [Regulatory Compliance in CockroachDB {{ site.data.products.advanced }}]({% link cockroachcloud/compliance.md %}).) However, note that the following features needed for [PCI-Ready]({% link cockroachcloud/pci-dss.md %}) and HIPAA compliance are in Preview for Azure:
17+
- [Customer Managed Encryption Keys (CMEK)]({% link cockroachcloud/cmek.md %})
1818
- [Egress Perimeter Controls]({% link cockroachcloud/egress-perimeter-controls.md %})
1919

2020
You can configure IP allowlisting to limit the IP addresses or CIDR ranges that can access a CockroachDB {{ site.data.products.dedicated }} cluster on Azure, and you can use [Azure Private Link](https://learn.microsoft.com/azure/private-link/private-link-overview) to connect your applications in Azure to your cluster and avoid exposing your cluster or applications to the public internet. Refer to [Connect to your cluster]({% link cockroachcloud/connect-to-your-cluster.md %}#azure-private-link).

src/current/cockroachcloud/managing-cmek.md

Lines changed: 108 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ docs_area: manage.security
77

88
[Customer-Managed Encryption Keys (CMEK)]({% link cockroachcloud/cmek.md %}) for CockroachDB {{ site.data.products.cloud }} advanced allows the customer to delegate responsibility for the work of encrypting their cluster data to CockroachDB {{ site.data.products.cloud }}, while maintaining the ability to completely revoke CockroachDB {{ site.data.products.cloud }}'s access.
99

10-
This page shows how to enable [Customer-Managed Encryption Keys (CMEK)]({% link cockroachcloud/cmek.md %}) for CockroachDB {{ site.data.products.advanced }} advanced.
10+
This page shows how to enable [Customer-Managed Encryption Keys (CMEK)]({% link cockroachcloud/cmek.md %}) for CockroachDB {{ site.data.products.advanced }}.
1111

12-
## Before you begin
12+
## Prerequisites
1313

1414
To enable CMEK for a cluster, you need:
1515

16-
- An IAM role in your AWS account or a cross-tenant service account in your GCP project. CockroachDB Cloud will use this identity to encrypt and decrypt using the CMEK. This page shows how to provision a new identity, but you can use an existing identity instead. CMEK is not yet available for [CockroachDB {{ site.data.products.advanced }} on Azure]({% link cockroachcloud/cockroachdb-advanced-on-azure.md %}).
17-
- A CMEK key for your cluster stored in AWS KMS or GCP KMS. CockroachDB Cloud never has access to the CMEK itself. This page shows how to provision a new CMEK directly in your KMS or using Hashicorp Vault, but you can use an existing key instead.
18-
- A new CockroachDB {{ site.data.products.advanced }} [private cluster]({% link cockroachcloud/private-clusters.md %}) with [advanced security features]({% link cockroachcloud/create-an-advanced-cluster.md %}#step-6-configure-advanced-security-features) enabled. A private cluster's nodes communicate only over private Cloud infrastructure, avoiding public networks.<br /><br />Advanced security features can be enabled only during cluster creation. If necessary, create a new CockroachDB {{ site.data.products.advanced }} private cluster and enable advanced security features. Complete the steps in this page before inserting data into the cluster.
19-
- A [ CockroachDB {{ site.data.products.cloud }} service account]({% link cockroachcloud/managing-access.md %}#manage-service-accounts) and a [CockroachDB Cloud API key]({% link cockroachcloud/managing-access.md %}#create-api-keys) for the service account. You will use the service account to authenticate to the CockroachDB Cloud API and configure CMEK on your cluster.
16+
- A CockroachDB {{ site.data.products.advanced }} [private cluster]({% link cockroachcloud/private-clusters.md %}) with [advanced security features]({% link cockroachcloud/create-an-advanced-cluster.md %}#step-6-configure-advanced-security-features) enabled. Advanced security features can be enabled only during cluster creation. Complete the steps in this guide before inserting data into the cluster.
17+
- A [CockroachDB {{ site.data.products.cloud }} service account]({% link cockroachcloud/managing-access.md %}#manage-service-accounts) and a [CockroachDB Cloud API key]({% link cockroachcloud/managing-access.md %}#create-api-keys) for the service account to authenticate to the CockroachDB Cloud API.
18+
19+
This guide will walk you through creating the necessary cloud identities and encryption keys:
20+
21+
- An IAM role in your AWS account, a cross-tenant service account in your GCP project, or admin consent for CockroachDB Cloud to access your Azure Key Vault. CockroachDB Cloud will use this identity to encrypt and decrypt using the CMEK.
22+
- A CMEK key for your cluster stored in AWS KMS, GCP KMS, or Azure Key Vault. CockroachDB Cloud never has access to the CMEK itself. You can use an existing key or create a new one following the instructions in this guide.
2023

2124
## Enable CMEK
2225

@@ -25,14 +28,15 @@ This section shows how to enable CMEK on a CockroachDB {{ site.data.products.adv
2528
<div class="filters clearfix">
2629
<button class="filter-button" data-scope="aws">AWS</button>
2730
<button class="filter-button" data-scope="gcp">GCP</button>
31+
<button class="filter-button" data-scope="azure">Azure</button>
2832
</div>
2933

3034
### Before you begin
3135

3236
<section class="filter-content" markdown="1" data-scope="aws">
3337

3438
1. Make a note of your {{ site.data.products.cloud }} organization ID in the [Organization settings page](https://cockroachlabs.cloud/settings).
35-
1. Find your {{ site.data.products.advanced }} cluster's ID. From the CockroachDB {{ site.data.products.cloud }} console [Clusters list](https://cockroachlabs.cloud/clusters), click the name of a cluster to open its **Cluster Overview** page. From the page's URL make a note of the **last 12 digits** of the portion of the URL before `/overview/`. This is the cluster ID.
39+
1. Find your CockroachDB {{ site.data.products.advanced }} cluster's ID. From the CockroachDB {{ site.data.products.cloud }} console [Clusters list](https://cockroachlabs.cloud/clusters), click the name of a cluster to open its **Cluster Overview** page. From the page's URL make a note of the **last 12 digits** of the portion of the URL before `/overview/`. This is the cluster ID.
3640
1. Use the cluster ID to find the cluster's associated cross-account IAM role, which is managed by CockroachDB {{ site.data.products.cloud }}.
3741
{% include_cached copy-clipboard.html %}
3842
~~~shell
@@ -48,7 +52,7 @@ This section shows how to enable CMEK on a CockroachDB {{ site.data.products.adv
4852
<section class="filter-content" markdown="1" data-scope="gcp">
4953

5054
1. Make a note of your {{ site.data.products.cloud }} organization ID in the [Organization settings page](https://cockroachlabs.cloud/settings).
51-
1. Find your {{ site.data.products.advanced }} cluster's ID. From the CockroachDB {{ site.data.products.cloud }} console [Clusters list](https://cockroachlabs.cloud/clusters), click the name of a cluster to open its **Cluster Overview** page. From the page's URL make a note of the **last 12 digits** of the portion of the URL before `/overview/`. This is the cluster ID.
55+
1. Find your CockroachDB {{ site.data.products.advanced }} cluster's ID. From the CockroachDB {{ site.data.products.cloud }} console [Clusters list](https://cockroachlabs.cloud/clusters), click the name of a cluster to open its **Cluster Overview** page. From the page's URL make a note of the **last 12 digits** of the portion of the URL before `/overview/`. This is the cluster ID.
5256
1. Use the cluster ID to find the cluster's associated GCP Project ID, which is managed by CockroachDB {{ site.data.products.cloud }}. Query the `clusters/` endpoint of the CockroachDB {{ site.data.products.cloud }} API:
5357
5458
{% include_cached copy-clipboard.html %}
@@ -106,6 +110,13 @@ This section shows how to enable CMEK on a CockroachDB {{ site.data.products.adv
106110
~~~
107111
</section>
108112

113+
<section class="filter-content" markdown="1" data-scope="azure">
114+
115+
1. Find your CockroachDB {{ site.data.products.advanced }} cluster's ID. From the CockroachDB {{ site.data.products.cloud }} console [Clusters list](https://cockroachlabs.cloud/clusters), click the name of a cluster to open its **Cluster Overview** page. From the page's URL make a note of the part of the URL between `cluster/` and `/overview`. This is the cluster ID.
116+
1. Make a note of your Azure tenant ID. You can find this in the Azure portal under **Azure Active Directory** > **Overview** > **Tenant information**.
117+
118+
</section>
119+
109120
<section class="filter-content" markdown="1" data-scope="aws">
110121

111122
### Step 1. Provision the cross-account IAM role
@@ -140,12 +151,47 @@ Follow these steps to create a cross-account IAM role and give it permission to
140151
1. In the GCP Console, visit the [IAM service accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts) for your project and click **+ Create service account**. Select **Cross-tenant**.
141152
1. Click the new service account to open its details.
142153
1. In **PERMISSIONS**, click **GRANT ACCESS**.
143-
- For **New principals**, enter the service account ID for your cluster, which you found in [Before you begin](#before-you-begin)
154+
- For **New principals**, enter the service account ID for your cluster, which you found in [Before you begin](#before-you-begin),
144155
- For **Role**, enter **Service Account Token Creator**.
145156

146-
Click **SAVE**.
157+
Click **SAVE**.
147158
1. Make a note of the email address for the new service account.
148159

160+
</section>
161+
162+
<section class="filter-content" markdown="1" data-scope="azure">
163+
164+
### Step 1. Set up Azure identity and permissions
165+
166+
1. Use the CockroachDB Cloud API to get your cluster's identity ID:
167+
168+
{% include_cached copy-clipboard.html %}
169+
~~~shell
170+
CLUSTER_ID= #{ your cluster ID }
171+
API_KEY= #{ your API key }
172+
curl --request GET \
173+
--url https://cockroachlabs.cloud/api/v1/clusters/${CLUSTER_ID} \
174+
--header "Authorization: Bearer ${API_KEY}"
175+
~~~
176+
177+
1. In the response, find the `azure_cluster_identity_client_id` field and store its value for a future step.
178+
179+
1. Navigate to the following URL in your browser, replacing the placeholders with your values:
180+
181+
~~~text
182+
https://login.microsoftonline.com/{YOUR_TENANT_ID}/adminconsent?client_id={CLUSTER_IDENTITY_ID}
183+
~~~
184+
185+
1. Sign in with your Azure administrator credentials.
186+
1. Review the requested permissions ("Sign in and read user profile") and click **Accept**.
187+
188+
This creates an enterprise application in your Azure tenant that CockroachDB Cloud can use to access your Key Vault. It is named using the following format:
189+
190+
~~~
191+
CockroachDB Cloud - <CLUSTER_ID>
192+
~~~
193+
194+
149195
</section>
150196
151197
### Step 2. Create the CMEK key
@@ -154,7 +200,7 @@ If you intend to use an existing key as the CMEK, skip this step.
154200
155201
<section class="filter-content" markdown="1" data-scope="aws">
156202
157-
You can create the CMEK directly in the AWS Console or using [HashiCorp Vault]({% link {{site.current_cloud_version}}/hashicorp-integration.md %}).
203+
You can create the CMEK directly in the AWS Console or using <a href="https://www.cockroachlabs.com/docs/stable/hashicorp-integration">HashiCorp Vault</a>.
158204
159205
<div class="filters clearfix">
160206
<button class="filter-button" data-scope="aws-console">AWS Console</button>
@@ -264,7 +310,7 @@ You can create the CMEK directly in the AWS Console or using [HashiCorp Vault]({
264310
265311
<section class="filter-content" markdown="1" data-scope="gcp">
266312
267-
You can create the CMEK directly in the GCP Console or using [HashiCorp Vault]({% link {{site.current_cloud_version}}/hashicorp-integration.md %}).
313+
You can create the CMEK directly in the GCP Console or using <a href="https://www.cockroachlabs.com/docs/stable/hashicorp-integration">HashiCorp Vault</a>.
268314
269315
<div class="filters clearfix">
270316
<button class="filter-button" data-scope="gcp-console">GCP Console</button>
@@ -335,6 +381,28 @@ Make a note of the key ring name.
335381
</section>
336382
</section>
337383

384+
<section class="filter-content" markdown="1" data-scope="azure">
385+
386+
For these instructions, you can use an existing Azure Key Vault, or create a new key vault using the [Azure portal](https://learn.microsoft.com/en-us/azure/key-vault/general/quick-create-portal) or [CLI](https://learn.microsoft.com/en-us/azure/key-vault/general/quick-create-cli).
387+
388+
1. In the Azure portal, navigate to your Key Vault.
389+
1. On the Key Vault left-hand sidebar, select **Objects** then select **Keys**.
390+
1. **Select + Generate/Import**.
391+
1. Enter a **Name** for the key, and click **Create**.
392+
1. Click the key name, and under Current Version, click the key.
393+
1. In the **Key Identifier** field, click the copy button. The URL will use the following format. Store it for a future step.
394+
395+
~~~text
396+
https://<keyVaultName>.vault.azure.net/keys/<keyName>/<version>
397+
~~~
398+
399+
1. Navigate to your Key Vault > **Access control (IAM)** > **Add role assignment**.
400+
1. Select the **Key Vault Crypto Officer** role, and select the option to assign access to **User, group, or service principal**.
401+
1. Click **Select members**, then search for the enterprise application created above: `CockroachDB Cloud - <CLUSTER_ID>`.
402+
403+
</section>
404+
</section>
405+
338406
### Step 3. Build your CMEK configuration manifest
339407

340408
Compile the information about the service account and key we've just created into a manifest, which you will use to activate CMEK on your cluster with the CockroachDB {{ site.data.products.cloud }} API.
@@ -367,7 +435,6 @@ Compile the information about the service account and key we've just created int
367435
]
368436
}
369437
~~~
370-
</section>
371438
372439
</section>
373440
@@ -408,6 +475,33 @@ Compile the information about the service account and key we've just created int
408475
409476
</section>
410477
478+
<section class="filter-content" markdown="1" data-scope="azure">
479+
480+
1. Create a new file named `cmek_config.json` with the following contents. Replace the placeholder values, being careful to include one `region_spec` object per cluster region. When enabling CMEK, you must include a `region_spec` for each region in the cluster.
481+
482+
{% include_cached copy-clipboard.html %}
483+
~~~ json
484+
{
485+
"region_specs": [
486+
{
487+
"region": "{COCKROACHDB_CLOUD_REGION}",
488+
"key_spec": {
489+
"type": "AZURE_KEY_VAULT",
490+
"uri": "{YOUR_KEY_IDENTIFIER_URL}",
491+
"auth_principal": "{YOUR_TENANT_ID}"
492+
}
493+
}
494+
]
495+
}
496+
~~~
497+
498+
Replace the placeholder values:
499+
- `{COCKROACHDB_CLOUD_REGION}`: Your cluster's region (e.g., "centralindia")
500+
- `{YOUR_KEY_IDENTIFIER_URL}`: The Key Identifier URL you copied in Step 2
501+
- `{YOUR_TENANT_ID}`: Your Azure tenant ID
502+
503+
</section>
504+
411505
1. Use the shell utility JQ to inspect JSON payload:
412506

413507
{{site.data.alerts.callout_info}}
@@ -419,7 +513,7 @@ Compile the information about the service account and key we've just created int
419513
cat cmek_config.json | jq
420514
~~~
421515

422-
After you have built your CMEK configuration manifest with the details of your cluster and provisioned the service account and KMS key in GCP, return to [Enabling CMEK for a CockroachDB {{ site.data.products.advanced }} cluster]({% link cockroachcloud/managing-cmek.md %}#step-4-activate-cmek).
516+
After you have built your CMEK configuration manifest with the details of your cluster and provisioned the necessary cloud identity and encryption key, proceed to Step 4.
423517

424518
### Step 4. Activate CMEK
425519

0 commit comments

Comments
 (0)