Skip to content

Why can a VM in my GCP project not respect my authorizedNetworksConfig and access my GKE cluster? #2554

@yemaney

Description

@yemaney

Control Plane Networking

DNS endpoint Disabled
Control plane access using IPv4 addresses Enabled
Public endpoint 3.1.5.1
Private endpoint 10.0.128.2
Access using control plane's internal IP address from any region Disabled
Authorized networks Enabled 1.1.1.1/32 (1.1.1.1/32)
Enforce authorized networks on control plane's internal endpoint Enabled
Add Google Cloud external IP addresses to authorized networks Disabled
curl -v -k https://3.1.5.1:443
*   Trying 3.1.5.1:443...
* Connected to 3.1.5.1 (3.1.5.1) port 443
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Request CERT (13):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Certificate (11):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519 / RSASSA-PSS
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=3.1.5.1
*  start date: Mar  9 15:08:20 2026 GMT
*  expire date: Mar  8 15:10:20 2031 GMT
*  issuer: CN=42cf934c-62af-43da-a4b4-18dfde5075ff
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
*   Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://3.1.5.1:443/
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: 3.1.5.1]
* [HTTP/2] [1] [:path: /]
* [HTTP/2] [1] [user-agent: curl/8.5.0]
* [HTTP/2] [1] [accept: 
*/*
]
> GET / HTTP/2
> Host: 3.1.5.1
> User-Agent: curl/8.5.0
> Accept: 
*/*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* received GOAWAY, error=0, last_stream=1
< HTTP/2 403 
< audit-id: 862ae066-13a9-4023-a827-1477d820af89
< cache-control: no-cache, private
< content-type: application/json
< x-content-type-options: nosniff
< x-kubernetes-pf-flowschema-uid: 4846a272-5617-4af1-a810-65f3f326d883
< x-kubernetes-pf-prioritylevel-uid: 44f8bcba-5c1b-48fa-8092-315e0d12878e
< content-length: 217
< date: Tue, 10 Mar 2026 06:22:51 GMT
< 
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
* Closing connection
* TLSv1.3 (OUT), TLS alert, close notify (256):
```

The vm is in the same region as the cluster but in different vpc.
I've added an authorized network of `1.1.1.1/32`.

This configuration blocks my local laptop from making kubectl connections to the cluster.
But the vm that is also running in gke can still make network connectoins to the cluster. Confirmed via curl command
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions