OpenVPN Server with Microsoft Azure MFA NPS extension

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
stuhad
OpenVpn Newbie
Posts: 3
Joined: Sun Nov 15, 2020 10:41 pm

OpenVPN Server with Microsoft Azure MFA NPS extension

Post by stuhad » Sun Nov 15, 2020 11:26 pm

We are trying to integrate Azure MFA on an OpenVPN 2.4.4 Server running on an Ubuntu 18.04.5 LTS VM

We have a Windows Server 2019 NPS server, with the OpenVPN Server configured as a RADIUS client and a network policy that allows access. We ensured that RADIUS access was successfully working prior to installing the Azure MFA extension on the NPS server.

After installing the NPS MFA extension our experience is this:
  • client enters the username/password
  • gets prompted on their phone for MFA
  • approves the prompt
After which the OpenVPN client seems to wait, and then returns back to the login prompt with a Wrong credentials. Try again... message

We have confirmed that the NPS logs in Event Viewer still show that access is being Granted with the MFA extension enabled:

Code: Select all

Log Name:      Security
Source:        Microsoft-Windows-Security-Auditing
Date:          11/12/2020 12:03:18 AM
Event ID:      6272
Task Category: Network Policy Server
Level:         Information
Keywords:      Audit Success
User:          N/A
Computer:      radiusserver
Description:
Network Policy Server granted access to a user.

User:
	Security ID:			Domain\admin
	Account Name:			admin@test.com.au
	Account Domain:			Domain
	Fully Qualified Account Name:	Domain\admin

Client Machine:
	Security ID:			NULL SID
	Account Name:			-
	Fully Qualified Account Name:	-
	Called Station Identifier:		-
	Calling Station Identifier:		client IP

NAS:
	NAS IPv4 Address:		openvpn server IP
	NAS IPv6 Address:		-
	NAS Identifier:			OpenVpn
	NAS Port-Type:			Virtual
	NAS Port:			1

RADIUS Client:
	Client Friendly Name:		VPN
	Client IP Address:			openvpn server IP

Authentication Details:
	Connection Request Policy Name:	Use Windows authentication for all users
	Network Policy Name:		VPN
	Authentication Provider:		Windows
	Authentication Server:		radius server
	Authentication Type:		Extension
	EAP Type:			-
	Account Session Identifier:		4237304141324331313142354439433644334141383535373945364143364534
	Logging Results:			Accounting information was written to the local log file.

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-a5ba-3e3b0328c30d}" />
    <EventID>6272</EventID>
    <Version>2</Version>
    <Level>0</Level>
    <Task>12552</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2020-11-12T00:03:18.614518000Z" />
    <EventRecordID>2969</EventRecordID>
    <Correlation ActivityID="{1c191e12-ac99-0000-82d4-20fad3b7d601}" />
    <Execution ProcessID="712" ThreadID="772" />
    <Channel>Security</Channel>
    <Computer>radiusserver</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="SubjectUserSid">S-1-5-21-832361468-1348258915-671347851-5615</Data>
    <Data Name="SubjectUserName">admin@test.com.au</Data>
    <Data Name="SubjectDomainName">DOMAIN</Data>
    <Data Name="FullyQualifiedSubjectUserName">DOMAIN\admin</Data>
    <Data Name="SubjectMachineSID">S-1-0-0</Data>
    <Data Name="SubjectMachineName">-</Data>
    <Data Name="FullyQualifiedSubjectMachineName">-</Data>
    <Data Name="CalledStationID">-</Data>
    <Data Name="CallingStationID">clientIP</Data>
    <Data Name="NASIPv4Address">openVPNIP</Data>
    <Data Name="NASIPv6Address">-</Data>
    <Data Name="NASIdentifier">OpenVpn</Data>
    <Data Name="NASPortType">Virtual</Data>
    <Data Name="NASPort">1</Data>
    <Data Name="ClientName">VPN</Data>
    <Data Name="ClientIPAddress">openVPNIP</Data>
    <Data Name="ProxyPolicyName">Use Windows authentication for all users</Data>
    <Data Name="NetworkPolicyName">VPN</Data>
    <Data Name="AuthenticationProvider">Windows</Data>
    <Data Name="AuthenticationServer">radiusserver</Data>
    <Data Name="AuthenticationType">Extension</Data>
    <Data Name="EAPType">-</Data>
    <Data Name="AccountSessionIdentifier">4237304141324331313142354439433644334141383535373945364143364534</Data>
    <Data Name="LoggingResult">Accounting information was written to the local log file.</Data>
  </EventData>
