IP forwarding is enabled on the instance Affecting Compute Engine service in Google


Severity

0.0
medium
0
10
    Severity Framework
    Snyk CCSS
    Rule category
    Network / Policy

Is your enviroment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
    Frameworks
    CIS-Google CSA-CCM ISO-27001 NIST-800-53
  • Snyk ID SNYK-CC-00378
  • credit Snyk Research Team

Description

By default, a Compute Engine instance cannot forward a packet originated by another instance ("IP forwarding"). If this is enabled, Google Cloud no longer enforces packet source and destination checking, which can result in data loss or unintended information disclosure.

How to fix?

Set the google_compute_instance can_ip_forward attribute to false.

Example Configuration

resource "google_compute_instance" "test" {
  name         = "enabled-ip-forwarding"
  machine_type = "e2-micro"
  zone         = "us-east1-b"
  can_ip_forward = false

  boot_disk {
    initialize_params {
      image = "debian-10-buster-v20220920"
    }
  }

  network_interface {
    network = "default"
  }
}