> 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-cloud-run-function-is-using-default-service-account-with-editor-role.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# GCP Cloud Run function is using default service account with editor role

### Synopsis

| Field               | Value                                                                    |
| ------------------- | ------------------------------------------------------------------------ |
| Rule Type           | Detection                                                                |
| Finding Type        | GCP Cloud Run function is using default service account with editor role |
| Finding ID          | 60001492                                                                 |
| Generates a Finding | This detection rule also generates a finding                             |
| Severity            | Medium                                                                   |
| Category            | CONFIGURATION                                                            |
| Cloud Providers     | GCP                                                                      |
| Platform Module     | CSPM                                                                     |
| Asset Types         | GOOGLE\_CLOUD\_FUNCTION                                                  |

### Description

Cloud Run functions using the default service account with the 'roles/editor' role represent a significant security misconfiguration. This allows the function excessive permissions, increasing the risk of unauthorized access and data breaches.

Cloud Run functions leverage service accounts for authentication. The default service account, automatically created, inherits the 'roles/editor' role by default unless explicitly modified. This broad access enables the function to perform virtually any action within the project, including modifying or deleting resources. An attacker compromising this function gains extensive control.

Exploiting this misconfiguration could lead to complete project compromise, data exfiltration, or malicious code execution. Restricting permissions to only what's absolutely necessary minimizes the blast radius of a potential compromise, significantly enhancing the overall security posture.

To mitigate this risk, explicitly grant only the necessary permissions to the Cloud Run service account. Create a custom service account with a restrictive role, granting only the permissions required for the function's specific task. Regularly review and audit service account permissions to ensure they remain appropriately configured and aligned with least privilege principles.

### Remediation

1. Login to the GCP console
2. Navigate to the 'Cloud Run functions' service
3. Click on the name of the cloud run function on which alert is generated
4. Click 'Edit & deploy new revision' at top
5. Navigate to 'Security' tab
6. Under 'Service account' dropdown, select an appropriate service account.
7. Select the 'Serve this revision immediately' checkbox below
8. Click 'Deploy' at bottom


---

# 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-cloud-run-function-is-using-default-service-account-with-editor-role.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.
