Skip to main content

More Info:

Ensure KMS encryption keys are rotated within a period of 90 days.

Risk Level

High

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CIS GCP
  • CIS GCP 2.0.0
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • Cloudanix Best Practice
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • GDPR
  • ISO 27001
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Using Console

Sure, here are the step-by-step instructions to remediate the KMS Encryption Keys Rotation issue in GCP using the GCP console:
  1. Open the Google Cloud Console and select the project in which the KMS key is created.
  2. In the left navigation menu, click on the “Security” option and select “Encryption keys” from the drop-down menu.
  3. Select the KMS key for which you want to enable rotation.
  4. Click on the “Edit” button at the top of the page.
  5. In the “Edit key” dialog box, scroll down to the “Rotation” section.
  6. Toggle the switch for “Automatic key rotation” to “On”.
  7. Set the “Rotation period” to a desired value. It is recommended to rotate the key once a year.
  8. Click on the “Save” button to save the changes.
After completing these steps, the KMS key rotation will be enabled, and the key will be automatically rotated based on the rotation period set by you. This will help to ensure that your encryption keys are updated and secure.

To remediate the KMS Encryption Keys rotation issue in GCP using GCP CLI, you can follow the below steps:
  1. Open the Google Cloud Console and select the project in which you want to remediate the issue.
  2. Open the Cloud Shell by clicking on the icon located at the top right corner of the console.
  3. Run the following command to list all the KMS encryption keys in your project:
  1. Identify the key that needs to be rotated.
  2. Run the following command to rotate the key:
Replace [KEY_NAME], [LOCATION], and [KEYRING_NAME] with the actual values of the key that needs to be rotated.
  1. Confirm the rotation by running the following command:
This command will display the details of the key, including the rotation period.
  1. Repeat steps 5 and 6 for all the KMS encryption keys that need to be rotated.
By following these steps, you will be able to remediate the KMS Encryption Keys rotation issue in GCP using GCP CLI.
To remediate this issue in GCP using Python, you can follow these steps:
  1. Install the necessary libraries:
  1. Authenticate with the GCP project:
  1. Retrieve the list of KMS keys in the project:
  1. For each key, check the creation time and determine if it needs to be rotated:
  1. Finally, delete the old key versions:
Note: Replace project_id, location_id, and key_ring_id with the appropriate values for your GCP project. Also, make sure that the service account used for authentication has the necessary permissions to manage KMS keys.
This config rotates the KMS crypto key every 90 days as required; changing rotation_period and next_rotation_time is in-place and does not force key replacement, but will schedule future key versions.After updating your Terraform, terraform plan should show an in-place update on google_kms_crypto_key.EXISTING_CRYPTO_KEY changing rotation_period (and next_rotation_time if set), with no -/+ replacement.