All Projects → utilitywarehouse → wiresteward

utilitywarehouse / wiresteward

Licence: MIT license
Wireguard peer manager

Programming Languages

go
31211 projects - #10 most used programming language
HCL
1544 projects

Projects that are alternatives of or similar to wiresteward

ansible-role-wireguard-vyatta
Ansible role for managing wireguard on vyatta based routers
Stars: ✭ 18 (-64%)
Mutual labels:  wireguard
python-tokens
Python library to manage OAuth access tokens
Stars: ✭ 14 (-72%)
Mutual labels:  oauth2
psd2
API client for banks supporting PSD2 APIs with OAuth2 authentication.
Stars: ✭ 26 (-48%)
Mutual labels:  oauth2
wgnlpy
WireGuard + Netlink + Python
Stars: ✭ 38 (-24%)
Mutual labels:  wireguard
hide.client.linux
Hide.me CLI VPN client for Linux
Stars: ✭ 41 (-18%)
Mutual labels:  wireguard
logto
🧑‍🚀 Logto helps you build the sign-in, auth, and user identity within minutes. We provide an OIDC-based identity service and the end-user experience with username, phone number, email, and social sign-in, with extendable multi-language support.
Stars: ✭ 3,421 (+6742%)
Mutual labels:  oauth2
wgctl
Utility to configure and manage your WireGuard tunnels
Stars: ✭ 59 (+18%)
Mutual labels:  wireguard
cordova-spotify-oauth
🔐 Easy Spotify authentication for Cordova / PhoneGap apps
Stars: ✭ 15 (-70%)
Mutual labels:  oauth2
docker-iot-stack
💻 My personal Docker IoT Stack
Stars: ✭ 24 (-52%)
Mutual labels:  wireguard
sample-oauth2-client
Sample OAuth2 client using the GitHub API
Stars: ✭ 69 (+38%)
Mutual labels:  oauth2
terransible-wirehole
Wirehole (Wireguard, Pi-hole, Upbound) deployment on Free Tier Oracle Cloud or other providers leveraging Docker Containers and deployed using Terraform and Ansible.
Stars: ✭ 33 (-34%)
Mutual labels:  wireguard
wireguard ynh
WireGuard VPN software with a web UI configuration companion, packaged for YunoHost.
Stars: ✭ 24 (-52%)
Mutual labels:  wireguard
desktop-app
Official IVPN Desktop app
Stars: ✭ 141 (+182%)
Mutual labels:  wireguard
warpy
A command-line program to get WARP+ as WireGuard written in python
Stars: ✭ 57 (+14%)
Mutual labels:  wireguard
Simpler
Simpler是一款轻量级的第三方微博应用,具有微博的基础功能,兼有外观优雅,运行流畅,内存占用低,省电省流量等特点。
Stars: ✭ 27 (-46%)
Mutual labels:  oauth2
desktop-app-cli
Official IVPN command-line interface (CLI)
Stars: ✭ 18 (-64%)
Mutual labels:  wireguard
Slack
[READ ONLY] Subtree split of the SocialiteProviders/Slack Provider (see SocialiteProviders/Providers)
Stars: ✭ 11 (-78%)
Mutual labels:  oauth2
instagram-oauth-nodejs-server
Node.js server for Intagram-API OAuth purpose.
Stars: ✭ 12 (-76%)
Mutual labels:  oauth2
fastapi-azure-auth
Easy and secure implementation of Azure AD for your FastAPI APIs 🔒 B2C, single- and multi-tenant support.
Stars: ✭ 174 (+248%)
Mutual labels:  oauth2
remix-auth
Simple Authentication for Remix
Stars: ✭ 929 (+1758%)
Mutual labels:  oauth2

Wiresteward

Wiresteward is a wireguard peer manager with oauth2 authentication. It is comprised of two components: server and agent.

The design is for wiresteward server to run on a remote machine in a private network, to which users will connect with wireguard in order to access the private network.

The agent runs on the user's machine and is responsible for authenticating with the server and retrieving wireguard configuration.

Both components will configure their local wireguard devices and route tables as needed to enable access to a private network.

Installation

Binaries found under wiresteward releases include the agent and server modes: https://github.com/utilitywarehouse/wiresteward/releases

To install on AMD64:

os=$(uname | awk '{print tolower($0)}')
wget -O /usr/local/bin/wiresteward https://github.com/utilitywarehouse/wiresteward/releases/download/v0.2.3/wiresteward_0.2.3_${os}_amd64
chmod +x /usr/local/bin/wiresteward

Usage

You can simply run wiresteward on your terminal:

wiresteward -server -config=path-to-config.json
wiresteward -agent -config=path-to-config.json

Please note that because wiresteward will create and manage network devices and network routes, it requires NET_ADMIN capabilities. You can simply run it as root with sudo.

See examples/server.json and examples/agent.json for example configuration.

Agent

The wiresteward agent is responsible for:

  • creating new network tun devices
  • fetching oauth tokens to pass server authentication
  • registering wireguard keys with the wiresteward server and retrieving configuration
  • configuring wireguard peers
  • configuring routes for the subnets allowed by the server

It is recommended that the agent is run as a system service.

Configuration

The agent can take a config file as an argument or look for it under the default location /etc/wiresteward/config.json. The config contains details about the oauth server and the local devices that we need the agent to manage.

An example, where the config format can be found in examples/agent.json.

MTU

The default mtu for the interfaces created via the agent is 1420 and it comes from the default value of wireguard-go package. Optionally, the mtu can be set explicitly per wg device created by the agent via the configuration file (using the "mtu" key under device config)

Running as systemd service (Linux)

The agent is designed to run as a systemd service. An example working service is described in examples/wiresteward.service.

A typical location for user defined systemd service is /etc/systemd/system/wiresteward.service so you'll need to copy the unit file to that location and then:

systemctl daemon-reload
systemctl enable wiresteward.service
systemctl start wiresteward.service

To look at its logs:

journalctl -u  wiresteward.service

Running as launchd service (macOS)

An example working service for launchd is described in examples/uk.co.uw.wiresteward.plist.

You need to copy the file under /Library/LaunchDaemons/ and then set the ownership to root:

chown root:admin /Library/LaunchDaemons/uk.co.uw.wiresteward.plist

Finally, you need to load the service:

sudo launchctl load /Library/LaunchDaemons/uk.co.uw.wiresteward.plist

This will allow the service to run as root, which is required to operate on the network devices and routing table.

Logs are stored in /var/log/wirestward.log as defined in the service file. To view the logs you can simply:

tail -f /var/log/wiresteward.log

You might want to setup log rotation as well if you find that the log file grows too large.

Authentication

The agent runs a local server on port 7773 and expects the user to visit http://localhost:7773/ in order to authenticate. Once authenticated, the agent will be able to continue operating until the token retrieved is expired, at which point the user needs to authenticate again.

Visiting http://localhost:7773/ will cause the agent to immediately configure the local wireguard devices. If it already has a valid token, it will not prompt the user to re-authenticate but it will re-configure the system.

Server

The wiresteward server is responsible for:

  • creating new network wireguard device
  • registering new peers and allocating ip addresses for them
  • configuring wireguard peers
  • revoking access for expired address leases

It is recommended that the agent is run as a systemd service.

Configuration

The server can take a config file as an argument or look for it under the default location /etc/wiresteward/config.json. The config contains details about the oauth server and the network subnets that need to be exposed, as well as the network subnet from which peer addresses are leased to agents.

An example, where the config format can be found in examples/server.json.

Running

There are Terraform modules defined under terraform/ which describe the recommended deployment method in AWS and GCP. See the more specific README file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].