Categories
Self-Hosted Access Control Firewall Remote Access Network Security WireGuard VPN Multi-Factor AuthenticationStars
Forks
Watchers
Developer links
Wag
Wag is an authentication gateway for WireGuard that lets each device reach only the routes it should, and asks for a second factor before the sensitive ones open. Admins write access policies for everyone, groups, or single users, marking subnets, hosts, ports, and protocols as MFA-required, always allowed, or denied, and the most specific prefix wins, so one allowed address can sit inside a protected range. Devices join with a registration token, and the public endpoint answers with a finished WireGuard profile. Users then confirm a TOTP code, a WebAuthn security key, an OIDC single sign-on login that maps identity provider groups into Wag groups, or a PAM prompt, and repeated failures lock the account. Session lifetime and idle timeouts decide when they must prove themselves again. The browser portal lists users, devices, rules, registration tokens, and webhooks with real-time notifications, while a command line locks devices, resets MFA, and manages administrators. Webhooks turn JSON from an HR or identity system into new tokens or removed users and devices, and clients can fetch the list of guarded routes from a small API. Remote staff, contractors limited to one host, and homelabs are typical uses. When a server fails, the VPN remains reachable through clustering with witness nodes or an external etcd, and certificates arrive through ACME with HTTP-01 or Cloudflare DNS-01. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. BSD-3-Clause licensed.
Benefits
- Second Factor For Sensitive Routes
- Only the networks you mark as protected ask for TOTP, a security key, OIDC login, or PAM, so everyday traffic stays fast while critical systems get real authentication.
- Least-Privilege VPN Access Policies
- Groups and subnet-based rules decide which hosts, ports, and protocols each person can reach, and the most specific rule wins, so contractors never see more than they need.
- Automated Device Enrolment And Offboarding
- Registration tokens return a finished WireGuard profile over a simple API, and webhooks can create or remove users automatically, which keeps onboarding and offboarding off your to-do list.
- Redundancy That Keeps Users Connected
- Embedded etcd clustering replicates users, devices, and rules across nodes, with optional witness nodes or an external etcd, so one failed server does not lock everyone out of the VPN.
Features
- Route-Based MFA Policies
- Define MFA-required, public, and denied routes per user or group by subnet, port, and protocol, with the most specific prefix taking precedence.
- Multiple Authentication Methods
- Users prove identity with TOTP, WebAuthn security keys, OIDC single sign-on with group mapping, or PAM, and repeated failures lock the account automatically.
- Web Administration Portal
- Manage users, devices, rules, registration tokens, webhooks, and cluster members from a browser, with live updates and notifications as events happen.
- Webhook And API Automation
- Webhooks map JSON payloads from external systems to create tokens or delete users and devices, while public and tunnel APIs let clients fetch configs and guarded routes.
- Automatic TLS Certificates
- Built-in ACME support obtains Let's Encrypt certificates for the portals using HTTP-01 or Cloudflare DNS-01 challenges, or you can load your own certificate files.
- Command Line Management
- A local control socket powers commands for starting the server, creating registration tokens, locking or unlocking devices and accounts, resetting MFA, and managing web administrators.