Other Articles

IAM Users – Enforce GCP-Managed Keys

This check ensures that only GCP-managed keys are used for service accounts. Enforcing GCP-managed keys helps prevent key leakage, simplifies key rotation, and improves overall access security.

Check Details

  • Resource: Service Accounts
  • Check: Enforce GCP-managed keys
  • Risk: User-managed service account keys can be copied, leaked, or remain active indefinitely, increasing the risk of unauthorized access and credential compromise.

Remediation via Google Cloud Console

  1. Log in to the Google Cloud Console and navigate to IAM & Admin. IAM Overview
  2. Click on Service Accounts.
  3. All service accounts and their corresponding keys are listed. IAM Service Account
  4. Click the service account. Service Account Keys
  5. Click Actions and delete the keys.
  6. Ensure only Google-managed keys remain enabled.

Remediation via Google Cloud CLI

  1. Open the Google Cloud Console and launch Cloud Shell. GCP Cloud Shell
  2. Delete a user-managed service account key:
    
    
    gcloud iam service-accounts keys delete KEY_ID \
     --iam-account=SERVICE_ACCOUNT_EMAIL
    

Default Value

By default, service accounts can have both Google-managed and user-managed keys. User-managed keys remain active until explicitly deleted.