Instances should use a non-default service account

Esta página aún no está disponible en español. Estamos trabajando en su traducción.
Si tiene alguna pregunta o comentario sobre nuestro proyecto de traducción actual, ¡no dude en contactarnos!

Description

Attach a user-managed service account to Compute Engine instances instead of the default Compute Engine service account (PROJECT_NUMBER-compute@developer.gserviceaccount.com). The default service account often has broad project permissions, so a compromised instance that uses it can read or change resources across the project.

This rule fails when any service account attached to the instance is the default Compute Engine service account. It also fails when an attached service account entry has no email, because the rule cannot confirm that the entry is a user-managed account. An instance with no attached service account passes.

GKE nodes are skipped. An instance counts as a GKE node when its name starts with gke- and it has a non-empty goog-k8s-cluster-name label, which GKE applies to node VMs. The goog-gke-node label named by the CIS benchmark has an empty value and is not present in the collected resource data, so it is not used.

Remediation

  1. Create a user-managed service account that has only the roles the workload needs.
  2. Stop the instance, attach the new service account, and start the instance, following Change the attached service account.

References