More Info:

Service account keys should be rotated periodically.

Risk Level

High

Address

Security

Compliance Standards

CISGCP, CBP

Triage and Remediation

Remediation

To remediate the misconfiguration “Service Account Keys Should Be Rotated” for GCP using GCP console, follow the steps below:

  1. Login to the Google Cloud Console using your credentials.
  2. Navigate to the IAM & Admin page from the left-hand menu.
  3. Click on Service Accounts from the list of options.
  4. Select the service account for which you want to rotate the keys.
  5. Click on the Edit button for the selected service account.
  6. Scroll down to the Keys section and click on the Add Key button.
  7. Select the type of key you want to add from the dropdown list.
  8. Click on the Create button to generate the new key.
  9. Once the new key is created, download it and store it securely.
  10. Delete the old key(s) that are no longer required.

By following these steps, you have successfully rotated the service account keys for your GCP project. Make sure to repeat this process periodically to keep your service account keys up to date.