Skip to contentSkip to conversation

OpenVPN & pam_radius_auth - Dynamic CR (#92)

Openvpn-devel Selva Nair 1 participant 1 message Nov 4, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): OpenVPN/openvpn-gui/issues/[email protected]...

Selva Nair

author
#1 lore raw

Hi,

Copying openvpn-devel as this is more about openvpn server than the GUI.

Quoted 6 lines · roberthunt-dm

I am trying to get OpenVPN working with a Radius server configured to send an access_challenge for an otp code it dynamically generates.

(server) openvpn server 2.3.2-7ubuntu3.1
(client) Openvpn-gui-cr.exe

The big question mark for me is how pam_radius_auth interacts with Openvpn.

Quoted 17 lines

Logs show that the plugin is receiving the code 11 access_challenge from the radius server:

Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: Got user name xxxxxx
Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: Sending RADIUS request code 1
Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: Got RADIUS response code 11
Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: Got response to challenge code 11
Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: Got response to challenge code 3
Nov 3 15:30:21 openvpn openvpn[10910]: pam_radius_auth: authentication failed

Quoted 3 lines

However I don't see any pop-up box on the OpenVPN client prompting for the OTP code.

You have to send the authentication failed message with a specially formatted reason back to the client. For example. reason = CRV1:R,E:some_id:base64_username:Input OTP code will cause the server to send AUTH_FAILED followed by that reason back to the client. The client will then prompt for a second round of authentication and the GUI will parse the failure reason and prompt for OTP.

Client log will show what kind of AUTH_FAILED message is received from the server.

For details of the message format see "Challenge/Response protocol" description here: https://openvpn.net/index.php/
open-source/documentation/miscellaneous/79-management-interface.html

Quoted 8 lines

On the radius server, for the 2nd access request message (in response to the access_challenge) - openvpn is just sending the same original access_request message. The radius server then rejects access.

Do I need to modify pam_radius_auth to send messages in a special format to openvpn? I'm using this from here: https://github.com/FreeRADIUS/
pam_radius/blob/master/src/pam_radius_auth.c

As far as I know the only way to send back a specially crafted reason for auth failure is using the management interface for authentication (--management-client-auth in the server config). But I don't know enough about the plugin api to know if and how this could be achieved using a plugin.

Selva