Skip to content

Commit ea545a0

Browse files
committed
[PATCH] Introduce external-auth flag to make client-side authentication methods optional
1 parent 91eb460 commit ea545a0

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

doc/man-sections/client-options.rst

+17
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,23 @@ configuration.
8787
The server configuration must specify an ``--auth-user-pass-verify``
8888
script to verify the username/password provided by the client.
8989

90+
--external-auth
91+
This client-only option indicates that user authentication options in the
92+
client configuration are not mandatory. For security reasons, OpenVPN
93+
requires client-side credentials such as client certificates or a
94+
username/password combination. The OpenVPN server has the capability to
95+
delegate authentication to external systems using the WEBAUTH protocol.
96+
In such cases, client credentials may be omitted.
97+
98+
***Security Considerations***
99+
100+
When the ``--external-auth`` option is enabled in OpenVPN, it bypasses the
101+
check that some form of user authentication method is specified. This
102+
configuration can potentially create a risky environment where an OpenVPN
103+
server operates without requiring authentication. If you opt to utilize
104+
``--external-auth``, it's crucial to thoroughly validate that the OpenVPN
105+
server has been adequately secured.
106+
90107
--auth-retry type
91108
Controls how OpenVPN responds to username/password verification errors
92109
such as the client-side response to an :code:`AUTH_FAILED` message from

src/openvpn/options.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ static const char usage_message[] =
499499
" and a password on the second. If either the password or both\n"
500500
" the username and the password are omitted OpenVPN will prompt\n"
501501
" for them from console.\n"
502+
"--external-auth : If set, client-side credentials are optional.\n"
502503
"--pull : Accept certain config file options from the peer as if they\n"
503504
" were part of the local config file. Must be specified\n"
504505
" when connecting to a '--mode server' remote host.\n"
@@ -3004,12 +3005,12 @@ options_postprocess_verify_ce(const struct options *options,
30043005

30053006
if (sum == 0)
30063007
{
3007-
if (!options->auth_user_pass_file)
3008+
if (!options->auth_user_pass_file && !options->external_auth)
30083009
{
30093010
msg(M_USAGE, "No client-side authentication method is "
30103011
"specified. You must use either "
3011-
"--cert/--key, --pkcs12, or "
3012-
"--auth-user-pass");
3012+
"--cert/--key, --pkcs12, "
3013+
"--auth-user-pass, or --external-auth");
30133014
}
30143015
}
30153016
else if (sum != 2)
@@ -7917,6 +7918,11 @@ add_option(struct options *options,
79177918
options->auth_user_pass_file = "stdin";
79187919
}
79197920
}
7921+
else if (streq(p[0], "external-auth") && !p[1])
7922+
{
7923+
VERIFY_PERMISSION(OPT_P_GENERAL);
7924+
options->external_auth = true;
7925+
}
79207926
else if (streq(p[0], "auth-retry") && p[1] && !p[2])
79217927
{
79227928
VERIFY_PERMISSION(OPT_P_GENERAL);

src/openvpn/options.h

+1
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ struct options
542542
const char *auth_user_pass_file;
543543
bool auth_user_pass_file_inline;
544544
struct options_pre_connect *pre_connect;
545+
bool external_auth;
545546

546547
int scheduled_exit_interval;
547548

0 commit comments

Comments
 (0)