From patchwork Mon Jul 27 18:34:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Kroken X-Patchwork-Id: 1337139 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=axuJVOig; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=LKnYE71W; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BFpS25XBXz9sR4 for ; Tue, 28 Jul 2020 04:36:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Jzk0+p2ko2PAgO/ILLGDlDqM64Ob6Y1+SpQLc3yahx4=; b=axuJVOigAXrKMNosgHXoYypooo jAmluxjgqyHGH43Ij4ZofVoBkyRNUAtZ3RFLXL5O6IefCz+uXzPoWvTIVV0nE9XQ5ZnYr0iWOpRv6 xIrnKNORmlJFWRDjmHL27VvZl/CzxlUnd182P1H4DwzovCj1w0PQTH15jGb4p5Iglyu7B6o594Wy/ n/GpwehBqwsF+fp2o74zVSvYSq0bFuzNPJD91Tu+mVlPo62Ox8c2r65Q5mv1XQWXv8Jnvc+IEqae/ /XSgIA0pPss9cBr8cwSLyDJxEF2ZRzvgWV1J9z6GS2iCZaXLXfVUI4akLn8w9XKjN+gF42iuzuCZ+ 0sfJ3aug==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k07xw-0007uR-7l; Mon, 27 Jul 2020 18:35:12 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k07xt-0007tm-LL for openwrt-devel@lists.openwrt.org; Mon, 27 Jul 2020 18:35:10 +0000 Received: by mail-lj1-x229.google.com with SMTP id h19so18341420ljg.13 for ; Mon, 27 Jul 2020 11:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XexhTSD0DUthlRJoLi3U6V7avG3PhhmFqu11aN4Lfxo=; b=LKnYE71WWjNTsQNwXLEXrbqDHX5E6xV0K57WKIZkIddGxJYfC3lOUjlyCuMJZ+OKuD FbilEBQGIArv/cXgkFYJ3knxat9WUMfIlAFEfe6RQbJwjEV7gCm6aV3f18FEPcJ3fyqU cBl4gg3aJ6lsSWnq7wvucgjTv/Pvav5wjhiCgGgX+PKH+LrmgVdQMgeqoN+LJHhKFrkw fwbd5Xd7kV4HPUJXCHo0hIeyAqOiJoe9+ASN0u6lQrwLNsoyRU1i7wujKZIK52mpdwng Sj8G8cNYuv+8OkHRDwr6IYHn8b5+4JTtmvkXcSk2ZK5ei/qoM3bWOLu8brwy6Jjhg4jq 7ZNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XexhTSD0DUthlRJoLi3U6V7avG3PhhmFqu11aN4Lfxo=; b=c9pCiYEvOm9WuaLz7uMkq42yR/t3HbTrvnjp9nvwC7kHsN8Mn0BBnPKxwG2SnQF/h9 PyRoLgq9PjS7NmJMzAjmngXVptGQF9ULZ8qyQ/Z+3U/+tXQO1MC1lwnczrqiN1jPavRQ Z25+BT1xbbhfeMwUDYwsGYXBHZEfSLVlb96ASIErgrCkZ2S7PZFnIHU1YPoR9Y1ulQ5c NKMP9RJTP2Z91eRMUQzsvFv6EVizK1U7A5bC1W0HGZ4jojkUmrfjeaa7G3xmLOthoxW4 y3LMxMF3IEUUMoxv1CoyRe/iAhHzPuPfHUJ9MQM3DOiCalydE4sRtwWmoE+nGcsD/O1N +dxg== X-Gm-Message-State: AOAM532Byb6UVu/IDrGdhTic/bEeE6r9WjEtVfIvRz8jEDLTezo3YfPG hY/YfMYdHet2Fy5bzJUw7QJUyA0L X-Google-Smtp-Source: ABdhPJwd1BJ2b2xryiEsBpI8a/+oWFwUO3cvOIvFtzvwOrjlEyRtnRxQ5hgMeEH8KWwVeFUM06XU9Q== X-Received: by 2002:a2e:b554:: with SMTP id a20mr10049107ljn.108.1595874905552; Mon, 27 Jul 2020 11:35:05 -0700 (PDT) Received: from localhost.localdomain (209.89-10-150.nextgentel.com. [89.10.150.209]) by smtp.gmail.com with ESMTPSA id e12sm2500215ljk.74.2020.07.27.11.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 11:35:04 -0700 (PDT) From: Magnus Kroken To: openwrt-devel@lists.openwrt.org Subject: [PATCH] openvpn: revise sample configuration Date: Mon, 27 Jul 2020 20:34:49 +0200 Message-Id: <20200727183449.1749-1-mkroken@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_143509_741387_6C067212 X-CRM114-Status: GOOD ( 20.13 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:229 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mkroken[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Magnus Kroken Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Update the openvpn sample configurations to use modern options in favor of deprecated ones, suggest more sane default settings and add some warnings. * Add tls_crypt and ncp_disable to the sample configuration * Replace nsCertType with remote_cert_tls in client sample configuration * Comment out "option compress", compression should not be preferred * Advise 2048-bit Diffie-Hellman parameters by default * Add warnings about compression and use of Blowfish (BF-CBC) Signed-off-by: Magnus Kroken --- .../services/openvpn/files/openvpn.config | 83 +++++++++++++++++-- 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/package/network/services/openvpn/files/openvpn.config b/package/network/services/openvpn/files/openvpn.config index 1fd846f558..3de1881e35 100644 --- a/package/network/services/openvpn/files/openvpn.config +++ b/package/network/services/openvpn/files/openvpn.config @@ -77,10 +77,10 @@ config openvpn sample_server # Diffie hellman parameters. # Generate your own with: - # openssl dhparam -out dh1024.pem 1024 + # openssl dhparam -out dh2048.pem 2048 # Substitute 2048 for 1024 if you are using - # 2048 bit keys. - option dh /etc/openvpn/dh1024.pem + # 1024 bit keys. + option dh /etc/openvpn/dh2048.pem # Configure server mode and supply a VPN subnet # for OpenVPN to draw client addresses from. @@ -228,10 +228,52 @@ config openvpn sample_server # This file is secret: # option tls_auth "/etc/openvpn/ta.key 0" + # For additional privacy, a shared secret key + # can be used for both authentication (as in tls_auth) + # and encryption of the TLS control channel. + # + # Generate a shared secret with: + # openvpn --genkey --secret ta.key + # + # The server and each client must have + # a copy of this key. + # + # tls_auth and tls_crypt should NOT + # be combined, as tls_crypt implies tls_auth. + # Use EITHER tls_crypt, tls_auth, or neither option. +# option tls_crypt "/etc/openvpn/ta.key" + + # Set the minimum required TLS protocol version + # for all connections. + # + # Require at least TLS 1.1 +# option tls_version_min "1.1" + # Require at least TLS 1.2 +# option tls_version_min "1.2" + # Require TLS 1.2, or the highest version supported + # on the system +# option tls_version_min "1.2 'or-highest'" + + # OpenVPN versions 2.4 and later will attempt to + # automatically negotiate the most secure cipher + # between the client and server, regardless of a + # configured "option cipher" (see below). + # Automatic negotiation is recommended. + # + # Uncomment this option to disable this behavior, + # and force all OpenVPN peers to use the configured + # cipher option instead (not recommended). +# option ncp_disable + # Select a cryptographic cipher. # This config item must be copied to # the client config file as well. - # Blowfish (default): + # + # To see all supported ciphers, run: + # openvpn --show-ciphers + # + # Blowfish (default for backwards compatibility, + # but not recommended due to weaknesses): # option cipher BF-CBC # AES: # option cipher AES-128-CBC @@ -241,11 +283,16 @@ config openvpn sample_server # Enable compression on the VPN link. # If you enable it here, you must also # enable it in the client config file. + # + # Compression is not recommended, as compression and + # encryption in combination can weaken the security + # of the connection. + # # LZ4 requires OpenVPN 2.4+ client and server # option compress lz4 # LZO is compatible with most OpenVPN versions # (set "compress lzo" on 2.4+ clients, and "comp-lzo yes" on older clients) - option compress lzo +# option compress lzo # The maximum number of concurrently connected # clients we want to allow. @@ -371,7 +418,7 @@ config openvpn sample_client option key /etc/openvpn/client.key # Verify server certificate by checking - # that the certicate has the nsCertType + # that the certicate has the key usage # field set to "server". This is an # important precaution to protect against # a potential attack discussed here: @@ -381,12 +428,27 @@ config openvpn sample_client # your server certificates with the nsCertType # field set to "server". The build_key_server # script in the easy_rsa folder will do this. -# option ns_cert_type server +# option remote_cert_tls server # If a tls_auth key is used on the server # then every client must also have the key. # option tls_auth "/etc/openvpn/ta.key 1" + # If a tls_crypt key is used on the server + # every client must also have the key. +# option tls_crypt "/etc/openvpn/ta.key" + + # Set the minimum required TLS protocol version + # for all connections. + # + # Require at least TLS 1.1 +# option tls_version_min "1.1" + # Require at least TLS 1.2 +# option tls_version_min "1.2" + # Require TLS 1.2, or the highest version supported + # on the system +# option tls_version_min "1.2 'or-highest'" + # Select a cryptographic cipher. # If the cipher option is used on the server # then you must also specify it here. @@ -395,10 +457,15 @@ config openvpn sample_client # Enable compression on the VPN link. # Don't enable this unless it is also # enabled in the server config file. + # + # Compression is not recommended, as compression and + # encryption in combination can weaken the security + # of the connection. + # # LZ4 requires OpenVPN 2.4+ on server and client # option compress lz4 # LZO is compatible with most OpenVPN versions - option compress lzo +# option compress lzo # Set log file verbosity. option verb 3