Skip to main content

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Ensure Default CMEK Is Specified For BigQuery Data Sets” in GCP using GCP Console, you can follow the below steps:
  1. Open the BigQuery console in the GCP Console.
  2. In the navigation pane, select the dataset for which you want to set the default CMEK.
  3. Click on the “Edit” button (pencil icon) next to the dataset name.
  4. In the “Encryption” section, click on the “Change” button next to the “Default encryption” option.
  5. In the “Default encryption” dialog box, select the checkbox “Use a customer-managed key (CMEK)”.
  6. Select the appropriate key from the dropdown list or create a new key.
  7. Click on the “Save” button to save the changes.
  8. Repeat the above steps for all the datasets that need to be remediated.
By following the above steps, you can ensure that the default CMEK is specified for BigQuery datasets in GCP, and remediate the misconfiguration.

To remediate the misconfiguration “Ensure Default CMEK Is Specified For BigQuery Data Sets” for GCP using GCP CLI, follow the below steps:
  1. Open the Cloud Shell in the GCP console.
  2. Run the following command to list all the BigQuery datasets in the project:
  1. Identify the dataset for which you want to set the default CMEK.
  2. Run the following command to set the default CMEK for the identified dataset:
Replace <KMS_KEY_ID> with the ID of the KMS key that you want to use as the default CMEK for the dataset and <DATASET_NAME> with the name of the dataset that you identified in step 3.
  1. Verify that the default CMEK has been set for the dataset by running the following command:
This will display the details of the dataset, including the default CMEK that has been set.
  1. Repeat steps 3 to 5 for all the BigQuery datasets in the project to ensure that the default CMEK is specified for all the datasets.
By following the above steps, you can remediate the misconfiguration “Ensure Default CMEK Is Specified For BigQuery Data Sets” for GCP using GCP CLI.
To remediate the misconfiguration “Ensure Default CMEK Is Specified For BigQuery Data Sets” in GCP using Python, you can follow the below steps:
  1. First, you need to create a Key Management Service (KMS) key ring and key in the same region as your BigQuery dataset.
  1. Next, you need to set the default encryption key for your BigQuery dataset using the KMS key you created in step 1.
  1. Finally, you need to verify that the default encryption key is set for your BigQuery dataset.
By following these steps, you can remediate the misconfiguration “Ensure Default CMEK Is Specified For BigQuery Data Sets” in GCP using Python.
Changing default_encryption_configuration.kms_key_name is an in‑place update for existing datasets (no dataset replacement), but BigQuery will not retroactively re‑encrypt existing tables; it only affects new tables created without an explicit key.To verify, terraform plan should show either creation of the dataset with default_encryption_configuration.kms_key_name set, or an in‑place update adding or changing that field on the existing google_bigquery_dataset resource.