GKE Network Policies enforcement disabled Affecting Kubernetes (Container) Engine service in Google
Severity Framework
Snyk CCSS
Rule category
Containers / Best Practices
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 applicationsFrameworks
CIS-Controls
CSA-CCM
- Snyk ID SNYK-CC-00416
- credit Snyk 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
}