News for hackers. Stuff that matters.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by jamal-kumar on Friday October 01, 2021 @07:14PM (#28724454)
I think it's worth knowing how simple and easy it is to set up wireguard when you don't need a web UI or any of that other fluff on there. Every computer running linux on a recent enough kernel can do it on a completely clean base install -- I figure a lot of the appeal for me is that I'm not introducing any risks on my system by installing extraneous packages. Means less maintenance whenever those have to be updated for security problems, meaning we get to bird two stones with one kill. Can be set up with nothing more than the shell and vi. It's right in entrypoint.sh[1] and some dockerfiles - set up firewall; set up wireguard devices, keys and configs; set up dnsmasq. Three simple steps on linux or openbsd (Not sure if FreeBSD ever got past that integration issue yet)

[1] https://github.com/subspacecommunity/subspace/blob/master/en...

I think it's also worth mentioning this works even better than openvpn as a client on windows and my phones!

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by xxpor on Friday October 01, 2021 @08:24PM (#28724833)
Setting up the FW and routing is not trivial for anyone who hasn't had to deal with that aspect of Linux before. 99% of people are going to want a straightforward tunnel that simply forwards everything to the default route table of the server. Which is of course what the linked script does. But even experienced devs are doing to have no idea what the heck a prerouting chain or a masquerade rule does.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by 3np on Saturday October 02, 2021 @02:08AM (#28726366)
I've done that journey.

At least for me, a major issue turned out to the abstractions (like wg-quick, ufw, network-manager, openwrt) which on one hand obscure the inner workings but at the same time are limited enough that at some point you will be forced to dig deeper. They also don't always play nicely together wrt routes, routing polices and *tables rules.

I wasted so much time (probably weeks, added together) in my younger days banging my head against the wall with Linux networking. Throwing out other high-level tools/frameworks and starting "from scratch" on CentOS/Rocky/Debian with only systemd-networkd and nftables has now made me mostly comfortable and I finally feel in control of the networking stack on my Linux boxes. I say "mostly" because, well, Docker and CNI...

Oh, and see my sibling comment.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by jamal-kumar on Tuesday October 05, 2021 @11:18AM (#28760611)
Just use OpenBSD, so much of that crap just gets out of the way because it was never glued on without anyone asking. For routing stuff like VPNs and routers especially this becomes my first choice, unless we're really needing to hit gigabit speeds... Try fresh air for once!
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by 3np on Saturday October 02, 2021 @01:49AM (#28726289)
Two things I learned that were game-changers in setting up and managing Wireguard on Linux:

* The semantics and behavior of AllowedIPs. In itself, it means what IPs are allowed to be routed through the tunnel (that is, IPs "on the other end"). wg-quick will, additionally, add routes to these, but that's not part of Wireguard itself.

* systemd-networkd has native support for Wireguard netdevs and networks. It's pretty easy to set up and makes it a lot more flexible; it won't add routes to AllowedIPs like wg-quick but you can define the routes (and routing policies and tables) you want in the same file. [0]

As much flak as systemd gets, systemd-networkd has by far been the most sane way for me to manage networking on Linux, and I tried most.

I'd also like to take the opportunity to recommend nftables instead of iptables. Unless you already have good reasons to prefer iptables, nftables is so much easier to learn and manage.

Oh, and ufw gets ugly real fast. Managing it through ansible or similar is a real mess. firewalld is a lot more predictable IMO. Its routing story is not perfect but it's the best I found so far and can be complemented with ip and manual nftables rules[2].

[0]: https://manpages.debian.org/buster/systemd/systemd.netdev.5....

[1]: https://wiki.archlinux.org/title/WireGuard#systemd-networkd

[2]: https://serverfault.com/a/1046246

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by sandworm101 on Friday October 01, 2021 @11:31PM (#28725711)
I'm a linux user and I want plenty more than just a VPN connection. I want the icon that tells me the VPN is connected. I want the GUI that lets me manage which server I am connecting to and which servers are the most loaded at a particular moment. I want to control from which country my traffic appears on the public internet. I want the little graph showing me that my traffic is indeed flowing over the VPN service. I want a kill switch daemon ready to cut off my traffic should the VPN connection fail. And I want all of that without having to edit any scripts.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by 8K832d7tNmiQ on Friday October 01, 2021 @11:38PM (#28725744)
Then you should've known that KDE already have wireguard applet implemented in their network manager already in version 5.21 while Gnome is on a track and just waiting to be merged.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by johnchristopher on Saturday October 02, 2021 @02:02AM (#28726343)
Does KDE network manager still delete the VPN entry at the end of the setting up process if there is an error in the config ?

Anyway, I was just looking how to add a WG VPN entry in kubuntu 18.04 but its version of KDE is a bit behind so CLI it is.

I'd settle for an independent KDE widget though.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by johnchristopher on Saturday October 02, 2021 @02:32PM (#28730862)
FFS, they still do and what's worse is that bringing up the VPN manually on the command line trigger a notification and a temporary vpn entry in the network panel. But it disappears when bringing down the VPN.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by erk__ on Saturday October 02, 2021 @03:13AM (#28726659)
Freebsd got past the issues by rewriting it, although it is not yet in a stable release will probably wait until 13.1
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by tveita on Friday October 01, 2021 @03:53PM (#28722693)
Subspace is a similar project which is also quite easy to set up.

https://github.com/subspacecommunity/subspace

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by gertrunde on Friday October 01, 2021 @06:39PM (#28724121)
That is nice to see, I was looking at subspace last week and the last commit to https://github.com/subspacecloud/subspace had led me to believe it had withered and died, I was guessing due to the primary backing company having died?

So it is quite nice to see that it is living on as a fork.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by tyingq on Friday October 01, 2021 @05:11PM (#28723421)
There seems to be a relative explosion in end-user deployable overlay networks in the last few years. I wonder how many, especially non-tech companies, have end users routing the outside world in without company permission.

I know it's not rocket science to watch for each one, or be more sophisticated with deep packet inspection. But, I've worked at some old stodgy companies, and I'm reasonably sure they aren't really watching for it in a lot of places.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by iso1210 on Friday October 01, 2021 @06:00PM (#28723852)
This has been a threat for 20+ years, certainly everyone I worked with had outgoing ssh tunnels through the socks proxy, with reverse port forwarding, back then.

If your network is reliant on a high firewall and nothing inside, you've already lost.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by tyingq on Friday October 01, 2021 @06:07PM (#28723909)
Yes, I'm not saying it is a new threat. Just a broader threat now that there's a lot of ready made solutions that can run in user space. And in some cases, like this one, have very newbie friendly UIs.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by Spooky23 on Friday October 01, 2021 @06:18PM (#28723991)
Depends on the company. Stuff like Crowdstrike and the more advanced Defender service spot this sort of thing.

SSH is probably the best one, especially as you can usually get policy exceptions to access cloud resources.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by stormbrew on Friday October 01, 2021 @02:42PM (#28722040)
I would kill for this but integrated into home assistant. There is a wireguard add on but it's really limited and requires going in by ssh to get people's qr codes.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by lostlogin on Friday October 01, 2021 @08:06PM (#28724749)
The web GUI looks a little like Home Assistant, or ESPHome.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by c7DJTLrn on Friday October 01, 2021 @07:26PM (#28724538)
Anyone know of good tools for using WireGuard in large server fleets? I'm currently trying to pitch an alternative to OpenVPN at work, paid solutions being pretty much out of the question. ZeroTier (w/ open license network controller) might work but it doesn't look like mutual authentication is supported. Ideally we'd like to use X509 auth which OpenVPN is already capable of...
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by tptacek on Friday October 01, 2021 @09:41PM (#28725259)
This is a big part of the problem Tailscale solves. If I was managing a large fleet and already had an auth infrastructure, I'd almost certainly just use it. (Tailscale is WireGuard, plus NAT traversal, plus user management, plus OIDC, plus UI. It's pretty magical.)
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by c7DJTLrn on Saturday October 02, 2021 @10:23AM (#28728786)
I would imagine it's too costly. We have thousands and thousands of machines and we're really not willing to pay anything to solve this, as nice as Tailscale would be.

Frustratingly there's no real "Enterprise" plan on their site, it's another one of those "get in touch" plans that I don't have the energy or time for. Guys at Tailscale, please just list an actual damn enterprise option so I can get an idea of how much it's going to cost if I push for this at work.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by dadrian on Tuesday October 05, 2021 @01:19PM (#28762432)
Tailscale charges by user, not by machine. As does nearly every piece SaaS software today.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by jamal-kumar on Friday October 01, 2021 @07:41PM (#28724633)
A quick google search for mutal authentication and wiregurd comes up with the whitepaper[1]:

“It uses a single round trip key exchange, based on NoiseIK, and handles all session creation transparently to the user using a novel timer state machine mechanism. Short pre-shared static keys—Curve25519 points—are used for mutual authentication in the style of OpenSSH. The protocol provides strong perfect forward secrecy in addition to a high degree of identity hiding. Transport speed is accomplished using ChaCha20Poly1305 authenticated-encryption for encapsulation of packets in UDP. An improved take on IP-binding cookies is used for mitigating denial of service attacks, improving greatly on IKEv2 and DTLS’s cookie mechanisms to add encryption and authentication”[13]

Furthermore the email it's introduced with[2]:

`Second, WireGuard uses something based on the Noise Protocol Framework (in Noise_IK) for key agreement and handshake, rather than, say, relegating to a userspace daemon. The reason, again, is massive simplicity and security savings. The Noise_IK handshake is extremely simple, and tight integration between the handshake and the transport layer allows WireGuard itself to handle all session-state and connection-state and so-forth, making the whole process appear "stateless" to the administrator (you set it up with `wg`, and then it _just works_). There is no x509, no ASN.1, no huge complexity; the user configures the public keys, and then the rest is taken care of. Other configuration frameworks (based on x509 or SSL or LDAP or whatever you want) can then build on top of this in userspace, if that sort of thing is desired. But the basic handshake fundamentals are left to WireGuard. This is more or less similar to SSH, which cares about the authorized_keys file.`

It looks like some solutions for key management have sprouted up, check trustgrid[3] and locksmith [4]

[1] https://www.wireguard.com/papers/wireguard.pdf [2] https://lwn.net/Articles/693015/ [3] https://trustgrid.io/wireguard-for-the-enterprise/ [4] https://github.com/the-maldridge/locksmith

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by isaack on Saturday October 02, 2021 @09:05AM (#28728260)
Have you looked into https://github.com/slackhq/nebula? It uses X509 cert for auth.

Although for my home lab, using X509 is more of a minus than a plus due to complexity involved.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by psanford on Saturday October 02, 2021 @09:57AM (#28728598)
Nebula uses public key certificates, but they are not x509. The nebula certificate format uses protobuf for its encoding.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by probotect0r on Friday October 01, 2021 @03:38PM (#28722549)
Has anyone used this for internal company VPN for accessing resources on something like AWS VPC?
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by arcticfox on Friday October 01, 2021 @03:51PM (#28722665)
Not this specifically, but I use Tailscale for this use-case (as far as I can tell they're similar solutions) and it's fantastic
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by nirav72 on Friday October 01, 2021 @04:36PM (#28723152)
I second this. Tailscale is great. However, if you're someone that prefers a selfhosted option (and open source) - there is HeadScale. It lets you run your own coordination server locally.

https://github.com/juanfont/headscale

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by probotect0r on Sunday October 03, 2021 @11:47PM (#28742853)
Unfortunately I can't justify a paid option right now, and I need to be able to support at least 5 to 10 users. Otherwise I would jump on it, it's very good.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by lostlogin on Friday October 01, 2021 @08:03PM (#28724733)
Tailscale is incredible in its ease of use. So much so that I got scared and turned it off.

I need to read more then be brave.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by cybrox on Saturday October 02, 2021 @01:41AM (#28726250)
Kinda, we've been using wg on multiple servers (~10 atm) across two different networks to aggregate monitoring data from each.

Works like a charm so far, we provision them all via Ansible and use iptables to only allow access to metric endpoints via the wg0 interface.

So far, we haven't had a single issue in 6 months.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by jakemauer on Friday October 01, 2021 @07:40PM (#28724626)
Does anyone have recommended newbie guides for setting up wireguard when all you have experience with is older L2TP Server/Client setups?
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by johnchristopher on Saturday October 02, 2021 @02:04AM (#28726350)
In addition to what was already posted: https://www.linuxbabe.com/debian/wireguard-vpn-server-debian

I find this one quite easy to follow, you can skip the dns part if you just want to check out if it works.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by jamal-kumar on Friday October 01, 2021 @07:42PM (#28724647)
https://www.wireguard.com/quickstart/

set up firewall; set up wireguard devices, keys and configs; set up dnsmasq.

I'd look up one specific to your particular distro, though. There are differences in how network devices are managed.

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by liuliu on Friday October 01, 2021 @02:34PM (#28721955)
How permission works (especially from Docker?)? I remember `wg-quick up` requires `sudo` to bring up the WG network interface.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by stormbrew on Friday October 01, 2021 @02:44PM (#28722059)
says in the readme basically:

  --cap-add NET_ADMIN \
  --device /dev/net/tun:/dev/net/tun \
that's giving it permission to administer the tunnel devices.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by oauea on Friday October 01, 2021 @02:42PM (#28722047)
> --cap-add NET_ADMIN

> --device /dev/net/tun:/dev/net/tun

Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by johnchristopher on Friday October 01, 2021 @06:26PM (#28724039)
Nice, I had forgotten about wireguard GUI but now that I have upgraded some VPS to Debian 11 I can use it without hassle.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by 1cvmask on Friday October 01, 2021 @09:02PM (#28725067)
Is there a way to add MFA to this or should it be done if there is OIDC?
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by coretx on Friday October 01, 2021 @06:19PM (#28723997)
Don't click if you hate yet another npm *
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by krupan on Friday October 01, 2021 @06:06PM (#28723904)
If it's a single binary why do I need docker?
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by lostlogin on Saturday October 02, 2021 @04:01PM (#28731565)
For me, rolling everything into a docker-compose.yaml makes installs near instant.
Re:Wg-access-server: An all-in-one WireGuard VPN solution wi... by ducktective on Saturday October 02, 2021 @04:31AM (#28727031)
Why is this guy downvoted without a single reply?