CIS Google Cloud Platform Foundation Benchmark v1.2.0/Virtual Machines/41 of 83
4.4Ensure oslogin is enabled for a Project
Control family: Virtual Machines
Control description
Enabling OS login binds SSH certificates to IAM users and facilitates effective SSH certificate management.
How to implement
ResponsibilityCustomerYou configure and operate this in your own cloud accounts.
OS Login ties SSH access to people's Google identities and IAM roles instead of keys copied into metadata. When someone leaves or changes role, removing their IAM access removes their SSH access too, and every sign-in is attributable.
Before you start
The same on every cloud, before the steps in the tabs.
- Decide who may sign in to VMs, and with which role (Compute OS Login or Compute OS Admin Login), through groups.
- Agree how access is reviewed and removed when people leave.
Evidence
- The VM access standard and the group membership review
Not applicable. This benchmark covers Google Cloud only.
Not applicable. This benchmark covers Google Cloud only.
On Google Cloud the tasks turn on OS Login in project metadata, require it across the organization with a policy, and watch with Security Command Center.
Task 1Turn on OS Login for the project
- Sign in to the Google Cloud console at console.cloud.google.com and pick the project.
- Open Compute Engine > Metadata.
- Choose Edit, then Add item.
- Enter the key enable-oslogin with the value TRUE, and choose Save.
- Make sure no VM overrides it with enable-oslogin set to FALSE in its own Custom metadata.
- Grant users Compute OS Login (or Compute OS Admin Login for administrators) on the project.
- Check it: users connect with the console's SSH button under their own name.
Task 2Prevent it with the organization policy compute.requireOsLogin
- Open IAM & Admin > Organization policies with the organization (or the folder that holds your projects) selected in the project picker.
- Search for compute.requireOsLogin (Require OS login) and open it.
- Choose Manage policy, select Override parent's policy, choose Add a rule and set Enforcement to On.
- Choose Set policy.
- Check it: a new project in the organization has OS Login on without anyone setting the metadata.
Task 3Keep it checked with the Security Health Analytics finding OS_LOGIN_DISABLED
- Open Security Command Center > Findings for the organization (Security Health Analytics runs on the Premium tier for most detectors).
- In the query editor, filter on category OS_LOGIN_DISABLED with state ACTIVE, and select Apply.
- Open each finding, read the resource and the explanation it gives, and turn OS Login on for the project it names; check INSTANCE_OS_LOGIN_DISABLED for single VMs too.
- Check it: after the next Security Health Analytics scan, no active OS_LOGIN_DISABLED finding remains.
Evidence
- Compute Engine > Metadata, showing enable-oslogin set to TRUE
- The compute.requireOsLogin policy, enforced
- Security Command Center, with no active OS_LOGIN_DISABLED or INSTANCE_OS_LOGIN_DISABLED finding
Console steps as of 5 November 2026. Not every step has been confirmed in a live console yet, and menus and labels can move between releases, so look for the nearest match if one has changed.