Ensure GCP Big Query Tables are encrypted with Customer Supplied Encryption Keys (CSEK)

Error: GCP Big Query Tables are not encrypted with Customer Supplied Encryption Keys (CSEK)

Bridgecrew Policy ID: BC_GCP_GENERAL_27
Checkov Check ID: CKV_GCP_80
Severity: LOW

GCP Big Query Tables are not encrypted with Customer Supplied Encryption Keys (CSEK)

Description

Customer-Supplied Encryption Keys (CSEK) are a feature in Google Cloud Storage and Google Compute Engine. Google Compute Engine encrypts all data at rest by default. Compute Engine handles and manages this encryption automatically, with no additional action required. When you provide your own encryption keys Compute Engine uses your key to protect the Google-generated keys used to encrypt and decrypt your data. Only users that provide the correct key can use resources protected by a customer-supplied encryption key. Google does not store your keys on its servers and cannot access your protected data unless you provide the key. If you forget or lose your key Google is unable to recover the key or to recover any data encrypted with that key. To control and manage this encryption yourself, you must provide your own encryption keys.

We recommend you supply your own encryption keys for Google to use, at a minimum to encrypt business critical Big Query Tables. This helps protect the Google-generated keys used to encrypt and decrypt your data.

Fix - Runtime

TBD

Fix - Buildtime

  • Resource: google_bigquery_table
  • Arguments: encryption_configuration.kms_key_name
resource "google_bigquery_table" "pass" {
  dataset_id = google_bigquery_dataset.default.dataset_id
  table_id   = "sheet"

  external_data_configuration {
    autodetect    = true
    source_format = "GOOGLE_SHEETS"

    google_sheets_options {
      skip_leading_rows = 1
    }

    source_uris = [
      "https://docs.google.com/spreadsheets/d/123456789012345",
    ]
  }

  encryption_configuration {
    kms_key_name = var.kms_key_name
  }
}

Did this page help you?