OpenVPN installers with openvpn-gui pull request #13's code included
Hi,
Selva has a pending pull request to openvpn-gui, which completes the integration of interactive service into OpenVPN installers:
<https://github.com/OpenVPN/openvpn-gui/pull/13>
The pull request contains several changes which need testing:
<https://github.com/OpenVPN/openvpn-gui/pull/13/commits>
I built test installers which include the new openvpn-gui code:
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-i686.exe>
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-x86_64.exe>
If you test these installers please report back and tell how things went. I'll try to do testing on my own later today.
Best regards,
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Quoted 11 lines · Samuli Seppänen
Hi,
Selva has a pending pull request to openvpn-gui, which completes the integration of interactive service into OpenVPN installers:
<https://github.com/OpenVPN/openvpn-gui/pull/13>
The pull request contains several changes which need testing:
Quoted 8 lines
I built test installers which include the new openvpn-gui code:
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-i686.exe>
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-x86_64.exe>If you test these installers please report back and tell how things went. I'll try to do testing on my own later today.
Maybe I'll give it a shot soon, but a quick question first:
I noticed this commit:
https://github.com/selvanair/openvpn-gui/commit/91acf14726b15144fc2f00c206f590090a123158
"Change the default log file location to OpenVPN/log in user's profile directory to support running without admin privileges using the interactive service."
Do you know if it's now possible to have also the OpenVPN config files and certs in user's profile directory (not on system-wide c:\windows\program files\openvpn\config\) ?
Thanks,
-- Pasi
Hi,
Quoted 2 lines · Pasi Kärkkäinen
Do you know if it's now possible to have also the OpenVPN config files and certs in user's profile directory (not on system-wide c:\windows\program files\openvpn\config\) ?
The intention is to make this configurable at installation time ("only admin-provided openvpn profiles" vs. "user-installable profiles").
Details to be solved.
(Background: if you permit user configs for unprivileged users, you permit unprivileged users to mess with routing, and potentially "steal traffic" by redirecting traffic into a malicious VPN server - so this needs to be a conscious decision by the admin at installation time)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Quoted 9 lines · Gert Doering
Hi,
Quoted 2 lines · Pasi Kärkkäinen
Do you know if it's now possible to have also the OpenVPN config files and certs in user's profile directory (not on system-wide c:\windows\program files\openvpn\config\) ?
The intention is to make this configurable at installation time ("only admin-provided openvpn profiles" vs. "user-installable profiles").
Quoted 7 lines
Details to be solved.
(Background: if you permit user configs for unprivileged users, you permit unprivileged users to mess with routing, and potentially "steal traffic" by redirecting traffic into a malicious VPN server - so this needs to be a conscious decision by the admin at installation time)
Yeah, makes sense. Thanks for the update.
Quoted 2 lines
gert
-- Pasi
Hi all,
I generated new installers which include the latest version of the PR:
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13v2-I603-i686.exe>
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13v2-I603-x86_64.exe>
These installers contain a manually patched openvpn-gui which reverts commit 2af86368964 ("Run with highest privilege available"), so that users with administrator privileges can launch OpenVPN-GUI with non-elevated privileges. I tested the latter installer on a Windows 7 Pro 64-bit laptop and there were two issues.
1) Interactive service not installed by default
First, OpenVPN-GUI would silently fail to create routes when launched as a normal user, as if interactive service was not present. And indeed it is not out of the box. The fix was fairly simple (but not obvious):
PS> C:\> openvpnserv.exe -install
PS> C:\> openvpnserv.exe -start automatic
After this the interactive service is running, but the non-interactive one is not:
PS> C:\> Get-Service|Where-Object { $_.DisplayName -like "*openvpn*" }
Status Name DisplayName ------ ---- ----------- Stopped OpenVPNService OpenVPN Service Running OpenVPNServiceI... OpenVPN Interactive Service
When OpenVPN-GUI is now launched, it can now communicate with the interactive service and the VPN works properly.
2) OpenVPN-GUI points OpenVPN config directory to a system-wide location
While OpenVPN-GUI now saves the registry keys under "HKCU" (=current user) instead of "HKLM" (=local-machine), the default value for OpenVPN configs is still C:\Program Files\OpenVPN\config (or equivalent). At least on my test system the OpenVPN configuration files under that directory could not be read by a normal user, even though listing the files was permitted. This caused OpenVPN-GUI to see the config file, but upon loading it just hanged.
---
A few things to fix:
- Revert commit 2af86368964 in openvpn-gui
- Make OpenVPN-GUI fail/warn if it can't reach interactive service
- Enable interactive service at OpenVPN install
- Relax OpenVPN's config file permissions, or...
- ... make OpenVPN-GUI read configs from user's home dir by default
Given that OpenVPNService and OpenVPNServiceInteractive have been separated, replacing the non-interactive variant with openvpnserv2 should not be too difficult.
Thoughts?
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Quoted 23 lines
Hi,
Selva has a pending pull request to openvpn-gui, which completes the integration of interactive service into OpenVPN installers:
<https://github.com/OpenVPN/openvpn-gui/pull/13>
The pull request contains several changes which need testing:
<https://github.com/OpenVPN/openvpn-gui/pull/13/commits>
I built test installers which include the new openvpn-gui code:
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-i686.exe>
<http://build.openvpn.net/downloads/temp/openvpn-install-2.3_guipr13-I601-x86_64.exe>
If you test these installers please report back and tell how things went. I'll try to do testing on my own later today.
Best regards,
forgot to CC: the list
Hi,
On Thu, Feb 11, 2016 at 11:42 AM, Samuli Seppänen <[email protected]...>
wrote:
PS> C:\> openvpnserv.exe -install
Quoted 2 lines
PS> C:\> openvpnserv.exe -start automatic
I suppose you mean openvpnserv.exe -start interactive (-start automatic or start without any option will start the automatic service which is not a good idea.)
Quoted 2 lines
After this the interactive service is running, but the non-interactive one is not:
A few things to fix:
Quoted 3 lines
- Revert commit
2af86368964in openvpn-gui
We may want to do this only for 2.4 (or git master) based binary distributions. For 2.3 there is no interactive service and this "highestAvailable" may still be required (or at least expected by users).
One way to handle this is to create a release branch on the GUI repo and revert the commit only in master. Then 2.3 installers can continue to use that release branch.
Quoted 2 lines
- Make OpenVPN-GUI fail/warn if it can't reach interactive service
In fact it may be ok to require the iservice to operate the GUI -- that is do not allow the GUI to directly start openvpn.exe -- running as admin will fail with a message then). But leave this for later?
- Enable interactive service at OpenVPN install
Quoted 1 line
I think the installer should include the following commands
(i) openvpnserv.exe -install <- this will install both auto and interactive services
this is probably there in the current NSIS installer (the user can disable it by chosing not to install any service, but its not possible to install only one of those (not yet, at least).
(ii) openvpnserv.exe --start interactive
Do not start the automatic service by default as that is meant for expert users. Else it will spawn-up openvpn.exe for all configs found and possibly mess-up with interactive use.
- Relax OpenVPN's config file permissions, or...
Quoted 2 lines
- ... make OpenVPN-GUI read configs from user's home dir by default
With the pull #13, its now possible for the user to edit HKCU\Software\OpenVPN\config_dir to point the GUI to an alternate location for configs. Currently there are no access checks in the service, so any location with read access will work.
Let's revisit this after the service is hardened to restrict configs and options. Then we can decide how to modify the installer to choose appropriate defaults for config_dir etc.
Quoted 5 lines
Given that OpenVPNService and OpenVPNServiceInteractive have been separated, replacing the non-interactive variant with openvpnserv2 should not be too difficult.
While the two services can be independently stopped and started the two are installed and removed together:
openvpnserv.exe --install sets up two
services OpenVPNService and OpenVPNServiceInteractive. So any replacement will have to use a name distinct from those. I think openvpnserv2 uses the same name "OpenVPNService" which will cause a conflict.
In the long run it may be better to remove the automatic service completely from the openvpnsev.exe code.
Quoted 3 lines
Thoughts?
See above;)
Cheers,
Selva
Hi,
Quoted 5 lines · Selva Nair
(ii) openvpnserv.exe --start interactive
Do not start the automatic service by default as that is meant for expert users. Else it will spawn-up openvpn.exe for all configs found and possibly mess-up with interactive use.
Right.
Maybe even change the "openvpnvsrv.exe --install" command to require "--install interactive / --install automatic" and even *install* only the iservice by default.
Quoted 11 lines
Quoted 3 lines
Given that OpenVPNService and OpenVPNServiceInteractive have been separated, replacing the non-interactive variant with openvpnserv2 should not be too difficult.
While the two services can be independently stopped and started the two are installed and removed together:
openvpnserv.exe --install sets up two
services OpenVPNService and OpenVPNServiceInteractive. So any replacement will have to use a name distinct from those. I think openvpnserv2 uses the same name "OpenVPNService" which will cause a conflict.
Quoted 2 lines
In the long run it may be better to remove the automatic service completely from the openvpnsev.exe code.
I'm not going to disagree, but this should happen somewhat coordinated with inclusion of openvpnserv2 in the installers & "an appropriate" git repo.
thanks,
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Hi,
Quoted 10 lines · Samuli Seppänen
2) OpenVPN-GUI points OpenVPN config directory to a system-wide location
While OpenVPN-GUI now saves the registry keys under "HKCU" (=current user) instead of "HKLM" (=local-machine), the default value for OpenVPN configs is still C:\Program Files\OpenVPN\config (or equivalent). At least on my test system the OpenVPN configuration files under that directory could not be read by a normal user, even though listing the files was permitted. This caused OpenVPN-GUI to see the config file, but upon loading it just hanged.
Changing this default may break most setups as that is where the GUI looked for configs for so long.. I was under the impression that C:\Program FIles\
and directories & files under it are readable by all users. And that matches with a few machines I checked (win 7, win10, server2012). openvpn.nsis does not show any permission settings on these folders either. May be there are some "hardened" systems where such locations are not readable?
I'm don't write GUI, so anything beyond a warning popup is too hard for me. Yet, it would be nice to have an initial configuration dialog (shown at first run by each user) to set config_dir and possibly a few other parameters.
Selva
Il 11/02/2016 22:23, Selva Nair ha scritto:
Quoted 16 lines
Hi,
On Thu, Feb 11, 2016 at 11:42 AM, Samuli Seppänen <[email protected]... <mailto:[email protected]...>> wrote:
2) OpenVPN-GUI points OpenVPN config directory to a system-wide location
While OpenVPN-GUI now saves the registry keys under "HKCU" (=current user) instead of "HKLM" (=local-machine), the default value for OpenVPN configs is still C:\Program Files\OpenVPN\config (or equivalent). At least on my test system the OpenVPN configuration files under that directory could not be read by a normal user, even though listing the files was permitted. This caused OpenVPN-GUI to see the config file, but upon loading it just hanged.
Quoted 7 lines
Changing this default may break most setups as that is where the GUI looked for configs for so long.. I was under the impression that C:\Program FIles\ and directories & files under it are readable by all users. And that matches with a few machines I checked (win 7, win10, server2012). openvpn.nsis does not show any permission settings on these folders either. May be there are some "hardened" systems where such locations are not readable?
The reason my user was unable to read configs in C:\Program Files\OpenVPN\config was related to ACLs. I had copied the config file there as the main administrator account, so the owner was wrong. This prevented the normal user from reading the file. I had to set the ACLs properly to fix the issue.
While the above could be seen as a user mistake, the ACLs in Windows are pretty well hidden from normal users and even admins. This could end up being a minor support nightmare for us.
Quoted 4 lines
I'm don't write GUI, so anything beyond a warning popup is too hard for me. Yet, it would be nice to have an initial configuration dialog (shown at first run by each user) to set
config_dirand possibly a few other parameters.
That would be good. We also need to warn about lack of permissions on the config files. Right now GUI just hangs if it can't read the OpenVPN config file.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock
Hi,
Quoted 3 lines · Samuli Seppänen
That would be good. We also need to warn about lack of permissions on the config files. Right now GUI just hangs if it can't read the OpenVPN config file.
This is a more fundamental issue, I think - if there is something wrong with the config file (like: syntax error, file not found, ...) OpenVPN will exit right away, and the GUI will wait for OpenVPN's management interface to show up, to read back the log.
Since we know where we're sending the log file to, some enhancement to the GUI to just go read that file in case the management interface fails to connect (after <x> seconds?) would be good for troubleshooting.
gert,
as usual in windows/installer problems just reporting, but unable to fix
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Hi,
Quoted 7 lines · Gert Doering
Hi,
Quoted 3 lines · Samuli Seppänen
That would be good. We also need to warn about lack of permissions on the config files. Right now GUI just hangs if it can't read the OpenVPN config file.
Quoted 9 lines
This is a more fundamental issue, I think - if there is something wrong with the config file (like: syntax error, file not found, ...) OpenVPN will exit right away, and the GUI will wait for OpenVPN's management interface to show up, to read back the log.
Since we know where we're sending the log file to, some enhancement to the GUI to just go read that file in case the management interface fails to connect (after <x> seconds?) would be good for troubleshooting.
This is tricky..First, if the config is not readable, log file is not set at that time and log goes to stdout (mapped to "/dev/null" by the GUI). Even otherwise parsing the log to figure out what went wrong is not always an easy task for a program.
However, the GUI does timeout after 10 seconds or so, if the management interface doesn't come up. But the log will be empty if openvpn exited before stdout was redirected.
Selva
Hi,
Quoted 9 lines · Selva Nair
Quoted 4 lines
Since we know where we're sending the log file to, some enhancement to the GUI to just go read that file in case the management interface fails to connect (after <x> seconds?) would be good for troubleshooting.
This is tricky..First, if the config is not readable, log file is not set at that time and log goes to stdout (mapped to "
/dev/null" by the GUI). Even otherwise parsing the log to figure out what went wrong is not always an easy task for a program.
I'm not sure this description is fully correct - doesn't the GUI (via service) pass the log file before --config with the remaining options?
"--log" is effective immediately, so a non-readable config file should be in there. At least on linux:
[email protected]...:/tmp > touch openvpn.conf
[email protected]...:/tmp > chmod 000 openvpn.conf [email protected]...:/tmp > openvpn --log mylog.txt --config openvpn.conf [email protected]...:/tmp > tail mylog.txt
Options error: In [CMD-LINE]:1: Error opening configuration file: openvpn.conf Use --help for more information.
... the log file has useful information (well, it could log the reason why opening wasn't possible, but at least something is there)
Quoted 3 lines
However, the GUI does timeout after 10 seconds or so, if the management interface doesn't come up. But the log will be empty if openvpn exited before stdout was redirected.
Yes, the GUI times out, and the user has no idea what went wrong. Especially for config file errors. This needs improvement.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Quoted 7 lines · Gert Doering
Quoted 2 lines · Selva Nair
Quoted 2 lines
Since we know where we're sending the log file to, some enhancement to the GUI to just go read that file in case the management interface
fails
Quoted 3 lines
Quoted 2 lines
to connect (after <x> seconds?) would be good for troubleshooting.
Quoted 8 lines
Quoted 3 lines
This is tricky..First, if the config is not readable, log file is not set at that time and log goes to stdout (mapped to "
/dev/null" by the GUI). Even otherwise parsing the log to figure out what went wrong is notalways
Quoted 1 line
an easy task for a program.
I'm not sure this description is fully correct - doesn't the GUI (via service) pass the log file before --config with the remaining options?
No, currently --config goes first.
Selva
Hi,
Quoted 10 lines · Selva Nair
Quoted 8 lines
Quoted 3 lines
This is tricky..First, if the config is not readable, log file is not set at that time and log goes to stdout (mapped to "
/dev/null" by the GUI). Even otherwise parsing the log to figure out what went wrong is notalways
Quoted 1 line
an easy task for a program.
I'm not sure this description is fully correct - doesn't the GUI (via service) pass the log file before --config with the remaining options?
No, currently --config goes first.
Which we might want to turn around, then (changes user-visible behaviour in case the config file has a "log mylog.txt" line)...
Anyway, I don't want to be actually the one who solves that, I'm just a user who tends to run into user-unfriendliness all the time :-)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Am 12.02.16 um 16:15 schrieb Gert Doering:
Quoted 8 lines
Hi,
Quoted 5 lines · Selva Nair
Quoted 5 lines
Quoted 3 lines
This is tricky..First, if the config is not readable, log file is not set at that time and log goes to stdout (mapped to "
/dev/null" by the GUI). Even otherwise parsing the log to figure out what went wrong is notalways
Quoted 1 line
an easy task for a program.
Quoted 10 lines
Quoted 3 lines
Quoted 2 lines
I'm not sure this description is fully correct - doesn't the GUI (via service) pass the log file before --config with the remaining options?
No, currently --config goes first.
Which we might want to turn around, then (changes user-visible behaviour in case the config file has a "log mylog.txt" line)...
Anyway, I don't want to be actually the one who solves that, I'm just a user who tends to run into user-unfriendliness all the time :-)
You are too negative:
Changelog:
- Now honours user defined log file location
Arne
Quoted 9 lines · Arne Schwabe
Quoted 4 lines
Anyway, I don't want to be actually the one who solves that, I'm just a user who tends to run into user-unfriendliness all the time :-)
You are too negative:
Changelog:
- Now honours user defined log file location
That has never been the problem. Average user just runs the GUI without any arguments and gets the default log location which may not be writeable.
Anyway the current point of discussion is not about log file location, but what happens when config file is not readable and the GUI just fails to connect to management interface and sees nothing in the logs? Well, it turns out this is due to --log not being passed as the first option.
Speaking of log file location, the patch was to make even the default location to be in the users profile directory.
Selva
Quoted 6 lines · Gert Doering
Quoted 2 lines
No, currently --config goes first.
Which we might want to turn around, then (changes user-visible behaviour in case the config file has a "log mylog.txt" line)...
With the GUI overriding some of the user options in the config is required. At least most --management related options in the config file have to be reset for the GUI to work, so I suppose its ok to move log to the front leaving others to follow --config.
Is there any option that behaves like --log (i.e., the first one wins and subsequent ones are silently ignored) ?
Quoted 2 lines
Anyway, I don't want to be actually the one who solves that, I'm just a user who tends to run into user-unfriendliness all the time :-)
The problem is that no active users have time or interest to contribute to the GUI. I hardly used it until the other day (preferred NSSM + MI-GUI to avoid runas admin). Now with iservice available, a laptop at home is running the GUI +iservice, so a bit more motivated to hack it.
Selva
A message that is not in the archive (sent off-list or not yet received): [email protected]...
Hi,
Sending to the list also...
Quoted 6 lines
PS> C:\> openvpnserv.exe -install
PS> C:\> openvpnserv.exe -start automaticI suppose you mean openvpnserv.exe -start interactive
You're correct. My mistake.
Quoted 10 lines
- Revert commit
2af86368964in openvpn-guiWe may want to do this only for 2.4 (or git master) based binary distributions. For 2.3 there is no interactive service and this "highestAvailable" may still be required (or at least expected by users).
One way to handle this is to create a release branch on the GUI repo and revert the commit only in master. Then 2.3 installers can continue to use that release branch.
This sounds reasonable. That said, we should be able to know which GUI version belong to the master branch, and which to the release branch. Right now we just a single version number - 10 at the moment.
Quoted 6 lines
- Make OpenVPN-GUI fail/warn if it can't reach interactive service
In fact it may be ok to require the iservice to operate the GUI -- that is do not allow the GUI to directly start openvpn.exe -- running as admin will fail with a message then). But leave this for later?
I think we can leave this for later, as long as the Interactive Service is enabled at install time. That way much fewer users will get this nasty surprise.
Quoted 7 lines
I think the installer should include the following commands
(i) openvpnserv.exe -install <- this will install both auto and interactive services
this is probably there in the current NSIS installer (the user can disable it by chosing not to install any service, but its not possible to install only one of those (not yet, at least).
Yes, this is done by default right now.
Quoted 1 line
(ii) openvpnserv.exe --start interactive
This is not done by default. I will add it to the installer code.
Quoted 3 lines
Do not start the automatic service by default as that is meant for expert users. Else it will spawn-up openvpn.exe for all configs found and possibly mess-up with interactive use.
This is the default behavior right now, and we should keep it that way.
Quoted 5 lines
- Relax OpenVPN's config file permissions, or...
- ... make OpenVPN-GUI read configs from user's home dir by default
Quoted 8 lines
With the pull #13, its now possible for the user to edit HKCU\Software\OpenVPN\config_dir to point the GUI to an alternate location for configs. Currently there are no access checks in the service, so any location with read access will work.
Let's revisit this after the service is hardened to restrict configs and options. Then we can decide how to modify the installer to choose appropriate defaults for
config_diretc.
Having an easy method for configuring the OpenVPN configuration file directory is needed in my opinion. Right now one has to launch regedit.exe and change the path, or do some magic incantations in Powershell - not exactly user-friendly.
Quoted 5 lines
Given that OpenVPNService and OpenVPNServiceInteractive have been separated, replacing the non-interactive variant with openvpnserv2 should not be too difficult.
Quoted 8 lines
While the two services can be independently stopped and started the two are installed and removed together:
openvpnserv.exe --install sets up two services OpenVPNService and OpenVPNServiceInteractive. So any replacement will have to use a name distinct from those. I think openvpnserv2 uses the same name "OpenVPNService" which will cause a conflict.
In the long run it may be better to remove the automatic service completely from the openvpnsev.exe code.
Disabling the automatic service part in openvpnserv.exe should be fairly straightforward. There's probably some simple routine which calls Windows APIs to register the new services, which we could modify. Then we also need to remove the old service in the installer/uninstaller.
Signature · 5 lines
Samuli Seppänen Community Manager OpenVPN Technologies, Inc irc freenode net: mattock