> 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-instances-with-excessive-service-account-permissions.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP VM instances with excessive service account permissions

### Synopsis

| Field               | Value                                                       |
| ------------------- | ----------------------------------------------------------- |
| Rule Type           | Detection                                                   |
| Finding Type        | GCP VM instances with excessive service account permissions |
| Finding ID          | 60000126                                                    |
| 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 VM instances exhibiting service accounts with overly permissive roles pose a significant security risk. These excessive permissions could enable attackers to gain unauthorized access and control over the instances and associated resources.

Granting excessive 'roles' beyond 'viewer' or 'reader' access to service accounts increases the potential attack surface. Compromise of a service account with excessive permissions could lead to data breaches, unauthorized resource modification, or complete system takeover.

Such misconfigurations could result in data loss, service disruption, and significant financial penalties. Employing the principle of least privilege ensures that only the necessary permissions are granted, limiting the potential damage from a compromised account. This approach significantly reduces the risk and impact of any successful attack.

To mitigate this, create appropriate custom service accounts for VM instances. Grant only the minimum required roles to the service accounts, following the principle of least privilege. Regularly review and audit service account permissions, removing unnecessary access as needed.

### Remediation

Note: To change an instance's service account and access scopes, the instance must be temporarily stopped. To stop your instance, read the documentation for Stopping an instance. After changing the service account or access scopes, remember to restart the instance.

To change service account of the stopped instance:

1. Login to GCP portal
2. Go to Compute Engine
3. Choose VM instances
4. Click on the reported VM instance for which you want to change the service account
5. If the instance is not stopped, click the Stop button. Wait for the instance to be stopped
6. Next, click the Edit button
7. Scroll down to the Service Account section, From the drop-down menu, select the desired service account

   Note: To fix this alert either you have to associate service account which has only viewer access or if VM has desired service account and access then dismiss the alert for particular VM instance.
8. Click the Save button


---

# 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-instances-with-excessive-service-account-permissions.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.
