Master authorized networks feature is disabled Affecting Cloud Storage service in Google


Severity

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

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
  • Snyk IDSNYK-CC-00788
  • creditSnyk Research Team

Description

Enabling the Master Authorized Networks feature restricts Kubernetes API server access to a set of CIDR ranges, mitigating unauthorized access risks. Without this, any IP can potentially access the API server, increasing the attack surface. Restricting access based on Source IP ensures that only traffic from designated networks can reach the API server, enhancing the security posture by limiting potential entry points for attackers.

How to fix?

Configure the master_authorized_networks_config block in a google_container_cluster resource.

Example Configuration

resource "google_container_cluster" "allowed" {
  name                     = "snyk-788-cluster"
  location                 = "us-central1"
  deletion_protection      = false
  remove_default_node_pool = true
  initial_node_count       = 1
  master_authorized_networks_config {
    cidr_blocks {
      cidr_block   = "192.168.7.0/28"
      display_name = "cidr_1st"
    }
  }
}