Access restrictions when using Gcloud vpn with Kubernetes

4/14/2020

This is my first question on Stack Overflow:

We are using Gcloud Kubernetes.

A customer specifically requested a VPN Tunnel to scrape a single service in our Cluster (I know ingress would be more suited for this).

Since VPN is IP based and Kubernetes changes these, I can only configure the VPN to the whole IP range of services.

I'm worried that the customer will get full access to all services if I do so.

I have been searching for days on how to treat incoming VPN traffic, but haven't found anything.

How can I restrict the access? Or is it restricted and I need netpols to unrestrict it?

Incoming VPN traffic can either be terminated at the service itself, or at the ingress - as far as I see it. Termination at the ingress would probably be better though.

I hope this is not too confusing, thanks you so much in advance

-- Pille
gcloud
kubernetes
routing
vpn

1 Answer

4/15/2020

As you mentioned, an external Load Balancer would be ideal here as you mentioned, but if you must use GCP Cloud VPN then you can restrict access into your GKE cluster (and GCP VPC in general) by using GCP Firewall rules along with GKE internal LBs HTTP or TCP.

As a general picture, something like this.

Second, we need to add two firewall rules to the dedicated networks (project-a-network and project-b-network) we created. Go to Networking-> Networks and click the project-[a|b]-network. Click “Add firewall rule”. The first rule we create allows SSH traffic from the public so that we can SSH into the instances we just created. The second rule allows icmp traffic (ping uses the icmp protocol) between the two networks.

-- Frank
Source: StackOverflow