Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the issue of Bigtable Cluster Tables not being encrypted with Customer Managed Keys in GCP, follow the below steps:
  1. Open the Google Cloud Console and navigate to the Bigtable instance that you want to remediate.
  2. Click on the “Encryption” tab from the left-hand side menu.
  3. Under the “Encryption at rest” section, click on the “Edit” button.
  4. Select “Customer-managed key” as the encryption type.
  5. Click on the “Select key” button and choose an existing key or create a new one.
  6. Click on the “Save” button to apply the changes.
  7. Once the encryption type is updated, you need to enable the encryption for each table in the Bigtable cluster.
  8. Click on the “Tables” tab from the left-hand side menu and select the table that you want to encrypt.
  9. Click on the “Edit” button and select “Customer-managed key” as the encryption type.
  10. Click on the “Select key” button and choose the same key that you selected in step 5.
  11. Click on the “Save” button to apply the changes.
  12. Repeat steps 8-11 for each table in the Bigtable cluster.
By following the above steps, you can remediate the issue of Bigtable Cluster Tables not being encrypted with Customer Managed Keys in GCP.

To remediate this misconfiguration, you can follow the below steps:
  1. Open the Cloud Shell in your GCP console.
  2. Run the following command to check if the Bigtable cluster tables are encrypted with customer-managed keys:
    Replace [TABLE_ID], [CLUSTER_ID], [PROJECT_ID], and [INSTANCE_ID] with the actual values.
  3. If the output shows that the tables are not encrypted with customer-managed keys, then you need to create a new key ring and key for encryption. Run the following commands to create a new key ring and key:
    Replace [KEYRING_NAME], [LOCATION], [PROJECT_ID], and [KEY_NAME] with the actual values.
  4. After creating the key ring and key, you need to set the encryption for the Bigtable cluster tables. Run the following command to set the encryption:
    Replace [TABLE_ID], [CLUSTER_ID], [PROJECT_ID], [INSTANCE_ID], [SERVICE_ACCOUNT_EMAIL], and [KEY_NAME] with the actual values.
  5. Verify that the tables are now encrypted with the customer-managed keys by running the following command again:
    The output should show that the tables are now encrypted with the customer-managed keys.
By following these steps, you can remediate the misconfiguration in GCP using GCP CLI.
To remediate the misconfiguration “Bigtable Cluster Tables Should Be Encrypted With Customer Managed Keys” in GCP using Python, follow these steps:
  1. Open the Cloud Shell in the GCP Console.
  2. Install the Google Cloud Bigtable Python client library by running the following command:
  1. Create a new key ring in the Cloud Key Management Service (KMS) by running the following command:
Replace <key-ring-name> with the name of your key ring and <location> with the location where you want to store the key ring.
  1. Create a new key in the key ring by running the following command:
Replace <key-name> with the name of your key.
  1. Enable the Cloud Bigtable API by running the following command:
  1. Use the following Python script to update the encryption configuration of your Bigtable cluster tables to use customer-managed keys:
Replace the placeholders with your own project ID, instance ID, cluster ID, location ID, key ring name, and key name.
  1. Run the Python script to update the encryption configuration of your Bigtable cluster tables to use customer-managed keys.
After completing these steps, your Bigtable cluster tables will be encrypted with customer-managed keys.
Bigtable CMEK is configured on the cluster (via kms_key_name), not on the table itself; all tables in that cluster are then encrypted with the customer-managed key. Changing kms_key_name on an existing cluster forces its replacement, which is effectively a data‑migration event and must be planned carefully.To verify in Terraform, terraform plan should show the google_bigtable_instance cluster being created with kms_key_name = google_kms_crypto_key.bigtable_cmek.id (or the cluster being replaced to add this field), and the table resource continuing to reference that instance.