For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

GCP Cloud Function is publicly accessible misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_GCP_107

Category - Subcategory

Public Exposure - APIs

Provider

GCP

Severity

MEDIUM

Framework

Terraform, Terraform Plan

Mapped CSPM/KSPM Rule

9d657a8a-6c31-4bb5-8bb8-d0d55d04263b

Impact

This rule is checking to ensure that cloud functions are not set as public. It falls under the category of Application Security. The rationale behind this check is that making cloud functions public exposes them to potential unauthorized access. This can lead to misuse or exploitation of the functions, potentially causing disruption to services, data breaches, or other security incidents. Therefore, it is crucial to ensure that only authorized entities have access to these functions for the purpose of maintaining robust security.

How to Fix

Resource: "google_cloudfunctions_function_iam_member", "google_cloudfunctions_function_iam_binding" "google_cloudfunctions2_function_iam_member", "google_cloudfunctions2_function_iam_binding"

  • Arguments: member, members

To fix this issue, you need to ensure that the access control is set to allow only specific services or accounts to invoke the function. [source,go]

resource "google_cloudfunctions2_function_iam_binding" "fail" { project = google_cloudfunctions_function.pikey.project region = google_cloudfunctions_function.pikey.region cloud_function = google_cloudfunctions_function.pikey.name role = "roles/viewer" members = [

  • "allUsers", ] }


Last updated

Was this helpful?