🛡️ Google IAM Service Account User-Managed Key is not rotated every 90 days🟢
- Contextual name: 🛡️ Service Account User-Managed Key is not rotated every 90 days🟢
- ID:
/ce/ca/google/iam/service-account-key-rotation - Tags:
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Stats
not available
Logic
Similar Policies
- Cloud Conformity: Rotate User-Managed Service Account Keys
Description
Description
Service Account keys consist of a key ID (Private_key_Id) and Private key, which are used to sign programmatic requests users make to Google Cloud services accessible to that particular service account. It is recommended that all Service Account keys are regularly rotated.
Rationale
Rotating Service Account keys will reduce the window of opportunity for an access key that is associated with a compromised or terminated account to be used. Service Account keys should be rotated to ensure that data cannot be accessed with an old key that might have been lost, cracked, or stolen.
Each service account is associated with a key pair managed by Google Cloud Platform (GCP). It is used for service-to-service authentication within GCP. Google rotates the keys daily.
GCP provides the option to create one or more user-managed (also called external key pairs) key pairs for use from outside GCP (for example, for use with Application Default Credentials). When a new key pair is created, the user is required to download the private key (which is not retained by Google). With external keys, users are responsible for keeping the private key secure and other management operations such as key rotation. External keys can be managed by the IAM API, gcloud command-line tool, or the Service Accounts page in the Google Cloud Platform Console. GCP facilitates up to 10 external service account keys per service account to facilitate key rotation.
... see more
Remediation
Remediation
From Google Cloud Console
Delete any external (user-managed) Service Account Key older than 90 days:
- Go to
APIs & Services\Credentialsusing https://console.cloud.google.com/apis/credentials- In the Section
Service Account Keys, for every external (user-managed) service account key wherecreation dateis greater than or equal to the past 90 days, clickDelete Bin IcontoDelete Service Account keyCreate a new external (user-managed) Service Account Key for a Service Account:
- Go to
APIs & Services\Credentialsusing https://console.cloud.google.com/apis/credentials- Click
Create CredentialsandSelect Service Account Key.- Choose the service account in the drop-down list for which an External (user-managed) Service Account key needs to be created.
- Select the desired key type format among
JSONorP12.- Click
Create. It will download theprivate key. Keep it safe.- Click
Closeif prompted.- The site will redirect to the
APIs & Services\Credentialspage. Make a note of the newIDdisplayed in theService account keyssection.