</Event>

but we have noted Accounting errors when tailing the OpenVPN logs:
Example of failed connection with MFA Extension enabled:

Code: Select all

Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: FOREGROUND: Add user for accounting: username: admin@test.com.au, commonname: client1
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Get a command.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New User.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New user acct: username: admin@test.com.au, interval: 0, calling station: 203.213.108.131, commonname: client1, framed ip: 10.8.0.6.
Thu Nov 12 00:14:11 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Error: Start packet couldn't send.
 
!
Thu Nov 12 00:14:11 2020 Error: RADIUS-PLUGIN: FOREGROUND: Accounting failed for user:admin@test.com.au!
 
Thu Nov 12 00:14:11 2020 us=226645 client1/203.213.108.131:63903 PLUGIN_CALL: POST /usr/lib/openvpn/radiusplugin.so/PLUGIN_CLIENT_CONNECT status=1
Thu Nov 12 00:14:11 2020 us=226656 client1/203.213.108.131:63903 PLUGIN_CALL: plugin function PLUGIN_CLIENT_CONNECT failed with status 1: /usr/lib/openvpn/radiusplugin.so
Thu Nov 12 00:14:11 2020 us=226665 client1/203.213.108.131:63903 WARNING: client-connect plugin call failed
Thu Nov 12 00:14:11 2020 us=226812 client1/203.213.108.131:63903 PUSH: Received control message: 'PUSH_REQUEST'
Example of successful connection with MFA Extension disabled:

Code: Select all

Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: FOREGROUND: Add user for accounting: username: admin@test.com.au, commonname: client1
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Get a command.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New User.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New user acct: username: admin@test.com.au, interval: 0, calling station: 203.213.108.131, commonname: client1, framed ip: 10.8.0.6.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND-ACCT: Get ACCOUNTING_RESPONSE-Packet.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Start packet was send.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND ACCT: User was added to accounting scheduler.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: BACKGROUND-ACCT: No routes for user.
Thu Nov 12 00:26:57 2020 RADIUS-PLUGIN: FOREGROUND: Accouting succeeded!
To me it seems like we are simply not receiving the required:

Code: Select all

Get ACCOUNTING_RESPONSE-Packet.
from the the NPS server when the MFA extension is enabled.

However, Microsoft support are suggesting that the NPS server and the MFA extension are working correctly and that "we have to engage VPN side support to check why VPN authentication failure given the Azure MFA success response and AccessAccept state"

openvpn --version

Code: Select all

$ openvpn --version
OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
library versions: OpenSSL 1.1.1  11 Sep 2018, LZO 2.08
Originally developed by James Yonan
Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
Compile time defines: enable_async_push=no enable_comp_stub=no enable_crypto=yes enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dependency_tracking=no enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=needless enable_fragment=yes enable_iproute2=yes enable_libtool_lock=yes enable_lz4=yes enable_lzo=yes enable_maintainer_mode=no enable_management=yes enable_multihome=yes enable_pam_dlopen=no enable_pedantic=no enable_pf=yes enable_pkcs11=yes enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=no enable_server=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=no enable_small=no enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=yes enable_werror=no enable_win32_dll=yes enable_x509_alt_username=yes with_aix_soname=aix with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_sysroot=no
server.conf

Server config
1
port 1194
2
plugin /usr/lib/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf
3
proto udp
4
dev tun
5
ca ca.crt
6
cert server.crt
7
key server.key
8
dh dh.pem
9
server 10.8.0.0 255.255.255.0
10
ifconfig-pool-persist /var/log/openvpn/ipp.txt
11
keepalive 10 120
12
tls-auth ta.key 0
13
cipher AES-256-CBC
14
auth SHA256
15
user nobody
16
group nogroup
17
persist-key
18
persist-tun
19
status /var/log/openvpn/openvpn-status.log
20
log /var/log/openvpn/openvpn.log
21
log-append /var/log/openvpn/openvpn.log
22
verb 5
23
explicit-exit-notify 1
24
reneg-sec 0



