1. 22
  1. 11

    Thanks for the nice and complete write-up!

    I noticed a few minor issues with the server and client configuration files:

    • You might want to set up a CRL (certificate revocation list) and use the crl-verify directive in the server config file to revoke client certificates in case of a compromise.
    • OpenVPN 2.4.0 ships with with the new compress option lz4-v2, which is undocumented. It seems to use less CPU, drain less power on mobile devices, and it possibly has a higher throughput according to this ticket.
    • There’s no need to specify push "compress lz4" in the server config file if the client config file has its own compress directive.
    • There’s no need to specify a key-direction (0 or 1) after tls-crypt’s keyfile path according to the manpage: “In contrast to –tls-auth, –tls-crypt does not require the user to set –key-direction.”

    I usually bundle all the certificates and keys along with the client configuration in a .ovpn file, which I find easier to transfer around and use.

    1. 2

      Thank you very much for your feedback! I will update the article when I will have some time.

      About the compression part, I learnt it is now considered as unsecured thanks to voracle vulnerability, I will probably explain it briefly and disable in the configuration offered because security is the first criteria.

      Thank you very much for your feedback again :)

      1. 0

        The article is now edited, I added a lot of things, feel free to read it again.

    2. 7

      I’ve used OpenVPN for years, but the whole setup and maintenance process looks outdated. Recently started using Wireguard[1] in production which is quick to set up and hardly requires any maintenance. It also works well in containerized world.

      [1] - https://www.wireguard.com

      1. 3

        Unfortunately there’s not yet kernel support for Wireguard, so maintenance is higher than it would be otherwise (e.g. dependence upon wireguard maintainer keeping out of tree module up to date for latest kernels, and you (or your distro) having to build it out of tree).

        It seems like he’s close to getting it merged though, so I’m holding out for that!

        1. 4

          wireguard-go might also be usable, if maximum performance is not required. I wouldn’t think it would be any slower than openvpn, which is also user-space.

          1. 1

            Most distributions provide a kernel module since years. The burden of maintaining such a tiny piece of code is moderate and it does not impact admin and end users.

            1. 1

              Maybe in this one specific case, but I’ve been burned in the past by relying on an out of tree module (or set of patches), only to have the developer lose interest, sell out, whatever. (e.g. grsec). It’s rare I suppose, but the burden on users and admins is high when it does happen.

              (the same fate could happen to patches/modules in the tree, but it’s much more rare)

          2. 1

            I do not think you can compare now Wireguard and OpenVPN in term of reliability. Wireguard is still something new, does not be audited by security team yet and does not have a strong maintainability process. A little quote from the authors:

            As of June 2018 the developers of WireGuard advise treating the code and protocol as experimental, and caution that they have not yet achieved a stable release compatible with CVE tracking of any security vulnerabilities that may be discovered.[7][8]

            1. 3

              WireGuard has received formal verification from the developers [1], audited by [2], and reviewed by kernel developers and distributions that ship the kernel module. I don’t have numbers on the number of reviewers versus SLOC count but I suspect it could be much higher than OpenVPN given the size of WireGuard

              [1] https://www.wireguard.com/papers/wireguard-formal-verification.pdf

              [2] https://courses.csail.mit.edu/6.857/2018/project/He-Xu-Xu-WireGuard.pdf

              1. 2

                They’re saying that because they’re trustworthy, security folks. We always advise to say don’t trust it until proven otherwise with strong review and/or verification. There’s been some impressive results in verifying Wireguard on top of the fact that it’s so much smaller than competing implementations.

                For now, I’ll just give you this article for some nice comparisons. Also, that article says OpenVPN is about 600,000 lines of code. The most-secure systems were thousands to tens of thousands of lines of code because smaller systems are easier to bulletproof. I don’t need to look at OpenVPN’s security advisories to know it will have more errors with more complexity.

            2. 2

              The CRL procedure should be documented also. I came across a team who assumed that deleting the certification from “key” directory was enough to lock out users. Additionally an explanation of the meaning of flags found in the “index.txt” would be nice :-)

              Addendum: another part that I find missing and misunderstood by admin teams is the”proper” way of certification creation. Users should issue a CSR and have it signed. Most real world uses I came across, the admin just issues everything and sends the OVPN file. Very common anti-pattern.

              I wanted to write an article about the entire lifecycle of openvpn and user management. Yours is close though.

              Nice job nevertheless!

              1. 2

                It is now documented, thank you.

                1. 1

                  bookmarked, thanks for sharing! :)

                2. 2

                  I totally agree, I will update it when I have some time. Thank you for your comment :)

                3. 2

                  It would be quite useful if the article explained why they are doing things a certain way, why you should copy and paste this particular config. It’s not that I don’t trust them, but I’d prefer to have the illusion of understanding the configurations I piece together.

                  1. 2

                    The --auth option is not used when you use --tls-crypt and AES-256-GCM according to the OpenVPN manual page. What I did is set its value to none.

                    1. 1

                      It is perfectly true, thank your for your comment, I edited the configuration.

                    2. 1

                      Why use easyrsa over, for example, GnuPG, which is probably already installed?

                      1. 1

                        I use easyrsa because it is the tool recommended by OpenVPN and developped by them. It is also really easy to use even if it does not provide the best algorithms available.

                      2. 1

                        It has been about a year now. Is this guide still valid?

                        1. 1

                          It is, very few things change and I updated it.