From patchwork Wed Jul 28 02:41:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1891 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2L4fOqNQAWGxaQAAIUCqbw (envelope-from ) for ; Wed, 28 Jul 2021 08:42:11 -0400 Received: from proxy15.mail.ord1d.rsapps.net ([172.30.191.6]) by director14.mail.ord1d.rsapps.net with LMTP id UDO2OaNQAWHBKwAAeJ7fFg (envelope-from ) for ; Wed, 28 Jul 2021 08:42:11 -0400 Received: from smtp1.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.ord1d.rsapps.net with LMTPS id SJ1tOaNQAWFCWwAAAY1PeQ (envelope-from ) for ; Wed, 28 Jul 2021 08:42:11 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp1.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 39ef76dc-efa1-11eb-a32d-5254002d775b-1-1 Received: from [216.105.38.7] ([216.105.38.7:38402] helo=lists.sourceforge.net) by smtp1.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C0/FB-12483-2A051016; Wed, 28 Jul 2021 08:42:11 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1m8is8-000728-I2; Wed, 28 Jul 2021 12:41:16 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1m8is6-000721-RL for openvpn-devel@lists.sourceforge.net; Wed, 28 Jul 2021 12:41:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9r5oVQL2m9c3KpYKdFSAs4uJyu6uyZK0TqSIFrqgqYc=; b=ejqKvjR4vGZMh8gbVhi7KguRU5 Os6fSfRtnY1YXaIBCGDtn/OCfiZi/A6ckeqV3o9aBN0orGqFxbexxXysWfKkPKEPtfHM/q/qL8PRC LxoUgdtp9yYMzGLbbUnFMZ6oNdIFbPI6Wn52yU0CPUS6aeDneofNLYxaYHdUILapsF48=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9r5oVQL2m9c3KpYKdFSAs4uJyu6uyZK0TqSIFrqgqYc=; b=Hq9anm+0zv2BVsV7Wug+sJnP78 Gq76Gx6Jx6+kUZ8lfKevD2KM9ptjZ2sQ/OW8TeEDICqR3eSHs4nTpGAK2kqIgI6ZrP/juTIVy/G6M squ5ulry6aOf33890pc44iHI6ToxIQUUA71I2e0ci+d5jACr50iI34KotmgcUZq2QipA=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1m8is1-00037M-Qg for openvpn-devel@lists.sourceforge.net; Wed, 28 Jul 2021 12:41:14 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94.2 (FreeBSD)) (envelope-from ) id 1m8iru-0001rT-LN for openvpn-devel@lists.sourceforge.net; Wed, 28 Jul 2021 14:41:02 +0200 Received: (nullmailer pid 565191 invoked by uid 10006); Wed, 28 Jul 2021 12:41:03 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 28 Jul 2021 14:41:03 +0200 Message-Id: <20210728124103.565145-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210716121848.67888-1-arne@rfc2549.org> References: <20210716121848.67888-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1m8is1-00037M-Qg Subject: [Openvpn-devel] [PATCH v2] Introduce webauth auth pending method and deprecate openurl X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox The experience with openurl/OPEN_URL has shown that just sending a URL to a client is not enough and we often need different behaviour of the client depending on circumstances. Replace OPEN_URL with a more flexible WEB_AUTH pending auth method. Patch v2: use WEB_AUTH instead WEBAUTH Signed-off-by: Arne Schwabe --- doc/management-notes.txt | 41 ++++++++++++++++++++++++++----------- include/openvpn-plugin.h.in | 2 +- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/doc/management-notes.txt b/doc/management-notes.txt index c20344298..d794a4a98 100644 --- a/doc/management-notes.txt +++ b/doc/management-notes.txt @@ -645,11 +645,11 @@ Before issuing a client-pending-auth to a client instead of a client-auth/client-deny, the server should check the IV_SSO environment variable for whether the method is supported. Currently defined methods are crtext for challenge/response using text -(e.g., TOTP), openurl and proxy_url for opening a URL in the client to -continue authentication. A client supporting the first two methods would -set +(e.g., TOTP), openurl (deprecated) and webauth for opening a URL in +the client to continue authentication. A client supporting webauth and +crtext would set - setenv IV_SSO openurl,crtext + setenv IV_SSO webauth,crtext The variable name IV_SSO is historic as AUTH_PENDING was first used to signal single sign on support. To keep compatibility with existing @@ -668,33 +668,50 @@ notification as where {EXTRA} is formatted as received from the server. Currently defined formats for {EXTRA} are detailed below. -openurl -======== +webauth and openurl +=================== For a web based extra authentication (like for SSO/SAML) {EXTRA} should be OPEN_URL:url -and client should ask the user to open the URL to continue. +or + + WEB_AUTH:flags:url + +The OPEN_URL method is deprecated as it does not allow to send flags which +proved to be needed to signal certain behaviour to the client. + +The client should ask the user to open the URL to continue. The space in a control message is limited, so this url should be kept short to avoid issues. If a longer url is required a URL that redirects -to the longer URL should be sent instead. +to the longer URL should be sent instead. The total length is limited to 1024 +bytes which includes the INFO_PRE:WEB_AUTH:flags. + +flags is a list of flags which are separated by commas. Currently defined +flags are: + +- proxy (see next pargraph) +- hidden start the webview in hidden mode (see openvpn3 webauth documentation) +- external Do not use an internal webview but use an external browser. Some + authentication providers refuse to work in an internal webview. + A complete documentation how URLs should be handled on the client is available in the openvpn3 repository: https://github.com/OpenVPN/openvpn3/blob/master/doc/webauth.md -proxy_url -======== -This is a variant of openurl that allows opening a url via an +webauth with proxy +================== +This is a variant of webauth that allows opening a url via an HTTP proxy. It could be used to avoid issues with OpenVPN connection's persist-tun that may cause the web server to be unreachable. The client should announce proxy_url in its IV_SSO and parse the PROXY_URL message. The format of {EXTRA} in this case is - PROXY_URL:::::url + WEB_AUTH:proxy=;;;,flags:url The proxy should be a literal IPv4 address or IPv6 address enclosed in [] to avoid ambiguity in parsing. A literal IP address is preferred as DNS might not be diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in index abbfd9c2a..28b845af1 100644 --- a/include/openvpn-plugin.h.in +++ b/include/openvpn-plugin.h.in @@ -573,7 +573,7 @@ OPENVPN_PLUGIN_DEF openvpn_plugin_handle_t OPENVPN_PLUGIN_FUNC(openvpn_plugin_op * auth_pending_file is * line 1: timeout in seconds * line 2: Pending auth method the client needs to support (e.g. openurl) - * line 3: EXTRA (e.g. OPEN_URL:http://www.example.com) + * line 3: EXTRA (e.g. WEBAUTH::http://www.example.com) * * In addition the OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER and * OPENVPN_PLUGIN_CLIENT_CONNECT_DEFER_V2 are called when OpenVPN tries to