> 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-vm-instance-os-login-overrides-project-metadata-os-login-configuration.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP VM instance OS login overrides Project metadata OS login configuration

### Synopsis

| Field               | Value                                                                      |
| ------------------- | -------------------------------------------------------------------------- |
| Rule Type           | Detection                                                                  |
| Finding Type        | GCP VM instance OS login overrides Project metadata OS login configuration |
| Finding ID          | 60000657                                                                   |
| Generates a Finding | This detection rule also generates a finding                               |
| Severity            | Medium                                                                     |
| Category            | CONFIGURATION                                                              |
| Cloud Providers     | GCP                                                                        |
| Platform Module     | CSPM                                                                       |
| Asset Types         | GOOGLE\_COMPUTE\_ENGINE\_VM\_INSTANCE                                      |

### Description

GCP Compute Engine instances with OS Login disabled, despite project-level OS Login being enabled, represent a security misconfiguration. This bypasses centralized key management and increases the risk of unauthorized access.

OS Login provides a centralized mechanism for managing SSH keys, linking them to IAM users. Disabling OS Login on individual instances, while project-level settings mandate it, allows bypassing this control. Attackers could exploit this to maintain persistent access even if their IAM user credentials are revoked, since instance-level SSH keys are unaffected.

The impact of this misconfiguration is the loss of centralized control over access to GCP VMs. This could lead to unauthorized access, data breaches, and lateral movement within the GCP environment. Centralized key management via OS Login is crucial for incident response and reducing the blast radius of compromised credentials.

To mitigate this, ensure OS Login is enabled on all GCP VMs. Regularly review instance configurations to identify and remediate any deviations from the project's OS Login settings.

### Remediation

1. Login to GCP Portal
2. Go to Computer Engine (Left Panel)
3. Go to the VM instances
4. Select the alerted VM instance
5. Click on the 'EDIT' button
6. Go to 'Custom metadata'
7. Remove the metadata entry where the key is 'enable-oslogin' and the value is 'FALSE' or 'false' or 0.(For more information on adding boolean values, refer: <https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#boolean>)
8. Click on 'Save' to apply the changes


---

# 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-vm-instance-os-login-overrides-project-metadata-os-login-configuration.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.
