---
title: Projects should have OS Login enabled for SSH authentication
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Projects should have OS Login enabled
  for SSH authentication
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Projects should have OS Login enabled for SSH authentication
 
## Description{% #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{% #remediation %}

1. Set `enable-oslogin` to `TRUE` in project metadata.
1. 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](https://docs.cloud.google.com/compute/docs/oslogin/set-up-oslogin#enable_os_login_for_all_vms_in_a_project).

## References{% #references %}

- [Set up OS Login](https://docs.cloud.google.com/compute/docs/oslogin/set-up-oslogin#enable_os_login_for_all_vms_in_a_project)
- [Automatically applied labels](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-managing-labels#automatically-applied-labels)
- [CIS Google Cloud Platform Foundation Benchmark](https://www.cisecurity.org/benchmark/google_cloud_computing_platform)