radiusplugin.cnf

Code: Select all

NAS-Identifier=OpenVpn
Service-Type=5
Framed-Protocol=1
NAS-Port-Type=5
NAS-IP-Address=local IP of OpenVPN server
OpenVPNConfig=/etc/openvpn/server.conf   # OpenVPN configuration file
overwriteccfiles=true
nonfatalaccounting=true
server
{
acctport=1813                     # RADIUS accounting port
authport=1812                     # RADIUS authentication port
name=local IP of RADIUS server                    # RADIUS IP
        retry=1
        wait=60
        sharedsecret=editedout              # Key is used between FreeRADIUS and OpenVPN
}
Does anyone have any experience with Integrating the Azure MFA NPS extension with OpenVPN? Do these logs shed any light on where the issue might lie?

Any help that you can provide would be greatly appreciated.

Thanks,
Last edited by Pippin on Sun Nov 15, 2020 11:36 pm, edited 1 time in total.
Reason: Formatting

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by TinCanTech » Mon Nov 16, 2020 12:12 am

Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: FOREGROUND: Add user for accounting: username: admin@test.com.au, commonname: client1
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Get a command.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New User.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New user acct: username: admin@test.com.au, interval: 0, calling station: 203.213.108.131, commonname: client1, framed ip: 10.8.0.6.
Thu Nov 12 00:14:11 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Error: Start packet couldn't send.

!
Thu Nov 12 00:14:11 2020 Error: RADIUS-PLUGIN: FOREGROUND: Accounting failed for user:admin@test.com.au!

Thu Nov 12 00:14:11 2020 us=226645 client1/203.213.108.131:63903 PLUGIN_CALL: POST /usr/lib/openvpn/radiusplugin.so/PLUGIN_CLIENT_CONNECT status=1
:geek:

stuhad
OpenVpn Newbie
Posts: 3
Joined: Sun Nov 15, 2020 10:41 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by stuhad » Mon Nov 16, 2020 1:18 am

TinCanTech wrote:
Mon Nov 16, 2020 12:12 am
:geek:
Not quite sure what you are trying to point out sorry, I have tried searching these errors and haven't had much luck.

In terms of the version of the RADIUS plugin:

Code: Select all

openvpn-auth-radius/bionic,now 2.1-6build1 amd64 [installed]

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by TinCanTech » Mon Nov 16, 2020 1:25 am

stuhad wrote:
Sun Nov 15, 2020 11:26 pm
We are trying to integrate Azure MFA on an OpenVPN 2.4.4 Server running on an Ubuntu 18.04.5 LTS VM

We have a Windows Server 2019 NPS server, with the OpenVPN Server configured as a RADIUS client and a network policy that allows access. We ensured that RADIUS access was successfully working prior to installing the Azure MFA extension on the NPS server.
TinCanTech wrote:
Mon Nov 16, 2020 12:12 am
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: FOREGROUND: Add user for accounting: username: admin@test.com.au, commonname: client1
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Get a command.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New User.
Thu Nov 12 00:13:31 2020 RADIUS-PLUGIN: BACKGROUND ACCT: New user acct: username: admin@test.com.au, interval: 0, calling station: 203.213.108.131, commonname: client1, framed ip: 10.8.0.6.
Thu Nov 12 00:14:11 2020 RADIUS-PLUGIN: BACKGROUND ACCT: Error: Start packet couldn't send.

!
Thu Nov 12 00:14:11 2020 Error: RADIUS-PLUGIN: FOREGROUND: Accounting failed for user:admin@test.com.au!

Thu Nov 12 00:14:11 2020 us=226645 client1/203.213.108.131:63903 PLUGIN_CALL: POST /usr/lib/openvpn/radiusplugin.so/PLUGIN_CLIENT_CONNECT status=1
:geek:
stuhad wrote:
Mon Nov 16, 2020 1:18 am
TinCanTech wrote:
Mon Nov 16, 2020 12:12 am
:geek:
Not quite sure what you are trying to point out sorry, I have tried searching these errors and haven't had much luck.

In terms of the version of the RADIUS plugin:

Code: Select all

