> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-projects-have-os-login-disabled.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP Projects have OS Login disabled

### Synopsis

| Field               | Value                                        |
| ------------------- | -------------------------------------------- |
| Rule Type           | Detection                                    |
| Finding Type        | GCP Projects have OS Login disabled          |
| Finding ID          | 60000154                                     |
| Generates a Finding | This detection rule also generates a finding |
| Severity            | Informational                                |
| Category            | CONFIGURATION                                |
| Cloud Providers     | GCP                                          |
| Platform Module     | CSPM                                         |
| Asset Types         | GOOGLE\_CLOUD\_PROJECT\_INFO                 |
| ATT\&CK Tactic      | TA0112 (TA0112)                              |
| ATT\&CK Technique   | T1685.002 (T1685.002)                        |

### Description

GCP projects with OS Login disabled pose a significant security risk, allowing unauthorized access to virtual machines.

OS Login, a Google Cloud service, provides secure access to virtual machines using SSH keys tied to IAM users. Disabling it removes this crucial link between identity and access, hindering centralized key management and incident response. Attackers could exploit this by gaining access to an SSH key without triggering IAM-based alerts.

The impact of this misconfiguration includes compromised virtual machines, data breaches, and lateral movement within the GCP environment. Maintaining OS Login ensures that SSH key access is centrally managed and revoking an IAM user's access immediately disables all associated SSH keys, mitigating risks from compromised credentials.

To remediate this, enable OS Login on all GCP projects. Regularly review and update IAM permissions to ensure only authorized users have access to 'compute.instances.get' and 'compute.instances.ssh'. Implement strong password policies and multi-factor authentication for IAM users.

### Remediation

**Manual steps:**

Google Cloud Project Info - Manual remediation steps:

1. Login to GCP Portal
2. Navigate to service 'Computer Engine' (Left Panel)
3. For setting project-level OS login configuration, go to the 'Metadata' section under 'Settings'(from Left Panel)
4. Click on the 'Edit' button
5. If the metadata for 'enable-oslogin' is not set, click on '+Add item' and add metadata entry key as 'enable-oslogin' and the value as 'TRUE'/'true'
6. Click on 'Save' to apply the changes
7. You need to validate if any overriding instance-level metadata is set,
8. Go to the tab 'VM instances', under section 'Virtual machines',
9. For every instance, click on 'Edit'
10. Under Custom metadata, remove any entry with key 'enable-oslogin' and the value 'FALSE'/'false'
11. At the bottom of the 'VM instance details' page, click 'Save' to apply your changes to the instance.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/gcp-projects-have-os-login-disabled.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
