| name | cis-gke-autopilot-v120-5.3.1 |
| description | Ensure Kubernetes Secrets are encrypted using keys managed in Cloud KMS (Automated) |
| category | cis-gke-autopilot |
| version | 1.2.0 |
| author | cyberstrike-official |
| tags | ["cis","gke-autopilot","kubernetes","gcp","kms","encryption","cmek"] |
| cis_id | 5.3.1 |
| cis_benchmark | CIS Google Kubernetes Engine (GKE) Autopilot Benchmark v1.2.0 |
| tech_stack | ["kubernetes","gcp","gke"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.3.1 Ensure Kubernetes Secrets are encrypted using keys managed in Cloud KMS (Automated)
Profile Applicability
Description
Encrypt Kubernetes secrets, stored in etcd, at the application-layer using a customer-managed key in Cloud KMS.
Rationale
By default, GKE encrypts customer content stored at rest, including Secrets. GKE handles and manages this default encryption for you without any additional action on your part.
Application-layer Secrets Encryption provides an additional layer of security for sensitive data, such as user defined Secrets and Secrets required for the operation of the cluster, such as service account keys, which are all stored in etcd.
Using this functionality, you can use a key, that you manage in Cloud KMS, to encrypt data at the application layer. This protects against attackers in the event that they manage to gain access to etcd.
Impact
To use the Cloud KMS CryptoKey to protect etcd in the cluster, the 'Kubernetes Engine Service Agent' Service account must hold the 'Cloud KMS CryptoKey Encrypter/Decrypter' role.
Audit
Using Google Cloud Console:
- Go to Kubernetes Engine by visiting https://console.cloud.google.com/kubernetes/list
- From the list of clusters, click on each cluster to bring up the Details pane, and ensure Application-layer Secrets Encryption is set to 'Enabled'.
Using Command Line:
gcloud container clusters describe $CLUSTER_NAME --zone $COMPUTE_ZONE --format json | jq '.databaseEncryption'
If configured correctly, the output from the command returns a response containing the following detail:
keyName=projects/<key_project_id>/locations/<location>/keyRings/<ring_name>/cryptoKeys/<key_name>]
state=ENCRYPTED
{
"currentState": "CURRENT_STATE_ENCRYPTED",
"keyName": "projects/<key_project_id>/locations/us-central1/keyRings/<ring_name>/cryptoKeys/<key_name>",
"state": "ENCRYPTED"
}
Remediation
To enable Application-layer Secrets Encryption, several configuration items are required. These include:
- A key ring
- A key
- A GKE service account with
Cloud KMS CryptoKey Encrypter/Decrypter role
Once these are created, Application-layer Secrets Encryption can be enabled on an existing or new cluster.
Using Google Cloud Console:
To create a key: