More Info:

Enable OS login to ensure that SSH keys used to connect to instances are mapped with IAM users.

Risk Level

High

Address

Security

Compliance Standards

SOC2, PCIDSS, ISO27001, HIPAA, CISGCP, CBP, NISTCSF

Triage and Remediation

Remediation

To remediate the misconfiguration “OS Login Should Be Enabled” for GCP using GCP console, follow these steps:

  1. Open the GCP Console and select the project you want to work on.
  2. In the left-hand menu, select “Compute Engine” and then select “VM instances”.
  3. Click on the name of the VM instance you want to configure.
  4. In the VM instance details page, click on the “Edit” button at the top of the page.
  5. Scroll down to the “Cloud API access scopes” section.
  6. In the “Cloud API access scopes” section, click on “Allow full access to all Cloud APIs”.
  7. Scroll down to the “Cloud Identity and Access Management (IAM)” section.
  8. In the “Cloud Identity and Access Management (IAM)” section, click on “Add item”.
  9. In the “Add members” dialog box, enter the email address of the user or service account you want to grant access to.
  10. In the “Role” dropdown menu, select “Compute OS Login”.
  11. Click “Save” to apply the changes.

After following these steps, OS Login will be enabled for the selected VM instance in GCP.

Additional Reading: