Utilizzo della crittografia dei secret sempre attiva
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
La versione 1.10 di Google Distributed Cloud supporta la crittografia dei secret senza bisogno di un KMS (Key Management Service) esterno o di altre dipendenze.
Tieni presente la seguente limitazione dei cluster avanzati:
Versione 1.31: la crittografia dei secret sempre attiva non è supportata nei
cluster avanzati.
Versione 1.32 e successive: la crittografia sempre attiva è supportata nei cluster avanzati.
Abilita la crittografia dei secret sempre attiva
La crittografia dei secret sempre attiva funziona generando automaticamente una chiave di crittografia utilizzata per criptare i secret prima che vengano archiviati nel database etcd per il cluster. I secret vengono criptati utilizzando una chiave di crittografia dei dati (DEK) generata per ogni scrittura di secret. Questa DEK viene utilizzata in modalità AES-GCM per criptare l'oggetto Secret. La DEK viene a sua volta criptata con una chiave di crittografia della chiave (KEK). L'algoritmo di crittografia è A256GCM (AES GCM con chiave a 256 bit).
La versione della chiave è un numero di versione che indica la chiave attualmente in uso.
Puoi attivare la crittografia dei secret dopo aver già creato un cluster.
ADMIN_KUBECONFIG con il percorso del file kubeconfig del cluster di amministrazione.
ADMIN_CLUSTER_CONFIG con il percorso del file di configurazione del cluster di amministrazione.
USER_CLUSTER_CONFIG con il percorso del file di configurazione del cluster utente.
I comandi gkectl update forniti in questa sezione possono essere utilizzati anche per qualsiasi altro aggiornamento del cluster corrispondente.
Archiviazione delle chiavi
Le chiavi di crittografia per il cluster di amministrazione vengono archiviate sul disco di dati del cluster di amministrazione. Questo disco è montato sulla macchina principale dell'amministratore in /opt/data e le chiavi di crittografia si trovano in /opt/data/gke-k8s-kms-plugin/generatedkeys/. È necessario eseguire il backup di queste chiavi per mantenere l'accesso ai secret criptati utilizzati dalla chiave. Devi attivare la crittografia della VM/dell'archiviazione nell'hypervisor o misure simili per assicurarti che i dischi VM del piano di controllo siano protetti.
Rotazione chiave
Per ruotare una chiave di crittografia esistente per un cluster, incrementa keyVersion nel file di configurazione del cluster di amministrazione o nel file di configurazione del cluster utente corrispondente ed esegui il comando gkectl update appropriato. Viene creata una nuova chiave corrispondente al nuovo numero di versione, viene sottoposta a nuova crittografia ogni secret e viene cancellata in modo sicuro quella precedente. Tutti i nuovi secret successivi vengono criptati utilizzando la nuova chiave di crittografia.
Disattiva la crittografia dei secret sempre attiva
Per disattivare la crittografia dei secret in un cluster esistente, aggiungi un campo disabled: true. Quindi, esegui il comando gkectl update corrispondente. Questo aggiornamento decripta ogni secret esistente e lo memorizza in testo normale. Tutti i nuovi secret successivi vengono archiviati in testo non criptato.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["Google Distributed Cloud version 1.10 supports encrypting secrets without the need for\nan external KMS (Key Management Service), or any other dependencies.\n\nNote the following limitation with advanced clusters:\n\n- Version 1.31: always-on secrets encryption isn't supported on [advanced clusters](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#enable-advanced-cluster-field).\n- Version 1.32 and higher: always-on encryption is supported on advanced clusters.\n\nEnable always-on secrets encryption\n\nAlways-on secrets encryption works by automatically generating an encryption key that is used to encrypt secrets before they are stored on the etcd database for that cluster. The secrets are encrypted using a Data Encryption Key (DEK) generated for every Secret write. This DEK is used in AES-GCM mode to encrypt the Secret object. The DEK is in turn encrypted with a Key Encrypting Key (KEK). The encryption algorithm is A256GCM (AES GCM using 256-bit key).\n\nThe key version is a version number to indicate the key currently in use.\n\nYou can enable secrets encryption after a cluster has already been created.\n\n- For the admin cluster:\n\n 1. Edit the [admin cluster configuration file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#secretsencryption-section) to add the `secretsEncryption` section.\n\n 2. Run the `gkectl update` command.\n\n ```\n gkectl update admin --config ADMIN_CLUSTER_CONFIG_FILE --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n- For a user cluster:\n\n 1. Edit the [user cluster configuration file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#secretsencryption-section) to add the `secretsEncryption` section.\n\n 2. Run the `gkectl update` command.\n\n ```\n gkectl update cluster --config USER_CONFIG_FILE --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n\nReplace the following:\n\n- `ADMIN_KUBECONFIG` with the path of your admin cluster kubeconfig file.\n- `ADMIN_CLUSTER_CONFIG` with the path of your admin cluster configuration file.\n- `USER_CLUSTER_CONFIG` with the path of your user cluster configuration file.\n\nThe `gkectl update` commands provided in this section can also be used for any other updates to the corresponding cluster.\n\nKey storage\n\nThe encryption keys for the admin cluster are stored on the admin cluster data disk. This disk is mounted on the admin master machine at /opt/data, and the encryption keys can be found at /opt/data/gke-k8s-kms-plugin/generatedkeys/. These keys must be backed up to retain access to the encrypted secrets used by that key. You should enable [VM/storage encryption in the hypervisor](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.security.doc/GUID-5E2C3F74-38C1-44C3-ABC5-C2C9353B9DC4.html) or similar measures to ensure that the control plane VM disks are protected.\n\nKey rotation\n\nTo rotate an existing encryption key for a cluster, increment the `keyVersion` in the corresponding [admin cluster configuration file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/admin-cluster-configuration-file-latest#secretsencryption-generatedkey-version-field) or [user cluster configuration file](/kubernetes-engine/distributed-cloud/vmware/docs/how-to/user-cluster-configuration-file-latest#secretsencryption-generatedkey-version-field), and run the appropriate `gkectl update` command. This creates a new key matching the new version number, re-encrypts each secret, and securely erases the old one. All subsequent new secrets are encrypted using the new encryption key.\n\nDisable always-on secrets encryption\n\nTo disable secrets encryption on an existing cluster, add a `disabled: true` field. Next, run the corresponding `gkectl update` command. This update decrypts each existing secret and stores each secret in plain text. All subsequent new secrets are stored in plain text.\n\n```\nsecretsEncryption:\n mode: GeneratedKey\n generatedKey:\n keyVersion: KEY_VERSION\n disabled: true\n```"]]