Skip to main content

More Info:

Ensures Customer Supplied Encryption Key is enabled on disks. Google encrypts all disks at rest by default. By using CSEK only authorized team members with the keys can access the disk. Anyone else, including Google, cannot access the disk data.

Risk Level

High

Address

Security

Compliance Standards

CISGCP, CBP, HITRUST, SOC2, GDPR, NISTCSF, PCIDSS

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Customer Supplied Encryption Key Should Be Enabled For Disks” for GCP using GCP console, please follow the below steps:
  1. Open the GCP Console and select the project for which you want to enable Customer Supplied Encryption Key.
  2. In the left navigation menu, select “Compute Engine” and then select “Disks”.
  3. Select the disk for which you want to enable Customer Supplied Encryption Key.
  4. Click on “Edit” at the top of the page.
  5. In the Encryption section, select “Customer-supplied encryption key”.
  6. Enter the 256-bit encryption key in the “Key” field.
  7. Click on “Save” to save the changes.
Once you have completed the above steps, the disk will be encrypted using the customer-supplied encryption key. It is recommended to create a backup of the encryption key and store it in a secure location, as it will be required to access the data on the disk.

To remediate the “Customer Supplied Encryption Key Should Be Enabled For Disks” misconfiguration in GCP using GCP CLI, you can follow the below steps:
  1. Open the Cloud Shell in your GCP console.
  2. Run the following command to check if the customer-supplied encryption key is enabled for the disks:
    Replace [DISK_NAME] with the name of the disk that you want to check and [ZONE] with the zone in which the disk is located.
  3. If the output of the previous command is “False”, then the customer-supplied encryption key is not enabled for the disk. To enable it, run the following command:
    Replace [DISK_NAME] with the name of the disk that you want to encrypt and [ZONE] with the zone in which the disk is located. Replace [USER_EMAIL] with the email address of the user who will be able to encrypt and decrypt the disk.
  4. After running the above command, the customer-supplied encryption key will be enabled for the disk. You can verify it by running the following command:
    The output of the above command should be “True”, indicating that the customer-supplied encryption key is enabled for the disk.
By following the above steps, you can remediate the “Customer Supplied Encryption Key Should Be Enabled For Disks” misconfiguration in GCP using GCP CLI.
To remediate the misconfiguration “Customer Supplied Encryption Key Should Be Enabled For Disks” in GCP using Python, you can follow the below steps:Step 1: Install the required packages
Step 2: Authenticate to GCP
Step 3: Import the required libraries
Step 4: Create a service account and grant it the required permissions
Step 5: Create a function to enable customer-supplied encryption key for disks
Step 6: Call the function to enable customer-supplied encryption key for the disk
Note: Replace the placeholders <project-id>, <zone>, <instance-name>, <disk-name>, and <encryption-key> with the actual values for your GCP project.

Additional Reading: