Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CKV2_GCP_10 - false positives #6946

Open
mustex opened this issue Jan 10, 2025 · 0 comments
Open

CKV2_GCP_10 - false positives #6946

mustex opened this issue Jan 10, 2025 · 0 comments
Labels
checks Check additions or changes

Comments

@mustex
Copy link

mustex commented Jan 10, 2025

Describe the issue
Checkov scan is showing false positives regarding insecure http access to event triggered cloud functions.

Check: CKV2_GCP_10: "GCP Cloud Function HTTP trigger is not secured"
FAILED for resource: google_cloudfunctions_function.function

Examples

resource "google_cloudfunctions_function" "function" {
  name    = local.function_name
  project = local.project
  region  = var.region
  runtime = "dotnet8"

  event_trigger {
    event_type     = "providers/cloud.pubsub/eventTypes/topic.publish"
    resource = data.google_pubsub_topic.topic.id
    failure_policy  {
      retry= true
    }
  }
}

We cannot add trigger_http = false as it fails during the plan:

Plan: 1 to add, 0 to change, 1 to destroy.
╷
│ Error: Conflicting configuration arguments
│
│   with google_cloudfunctions_function.function,
│   on cloudfunction.tf line 1, in resource "google_cloudfunctions_function" "function":
│    1: resource "google_cloudfunctions_function" "function" {
│
│ "event_trigger": conflicts with trigger_http

We also cannot add https_trigger_security_level = "SECURE_ALWAYS" as that fails at apply:

Error: Error while updating cloudfunction configuration: googleapi: Error 400: Invalid value at 'function' (oneof), oneof field 'trigger' is already set. Cannot set 'httpsTrigger'

This is the only cloud function in our terraform, and it is triggered by an event topic, so this check is not applicable.

Version (please complete the following information):

  • Checkov Version 3.2.334

Additional context
See previously closed requests: #4812, #5897

@mustex mustex added the checks Check additions or changes label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check additions or changes
Projects
None yet
Development

No branches or pull requests

1 participant