openvpn-auth-radius/bionic,now 2.1-6build1 amd64 [installed]
This has nothing to do with OpenVPN ..

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by Pippin » Mon Nov 16, 2020 9:54 am

Indeed looks like off topic.

OpenVPN handoff auth and waits for success message back.
Standalone Radius succeeds.
Standalone MFA succeeds.

First, I have no experience with MFA.
If I understand the "flow" for your Radius/MFA it's like:
OpenVPN -> Radius -> MFA -> Radius -> OpenVPN

I would think MFA is unable to talk back to Radius.
Check port 1813...
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp

stuhad
OpenVpn Newbie
Posts: 3
Joined: Sun Nov 15, 2020 10:41 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by stuhad » Tue Nov 17, 2020 1:29 am

Thanks guys, sorry about using the wrong forum.
Pippin wrote:
Mon Nov 16, 2020 9:54 am
If I understand the "flow" for your Radius/MFA it's like:
OpenVPN -> Radius -> MFA -> Radius -> OpenVPN
Yes, it is my understanding that the flow is as you have described, and therefore I would have thought that if it was a firewall/port issue then the connection would also fail with the MFA extension disabled, and so again I don't fully understand why there would be any need to change anything in the RADIUS conf on our OpenVPN server except maybe the timeout to ensure enough time for NPS to respond after MFA challenge.

Was really posting here as a last ditch effort in the hopes other users had already solved my problem somehow, I'm continuing to ask Microsoft support for further clarification and assistance, I'll post if I do find a resolution.

apu
OpenVpn Newbie
Posts: 2
Joined: Tue Aug 31, 2021 1:38 am

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by apu » Tue Aug 31, 2021 1:39 am

Hi stuhad

Did you ever solve this? I'm about to roll this out and wondering if you got a resolution or it didn't end up working passing the request?

Thanks

apu
OpenVpn Newbie
Posts: 2
Joined: Tue Aug 31, 2021 1:38 am

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by apu » Wed Sep 01, 2021 2:31 am

stuhad wrote:
Tue Nov 17, 2020 1:29 am
Thanks guys, sorry about using the wrong forum.
Pippin wrote:
Mon Nov 16, 2020 9:54 am
If I understand the "flow" for your Radius/MFA it's like:
OpenVPN -> Radius -> MFA -> Radius -> OpenVPN
Yes, it is my understanding that the flow is as you have described, and therefore I would have thought that if it was a firewall/port issue then the connection would also fail with the MFA extension disabled, and so again I don't fully understand why there would be any need to change anything in the RADIUS conf on our OpenVPN server except maybe the timeout to ensure enough time for NPS to respond after MFA challenge.

Was really posting here as a last ditch effort in the hopes other users had already solved my problem somehow, I'm continuing to ask Microsoft support for further clarification and assistance, I'll post if I do find a resolution.
Hi stuhad - any update to this?

some1here
OpenVpn Newbie
Posts: 2
Joined: Mon Oct 11, 2021 9:27 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by some1here » Tue Oct 12, 2021 8:21 am

Hi everyone,

same exact problem here, running openvpn 2.4.4-2ubuntu1.5 on Ubuntu 18.04.1 LTS
and openvpn-auth-radius 2.1-6build1. A pcap of the radius exchange shows the server
sending an Access-Accept packet identical to the one sent to non-MFA users.

I can log "auth succeded" messages on the VPN server but then connection is reset and
the auth process is restarted.

I couldn't find anything around here and the verb 9 logs didn't show anything obvious
(at least to me). Did someone fix this issue someway?

Thanks!
Me

some1here
OpenVpn Newbie
Posts: 2
Joined: Mon Oct 11, 2021 9:27 pm

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by some1here » Thu Oct 14, 2021 9:53 am

Just in case someone is still struggling with this prob. I managed
to get the plugin working again by disabling the accounting ops in
UserAcct.cpp and recompiling.

Cheers,
Me

diazed
OpenVpn Newbie
Posts: 1
Joined: Fri Mar 18, 2022 12:58 am

Re: OpenVPN Server with Microsoft Azure MFA NPS extension

Post by diazed » Fri Mar 18, 2022 1:01 am

Some1here:

Hello, would you mind to share the instructions you followed to compile the UserAcct.cpp please?

Post Reply