Other Articles

IAM Users – Rotate External User-Managed Service Account Keys

This check ensures that external (user-managed) service account keys are rotated regularly. Any user-managed key older than 90 days must be deleted and replaced with a newly generated key to reduce the risk of credential compromise.

Check Details

  • Resource: Service Accounts
  • Check: Rotate external (user-managed) service account keys
  • Risk: User-managed service account keys that are not rotated regularly may be exposed, reused, or compromised, leading to unauthorized access to GCP resources.

Remediation via Google Cloud Console

  1. Go to APIs & Services → Credentials. APIs and Services Credentials
  2. In the Service Account Keys section, identify all external (user-managed) service account keys.
  3. For every external (user-managed) service account key with a creation date greater than or equal to the past 90 days, click the Delete (bin) icon to delete the key. Service Account Keys
  4. To create a new external (user-managed) service account key, click Create Credentials and select Service Account Key. Service Account Keys Creation
  5. Choose the required Service Account from the drop-down list.
  6. Select the desired key type format (JSON or P12).
  7. Click Create. The private key will be downloaded. Store it securely. Service Account Keys Download
  8. Click Close if prompted.
  9. After redirection to the APIs & Services → Credentials page, make a note of the new key ID displayed in the Service Account Keys section.

Default Value

GCP does not provide an automation option for external (user-managed) service account key rotation. Keys must be rotated manually by deleting old keys and creating new ones.