Skip to content

Commit 4c70e70

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

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

doc/man-sections/client-options.rst

+14
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ 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+
For security reasons, OpenVPN requires client-side credentials such as
92+
client certificates or a username/password combination. The OpenVPN server
93+
has the capability to delegate authentication to external systems using the
94+
WEBAUTH protocol. In such cases, client credentials may be omitted.
95+
96+
***Security Considerations***
97+
98+
When the ``--external-auth`` option is enabled in OpenVPN, it bypasses the
99+
standard authentication checks. This configuration can potentially create a
100+
risky environment where an OpenVPN server operates without requiring
101+
authentication. If you opt to utilize ``--external-auth``, it's crucial to
102+
thoroughly validate that the OpenVPN server has been adequately secured.
103+
90104
--auth-retry type
91105
Controls how OpenVPN responds to username/password verification errors
92106
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 may be provided optionally.\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)