> 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/appsec-rules/iac-security/public-exposure/appsec-gcp-124.md).

# GCP Cloud Function configured with overly permissive Ingress setting misconfiguration detected in co

## Rule Details

|                        |                                      |
| ---------------------- | ------------------------------------ |
| Cortex AppSec Rule ID  | APPSEC\_GCP\_124                     |
| Category - Subcategory | Public Exposure - Ingress Controls   |
| Provider               | GCP                                  |
| Severity               | LOW                                  |
| Framework              | Terraform, Terraform Plan            |
| Mapped CSPM/KSPM Rule  | 505e6598-f26b-4054-9f9b-62702126622f |

## Impact

This rule checks whether GCP Cloud Functions are configured with overly permissive Ingress settings. Overly permissive Ingress settings allow all inbound requests to the function, both from the public and from resources within the same project. It is recommended to restrict the traffic to improve network-based access control, allowing traffic only from VPC networks within the same project or through the Cloud Load Balancer.

## How to Fix

*Resource:* google\_cloudfunctions\_function, google\_cloudfunctions2\_function

* *Arguments:* ingress\_settings

To fix this issue, configure the "ingress" setting of the GCP Cloud Function to either "ALLOW\_INTERNAL\_AND\_GCLB" or "ALLOW\_INTERNAL\_ONLY" to restrict the sources able to access the function.

## In the following example, the code is secure as it sets the ingress\_settings of the Google Cloud Function to ALLOW\_INTERNAL\_ONLY, meaning that the function can only be accessed internally. This significantly restricts the potential sources of incoming traffic and reduces the risk of unauthorized access to the function. \[source,go]

resource "google\_cloudfunctions\_function" "function" { name = "function-test" description = "My function" runtime = "nodejs10"

available\_memory\_mb = 128 source\_archive\_bucket = "my-bucket" source\_archive\_object = "functions/my-function.zip" trigger\_http = true

* ingress\_settings = "ALLOW\_INTERNAL\_ONLY" entry\_point = "httpsRequest" }

***


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/appsec-rules/iac-security/public-exposure/appsec-gcp-124.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
