Skip to main content

🛡️ Google GCE Instance OS Login is not enabled🟢

Logic

Similar Policies

Description

Open File

Description

OS Login binds SSH certificates to IAM users and facilitates effective SSH certificate management.

Rationale

Enabling OS Login ensures that SSH keys used to connect to instances are mapped with IAM users. Revoking access to an IAM user will revoke all the SSH keys associated with that particular user. It facilitates centralized and automated SSH key pair management which is useful in handling cases like response to compromised SSH key pairs and/or revocation of external/third-party/Vendor users.

Impact

Enabling OS Login on a project disables metadata-based SSH key configurations on all instances from a project. Disabling OS Login restores SSH keys that you have configured in the project or instance metadata.

Audit

From Google Cloud Console
  1. Go to the VM compute metadata page by visiting https://console.cloud.google.com/compute/metadata.
  2. Ensure that key enable-oslogin is present with value set to TRUE.
  3. Because instances can override project settings, ensure that no instance has custom metadata with key enable-oslogin and value FALSE.

... see more

Remediation

Open File

Remediation

From Google Cloud Console

  1. Go to the VM compute metadata page by visiting: https://console.cloud.google.com/compute/metadata.
  2. Click Edit.
  3. Add a metadata entry where the key is enable-oslogin and the value is TRUE.
  4. Click Save to apply the changes.
  5. For every instance that overrides the project setting, go to the VM Instances page at https://console.cloud.google.com/compute/instances.
  6. Click the name of the instance on which you want to remove the metadata value.
  7. At the top of the instance details page, click Edit to edit the instance settings.
  8. Under Custom metadata, remove any entry with key enable-oslogin and the value is FALSE
  9. At the bottom of the instance details page, click Save to apply your changes to the instance.

From Google Cloud CLI

  1. Configure oslogin on the project:

    gcloud compute project-info add-metadata \
    --metadata enable-oslogin=TRUE
  2. Remove instance metadata that overrides the project setting.

    gcloud compute instances remove-metadata {{instance-name}} \

... see more

policy.yaml

Open File

Linked Framework Sections

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
💼 CIS GCP v1.2.0 → 💼 4.4 Ensure oslogin is enabled for a Project - Level 1 (Automated)1no data
💼 CIS GCP v1.3.0 → 💼 4.4 Ensure Oslogin Is Enabled for a Project - Level 1 (Automated)1no data
💼 CIS GCP v2.0.0 → 💼 4.4 Ensure Oslogin Is Enabled for a Project - Level 1 (Automated)1no data
💼 CIS GCP v3.0.0 → 💼 4.4 Ensure Oslogin Is Enabled for a Project - Level 1 (Automated)1no data
💼 Cloudaware Framework → 💼 Secure Access53no data
💼 FedRAMP High Security Controls → 💼 AC-2 Account Management (L)(M)(H)10851no data
💼 FedRAMP Low Security Controls → 💼 AC-2 Account Management (L)(M)(H)5no data
💼 FedRAMP Moderate Security Controls → 💼 AC-2 Account Management (L)(M)(H)951no data
💼 ISO/IEC 27001:2022 → 💼 5.15 Access control1431no data
💼 NIST CSF v2.0 → 💼 DE.CM-01: Networks and network services are monitored to find potentially adverse events180no data
💼 NIST CSF v2.0 → 💼 DE.CM-03: Personnel activity and technology usage are monitored to find potentially adverse events100no data
💼 NIST CSF v2.0 → 💼 PR.AA-01: Identities and credentials for authorized users, services, and hardware are managed by the organization43no data
💼 NIST CSF v2.0 → 💼 PR.AA-05: Access permissions, entitlements, and authorizations are defined in a policy, managed, enforced, and reviewed, and incorporate the principles of least privilege and separation of duties133no data
💼 NIST CSF v2.0 → 💼 PR.DS-10: The confidentiality, integrity, and availability of data-in-use are protected184no data
💼 NIST SP 800-53 Revision 5 → 💼 AC-2 Account Management132050no data
💼 SOC 2 → 💼 CC6.1-4 Identifies and Authenticates Users46no data
💼 SOC 2 → 💼 CC6.1-6 Manages Points of Access57no data
💼 SOC 2 → 💼 CC6.1-8 Manages Identification and Authentication1824no data
💼 SOC 2 → 💼 CC6.1-9 Manages Credentials for Infrastructure and Software34no data