Wireguard Bastion
Deployment of Wireguard Bastion host
Wireguard is the recommended VPN to get private channel access to your OpenG2P clusters and resources. Wireguard is a fast secure & open-source VPN, with P2P traffic encryption.
The document talks about setting up a Wireguard bastion host to enable a private channel to the Kubernetes cluster.
TBD
Multiple Wireguard servers will be required (all on the same node/VM). Each server is used to give access to Load balancer(s) for a particular set of users. For the rest of the documentation, we will call this a "channel".
It is recommended to set up at least two channels, one for System Administrators, and one for OpenG2P Application Users (like Program Managers, Service Providers, etc). Further channels can be created based on the need.
Prerequisites
One virtual machine (VM) running on the same network as the rest of the nodes, and has access to them. For recommended configuration of the VM refer to Hardware Requirements.
Firewall rules: Allow only
22/tcp
,51820-51830/udp
ports.Docker installed on the VM
Installation
Clone the openg2p-deployment repo and navigate to the kubernetes/wireguard directory
Run this with root privileges:
To create multiple wireguard servers, run the above script multiple times with appropriate parameters. For example:
Check logs of the servers and wait for all servers to finish startup. Example:
Limit user access
Limit each wireguard server to allow access to only the required Load Balancer/Nginx: (The following uses
wireguard_app_users
server example. Repeat this for all servers)Comment out these lines in
/etc/wireguard_app_users/rules.sh
. (This allows everyone to access all IPs):Add the following lines under the above lines in
/etc/wireguard_app_users/rules.sh
, repeat for all IPs of LB/Nginx:Restart the server
Repeat the above for all the wireguard servers/channels.
For System Admin channel, limit access to only Rancher LB/Nginx. For Other Channels, limit access to the relevant LBs/Nginxs.
Access to users
Refer to this Wireguard Access to Users
Wireguard client
To access systems behind Wireguard bastion, you need to install Wireguard client on your machine. Install the client as follows:
Last updated