Review authorized networks for the GKE control plane

Limit access to GKE control plane IP endpoints to required management networks.

Description

master_authorized_networks_config limits which source addresses can reach control-plane IP endpoints. Manage IAM access to the DNS endpoint separately.

Potential impact

If the external IP endpoint is reachable, clients outside the management network can try to connect to the API server. API operations still require authentication and authorization.

Remediation

Identify the source addresses actually used by your VPN or jump hosts. Set master_authorized_networks_config.enabled: yes and keep only approved ranges in cidr_blocks. If the internal IP also needs restrictions, check its separate enforcement setting. Remove temporary exceptions and limit IAM and RBAC permissions.

Examples

Replace the documentation range 192.0.2.0/24 with your management clients’ approved source CIDR.

Before

yaml
- name: create a cluster
  google.cloud.gcp_container_cluster:
    name: my-cluster
    location: us-central1-a
    auth_kind: serviceaccount
    master_authorized_networks_config:
      cidr_blocks:
        - cidr_block: 192.0.2.0/24
      enabled: no
    state: present

- name: create a third cluster
  google.cloud.gcp_container_cluster:
    name: my-third-cluster
    location: us-central1-a
    auth_kind: serviceaccount
    state: present

my-cluster lists a CIDR but disables the feature. my-third-cluster omits the setting, so check its deployed endpoints.

After

yaml
- name: create a cluster
  google.cloud.gcp_container_cluster:
    name: my-cluster
    initial_node_count: 2
    location: us-central1-a
    auth_kind: serviceaccount
    master_authorized_networks_config:
      cidr_blocks:
        - cidr_block: 192.0.2.0/24
      enabled: yes
    state: present

The task enables the allow-list for my-cluster. Verify that approved management connections succeed and connections from excluded sources fail.

References