Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Containers/ Best Practices

Is your environment 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-ControlsCSA-CCM
  • Snyk IDSNYK-CC-00416
  • creditSnyk Research Team

Description

Network policies cannot be used as part of defense in depth controls.

How to fix?

Set network_policy.enabled attribute to true.

Example Configuration

resource "google_container_cluster" "allowed" {
  name     = "my-gke-cluster416"
  location = "us-central1-a"
  initial_node_count       = 1
  node_config{
    disk_size_gb = 10
  }
  network_policy {
    enabled = true
  }
}

resource "google_container_cluster" "allowed_2" {
  name     = "my-gke-cluster416a"
  location = "us-central1"
  ip_allocation_policy {
    cluster_ipv4_cidr_block  = ""
    services_ipv4_cidr_block = ""
  }
  enable_autopilot = true
}