GKE legacy endpoint enabled Affecting Container service in Google


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

Description

The legacy endpoints do not enforce metadata query headers and can leak sensitive information.

How to fix?

Set metadata.disable-legacy-endpoints attribute to true.

Example Configuration

resource "google_container_cluster" "allowed" {
  name               = "my-cluster-424-1"
  location           = "us-central1-a"
  initial_node_count = 1
}

resource "google_container_cluster" "allowed_1" {
  name               = "my-cluster-424-2"
  location           = "us-east1"
  initial_node_count = 1
  node_config {
    disk_size_gb = "10"
    metadata = {
      disable-legacy-endpoints = "true"
    }
  }
}

resource "google_container_cluster" "allowed_2" {
  name               = "my-cluster-424-2"
  location           = "us-west1"
  initial_node_count = 1
  node_config {
    disk_size_gb = "10"
    metadata = {
    }
  }
}

resource "google_container_cluster" "allowed_3" {
  name               = "my-cluster-424-2"
  location           = "asia-east1"
  initial_node_count = 1
  node_config {
    disk_size_gb = "10"
  }
}