Rotating service account keys

Rotate the key of the Cloudera Cloud Factory service account periodically by creating a new key, uploading it to Cloudera Cloud Factory, and deleting the old key, without downtime for your clusters.

  • Ensure that you have permissions to create and delete service account keys in the service project.
  • Ensure that you have permission to update cloud credentials in Cloudera Cloud Factory.
  1. Set the email address of the Cloudera Cloud Factory service account:
    export CCF_SA="[***SERVICE ACCOUNT EMAIL***]"
  2. Create a new key:
    gcloud iam service-accounts keys create config-new.json \
      --iam-account="$CCF_SA"
  3. Upload the config-new.json file to the Google Cloud credential in Cloudera Cloud Factory.
  4. Verify that cluster operations still work.
  5. List the existing keys, and note the ID of the old key:
    gcloud iam service-accounts keys list \
      --iam-account="$CCF_SA"
  6. Delete the old key:
    export OLD_KEY_ID="[***OLD KEY ID***]"
    
    gcloud iam service-accounts keys delete "$OLD_KEY_ID" \
      --iam-account="$CCF_SA"

Cloudera Cloud Factory authenticates with the new key, and the old key no longer grants access to the service project.