Hello little white star and thank you for the quick answer.
> any VPN connection has a hard timeout of 8 hours
If you specifically instruct the client software to store/remember the username and password and to automatically reconnect and start a new session with these credentials, that's a configuration problem on your client side that cannot be solved from the server end. From the server end, it will be seen as a perfectly normal session that lasts 8 hours, and is then ended as it should. If the client is then configured to automatically use stored credentials (not secure) to start a new session again, then that will be seen as the same thing as the user entering his or her credentials again to start a new session. This is a problem purely on the client side and if someone is configuring things this way, then there's not a hell of a lot you can do about it. This would imply a custom configuration on the client side that is, as far as I know, not the default.
I fully agree. I am not trying to achieve the impossible (controlling the user's actions) but what I am observing is not really falling within this case.
I have an older (2.2.2) OpenVPN GUI which is simply running the (unmodified) .ovpn downloaded from the AS (i.e. no caching of username/password I presume). The same .ovpn works in Connect (i.e. the session is disconnected and I am asked for credentials). I have set the TLS reneg at 5 min and the session age at 10 min. If I use the Connect client there are mentions of the session token in the log. With the old GUI there is nothing about it in the AS (or client) logs, only the normal TLS soft resets every 5 mins and "2017-03-25 17:42:39+0200 [-] OVPN 4 OUT: "Sat Mar 25 15:42:39 2017 MANAGEMENT: CMD 'client-auth-nt 3 24'", where the 24 increments itself.
What I mean is that even if somehow the client would reauthenticate itself without interacting with the user, I should at least see something _other_ than the normal TLS refreshes once every 10 mins. Maybe something escapes me at this time.
Perhaps a solution is scripting around sacli vpnstatus and killing users (virtually 😉 ).
Moreover, I think that enforcing 2FA could take care of any too-smart-for-his-own-good client, by at least requiring something not known in advance (technically, the OTP can be calculated for an arbitrary moment, but this gets too deep for even the most stubborn users).
This gets me into the whole reasoning behind requiring OTP when the certificate is already "something you have", but this is a whole other discussion...
> 2.We also have a policy of maximum 2 simultaneous connections for any user. I now only have two options: 1 connection or unlimited.
Sorry, Access Server only supports either 1 or unlimited. You can't set a custom limit.
Yes, fully understood but not fully accepted 🙂
> a) Leave the simultaneous connections unchecked (1 conn per user) and give each person two installers; but I couldn't find a way to generate
and associate two different certificate/key pairs for each user.
Yes, that's a solution: create 2 accounts for each person. Each user account is given its own private key/public key pair automatically. No two user accounts on the Access Server will have the same private key/public key pair.
This would mean having two accounts in Active Directory for each person, which is not going to happen.
I know that the CN on the certificate is tied (internally in AS) to the username from AD (or RADIUS, or PAM, or local). I was hoping to find a way to create two certificates, with different CNs, but associated to the same username.
> b) Configure AS for simultaneous connections (I presume, basically, this adds --duplicate-cn to the server config) and use something similar to what I am doing now with the FOSS openvpn (scripting around the client-connect hook); but I'm not sure this is feasible.
[...] Or, what you can do, is read the output of the command /usr/local/openvpn_as/scripts/sacli VPNStatus and count how many times this user is already connected. If it's 2 times or more, you can then tell the Access Server to deny this user access, with some error message that is shown on the client side like "too many connections" or whatever.
Yes, this is very similar to what we are doing now . I might have to get aquainted with the post-auth python thing and some xml parsing...
A good script could prove to be a solid solution to globally set the simult. connections to 2 or whatever number, but I kinda expected this work to be done already inside AS 😉
> 3.I would like to completely shut off the client web site, as we already generate and distribute the installers (profile included) by ourselves. But this
seems to break 2FA. Is there a way to have the included TOTP feature working without the API? Preferably using a concatenation of the one time code and the user password...
I think you need to check again how you are generating these installers because I just tested and it doesn't break 2FA.
I have based my assumption on something others are saying, not completely fair, I know.
I need to test this and get back to you. I am generating installers with sacli, nothing special.
In any case I would advise against this. The client web UI is perfectly fine to have open to the Internet. It's got security lockouts against bruteforcing, and it's a custom implementation of Twisted Web that is pretty damn hard to break. As long as you set it with TLS 1.2 and put a secure cipher suite in place, and you use decent passwords, you'll be fine. But the choice is yours I guess so here goes...
Ok, this sounds reassuring, I will consider leaving the client web up.
You're going to make life very difficult for yourself if you're going to get rid of the client web UI entirely. For one, you want to use the built-in multifactor authentication, right? But enrollment for that happens through the client web UI. How are you gonna solve that? You'll have to manually input google authenticator codes into the configuration database, and manually pass this code to the user. Additionally you'll have to manually generate all the client installers, one for each user account.
We are used to doing things that way, but I wouldn't refuse an easier path...
Normally the Connect Client is given to a user and they run it. When they enter credentials this is checked with the Access Server over a secure channel, through the web services. Disabling this means this doesn't work.
Yes, I've read the documentation, I know the profile (.ovpn file) is downloaded from the AS, and I feel a bit uneasy about having access to the certificate (a potential second factor in itself and an actual private key as well) based only on credentials (coupled maybe with the OTP).
Google Authenticator is normally also checked through the web services. But if you manually provide a user-locked profile, this can be done without the web services as it will then go through the VPN tunnel during the authentication phase directly. You will notice that this is the case because the login screen on the Connect Client will ask you for username, password, and Google Authenticator code, in 1 authentication screen, not in 2 separate steps.
This I didn't know, as I haven't reached the GA testing phase yet because the session age issue is blocking.
Hmm, if I enforce 2FA, might this even eliminate older clients altogether, by rendering them uncapable of performing the auth?
(And thus, forcing users to install the package provided by us, and not simply throwing the .ovpn into any openvpn compatible client software. Taking care of point 1. at the same time).
BTW, do you happen to know of an OTP app which stores the secret safely in the phone (i.e. not so easily accessible as in Google's own app, for which it is trivially recoverable on a rooted device)?
We are not really ready to buy 100 Yubikeys 😉
If you have the following conditions met, it will work:
- Client web services are unreachable for the client
- Requirement for Google Authenticator is enabled
- The Google Authenticator shared key is set and locked for this user account in the user database on the server side
- This shared key is given to the user and configured in their Google Authenticator app of choice
- You generate an installer for this user of type msi or dmg with a bundled standard user-locked profile
- This installer is then placed on the computer of the user, and installed there
Then it will work. I've just tested this to be 100% sure.
This is almost step for step the on-boarding workflow I imagined myself.
> 4. Lower priority: we have set a web session timeout of 10 hours ( "sa.session_expire": "36000") but the admin interface still disconnects way earlier than that (after around an hour or less IIRC).
Not sure, would take too long for me to check but I can well imagine that you have set this parameter but have forgotten to implement it by either restarting the Access Server service or using ./sacli start in the /usr/local/openvpn_as/scripts/ folder to have this value loaded and
implemented.
Oh, of course I did sacli start. In fact, at each modification of the config I always bounce the openvpnas service as well, this is a testing playground for now.
I will try to find the exact duration of the admin web session and maybe find this number somewhere. In any case, it really doesn't honor the parameter's value I've set. If it matters, I always logon at the admin web with the bootstrap user.
But really, 10 hours? You're concerned about the client web UI but you want the admin web UI to be left open for 10 hours? Okay then.
This is for my own comfort, while I am changing and testing stuff. If this goes to production, it will be set to 10 mins (it it works!) =)
I hope the above helped you. Good luck.
Definitely helped, thanks.