Legacy ABAC authorization enabled in GKE

Disable legacy ABAC and use fine-grained access control in GKE

Description

Enabling enable_legacy_abac adds legacy ABAC grants to permissions from IAM and Kubernetes RBAC.

Potential impact

A user or service account may reach more resources than its RBAC bindings suggest.

Remediation

Prepare the required IAM grants and RBAC bindings first. Apply enable_legacy_abac = false, then test that users and service accounts can perform only the operations they need.

Examples

Both blocks configure primary_cluster. Only the ABAC setting changes. The permission bindings are outside these examples.

Before

hcl
resource "google_container_cluster" "primary_cluster" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3
  enable_legacy_abac = true
}

After

hcl
resource "google_container_cluster" "primary_cluster" {
  name               = "marcellus-wallace"
  location           = "us-central1-a"
  initial_node_count = 3
  enable_legacy_abac = false
}

References