Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Si tu clave raíz se ve comprometida o si decides rotar las claves raíz de forma periódica, puedes rotar tus claves a una nueva clave raíz con el recurso RotationJob.
El rol de administrador de trabajos de rotación de KMS Para obtener los permisos que necesitas para rotar claves, pídele al administrador de IAM de tu organización que te otorgue el rol de administrador de trabajos de rotación de KMS (kms-rotationjob-admin).
Rota una clave raíz
Para crear una clave raíz nueva y rotar tus claves, completa los siguientes pasos:
Crea un archivo YAML y agrega el recurso RotationJob y el siguiente contenido:
Reemplaza ROTATION_NAME por un nombre para el trabajo de rotación, rotate-job1, por ejemplo.
Reemplaza ROOT_KEY_RESOURCE_NAME por el nombre de la clave raíz especificado en el formulario namespace/NAMESPACE/secrets/ROOT_KEY_NAME.
Por ejemplo, namespaces/kms-system/secrets/ctm-root.
Aplica el contenido del archivo YAML al KMS:
kubectlapply-fFILENAME.yaml
Reemplaza FILENAME por el nombre del archivo YAML.
Después de ejecutar el comando, el KMS crea una clave raíz nueva y rota cada clave con la nueva clave raíz.
Para verificar que se completó la rotación de claves raíz, ejecuta el siguiente comando:
kubectlgetrotationjobsROTATION_NAME
Reemplaza ROTATION_NAME por el nombre del trabajo de rotación.
Después de ejecutar el comando, verás el estado del trabajo de rotación como Completed si se realizó correctamente.
Quita la anotación Done de la clave raíz. Quitar la anotación te permite rotar la llave más de una vez. Tu operador de infraestructura (IO) debe realizar este paso. Pídele a tu IO que ejecute lo siguiente:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eRoot keys can be rotated to a new root key using the \u003ccode\u003eRotationJob\u003c/code\u003e resource if the current root key is compromised or needs periodic rotation.\u003c/p\u003e\n"],["\u003cp\u003eBefore rotating root keys, you must have \u003ccode\u003ekubectl\u003c/code\u003e configured to access the Management API server and possess the KMS Rotation Job Admin role.\u003c/p\u003e\n"],["\u003cp\u003eRotating a root key involves creating a \u003ccode\u003eRotationJob\u003c/code\u003e resource in a YAML file, applying the file to the KMS, and then verifying the job's completion.\u003c/p\u003e\n"],["\u003cp\u003eAfter a successful rotation, the \u003ccode\u003eDone\u003c/code\u003e annotation must be removed from the root key by an Infrastructure Operator to allow for future rotations.\u003c/p\u003e\n"]]],[],null,["# Rotate a root key\n\nIf your root key becomes compromised, or if you choose to periodically rotate\nroot keys, you can rotate your keys to a new root\nkey using the [`RotationJob`](/distributed-cloud/hosted/docs/latest/gdch/apis/service/kms/kms-api-overview#rotationjob)\nresource.\n\nRefer to the [KMS API overview](/distributed-cloud/hosted/docs/latest/gdch/apis/kms-api-overview) for details\non the KMS API and the [Key Management Service KRM API](/distributed-cloud/hosted/docs/latest/gdch/apis/kms-krm-api)\nto view the full API definition.\n\n### Before you begin\n\nBefore continuing, ensure you have the following:\n\n- The `kubectl` command configured to access the Management API server. To do this,\n [get a kubeconfig file](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-auth#get-kubeconfig)\n using the [gdcloud command-line interface (CLI)](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\n\n- The KMS Rotation Job Admin role. To get the permissions that you need to\n rotate keys, ask your Organization IAM Admin to grant you the KMS Rotation\n Job Admin (`kms-rotationjob-admin`) role.\n\nRotate a root key\n-----------------\n\nTo create a new root key and rotate your keys, complete the following steps:\n\n1. Create a YAML file, and add in the `RotationJob` resource and the following\n contents:\n\n apiVersion: \"kms.gdc.goog/v1\"\n kind: RotationJob\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eROTATION_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n rootKeyResourceName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eROOT_KEY_RESOURCE_NAME\u003c/span\u003e\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eROTATION_NAME\u003c/var\u003e with a name for the rotation job\n --- for example: `rotate-job1`.\n\n Replace \u003cvar translate=\"no\"\u003eROOT_KEY_RESOURCE_NAME\u003c/var\u003e with the root key name\n specified in the form `namespace/`\u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e`/secrets/`\u003cvar translate=\"no\"\u003eROOT_KEY_NAME\u003c/var\u003e\n\n For example, `namespaces/kms-system/secrets/ctm-root`.\n2. Apply the contents of the YAML file to the KMS:\n\n kubectl apply -f \u003cvar translate=\"no\"\u003eFILENAME\u003c/var\u003e.yaml\n\n Replace \u003cvar translate=\"no\"\u003eFILENAME\u003c/var\u003e with the name of the YAML file.\n\n After running the command, the KMS creates a new root key and rotates every\n key with the new root key.\n3. To verify the root key rotation is complete, run the following:\n\n kubectl get rotationjobs \u003cvar translate=\"no\"\u003eROTATION_NAME\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eROTATION_NAME\u003c/var\u003e with the name of the rotation job.\n\n After running the command, you see the status of the rotation job as\n `Completed` if successful.\n4. Remove the `Done` annotation from the root key. Removing the annotation lets\n you rotate the key more than once. Your Infrastructure Operator (IO) must\n perform this step. Ask your IO to run the following:\n\n kubectl annotate secret kms-key-\u003cvar translate=\"no\"\u003eROOT_KEY_NAME\u003c/var\u003e -n kms-system gdch.cluster.gke.io/rotation-status-"]]