Projects should have OS Login enabled for SSH authentication

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

Enable OS Login in project metadata so that SSH access to Compute Engine instances is tied to IAM identities and is removed when IAM access is revoked.

This rule evaluates each instance. It passes when the instance’s project sets enable-oslogin to true in project metadata and the instance does not override it with a false value. It fails when the project does not set enable-oslogin to true, when the project is not collected, or when the instance sets enable-oslogin to false. Enabling OS Login only on the instance does not pass the check.

enable-oslogin is read the way the guest environment parses it: exactly 1, t, T, true, TRUE, or True for true and 0, f, F, false, FALSE, or False for false. Other values, such as Yes or TrUe, are treated as unset. GKE nodes (name starts with gke- and has a non-empty goog-k8s-cluster-name label) are skipped. Zonal metadata and the compute.requireOsLogin organization policy are not evaluated.

Remediation

  1. Set enable-oslogin to TRUE in project metadata.
  2. Remove any enable-oslogin entry set to false from the metadata of the flagged instance.

For more information, see Enable OS Login for all VMs in a project.

References