Live data from Hacker News

Getting Started with WireGuard

miguelmota.com

41–50 of 72 posts

Re: Getting Started with WireGuard

#41
post #22

Is there like a simpler configuration esp. for clients using windows / mac?

Mac clients can just download it from the App Store: https://apps.apple.com/us/app/wireguard/id1451685025?mt=12 It has a GUI, but you still need to understand its concepts to configure it.

Re: Getting Started with WireGuard

#42
post #14

> It’s kernel-based which reduces attack surface and can be ran in virtually any device. Excuse my ignorance, but can someone explain why a kernel based networking stack has less of an attack surface then a user-space based stack? I mean logically user-space should be more secure no?

Indeed, the author is confusing things here: - It has a vastly smaller attack surface than e.g. OpenVPN, because it is much less complex. - Its performance is improved by being kernel based. - Compatibility is helped by it being in the mainline kernel, i.e. every device shipping a recent enough kernel will be able to have it (no need to deploy/version libraries etc). These don't have anything to do with each other.

Thank you for clarifying the differences in a more understandable way. The bullet points in the post have been made more clear now.

Re: Getting Started with WireGuard

#43
post #14

Earlier quoted context omitted.

Indeed, the author is confusing things here: - It has a vastly smaller attack surface than e.g. OpenVPN, because it is much less complex. - Its performance is improved by being kernel based. - Compatibility is helped by it being in the mainline kernel, i.e. every device shipping a recent enough kernel will be able to have it (no need to deploy/version libraries etc). These don't have anything to do with each other.

But these are related, aren't they? Not trying to be pedantic or argumentative at all, just better understanding (for myself at least). Being kernel based means it cannot depend on external/3rd party libraries, which does reduce the attack surface. Of course user-land library can also be written with no other library dependencies, but I think kernel based forces this as a requirement, doesn't it (I don't know for sur…

> Being kernel based means it cannot depend on external/3rd party libraries, which does reduce the attack surface

You are conflating two independent things. An external library could be very secure or not. Same for implementing the same function internally.

Re: Getting Started with WireGuard

#47
post #39
post #38

Earlier quoted context omitted.

How is ZeroTier on dynamic allocation? Small code size is one WireGuard software security goal; minimizing dynamic allocation is the other.

It does dynamically allocate, though it always checks for success. It could be refactored not to but so far we haven't targeted devices small enough to worry about a megabyte or two of RAM. There are also checks in place to guard against memory exhaustion attacks where applicable. We just did phase I of a professional audit for V2. It was a design audit, but we're doing a code audit too. V2's code base will be a bit…

Cool! Just a thing to think about! Code size is a useful metric, especially as it improves auditability. But not having to think about object lifecycle bugs ("can this timer fire into a freed connection state block", etc) is a huge intrinsic structural win. Having an unusually clear, audited documentation of the lifecycles of all the objects in your design would also go a long way.

Re: Getting Started with WireGuard

#48

Earlier quoted context omitted.

But these are related, aren't they? Not trying to be pedantic or argumentative at all, just better understanding (for myself at least). Being kernel based means it cannot depend on external/3rd party libraries, which does reduce the attack surface. Of course user-land library can also be written with no other library dependencies, but I think kernel based forces this as a requirement, doesn't it (I don't know for sur…

> Being kernel based means it cannot depend on external/3rd party libraries, which does reduce the attack surface You are conflating two independent things. An external library could be very secure or not. Same for implementing the same function internally.

My point that you quote is about dependencies. If A depends on B, they are not independent, by definition.

Re: Getting Started with WireGuard

#49
post #13

Hm. I guess no-one has bothered with nftables yet, even when dealing with network code that's becoming part of the new upstream kernel (not just this blog, AFAIK wireguard upstream doesn't have any examples on using nftables either, just iptables). I guess we need a new networking how-to? Anyone aware of some resources I might have missed? OK, I guess the nftables wiki is the "how-to": https://wiki.nftables.org/wiki-…

IMO nftables is best used with your full ruleset defined in a file, and atomically loaded. nftables certainly does make your ruleset more grokkable than statefully appending ad-hoc rules everywhere, but you necessarily need the whole picture to gain from it.

So unfortunately it makes less sense for one-liners. Case in point: to use the masquerade action in a postrouting/nat chain, you also have to register a (possibly empty) prerouting/nat chain.

Re: Getting Started with WireGuard

#50
post #37
post #13

Hm. I guess no-one has bothered with nftables yet, even when dealing with network code that's becoming part of the new upstream kernel (not just this blog, AFAIK wireguard upstream doesn't have any examples on using nftables either, just iptables). I guess we need a new networking how-to? Anyone aware of some resources I might have missed? OK, I guess the nftables wiki is the "how-to": https://wiki.nftables.org/wiki-…

The community kind of skipped right over nftables to BPF. Simple use cases use iptables, complicated ones use BPF, nftables isn't flexible enough for the complicated use cases so everyone keeps using iptables.

even for simple cases, I prefer nftables. If for no other reason thn I think the syntax is simpler and easier to understand.
Post reply on HN