After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675092 - VPN configuration can not be saved without private key password that is stored unencrypted.
VPN configuration can not be saved without private key password that is store...
Status: RESOLVED DUPLICATE of bug 731891
Product: NetworkManager
Classification: Platform
Component: VPN: openvpn
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-04-29 17:35 UTC by Adam Pribyl
Modified: 2014-08-11 11:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
NM VPN settings (51.91 KB, image/png)
2012-05-25 13:43 UTC, Adam Pribyl
Details

Description Adam Pribyl 2012-04-29 17:35:58 UTC
While it looks like the NM configuration supports the option to not save a password for a VPN private key (setting cert-pass-flags=2 if I found it right), then GUI won't save the VPN configuration if the password is not entered (save button remains grey). The key password is then stored unencrypted in the /etc/NetworkManager/system-connections/<vpn configuration>. This really is not very secure.
Comment 1 Dan Williams 2012-05-24 21:02:58 UTC
Note that /etc/NetworkManager/system-connections/<vpn configuration> is readable only by root and users that are explicitly allowed to see it, which is restricted to the user that created the connection by default.  If passwords are stored in the config file then they are expected to be available at any time, even before a user is logged in.  The correct solution here is to ensure that the secrets are saved by a user agent using cert-pass-flags=2.

If the GUI isn't saving the connection, then that's a bug in the GUI.  It's likely that some other field is not correctly filled in and thus you aren't allowed to save.

I assume this is openvpn?  Can you give me a general idea of your configuration, or better yet export it (and then XXX out the sensitive stuff) so I can import it and see what the problem is?
Comment 2 Adam Pribyl 2012-05-25 13:43:14 UTC
Created attachment 214942 [details]
NM VPN settings

Yes this is OpenVPN, but this is IMHO problem in the GUI.

Just run
nm-connection-editor --create --type vpn
select OpenVPN and Create

On the VPN tab, you may fill everything correct, but without typing password for the Private Key, you are not allowed to save the settings. If you type incorrect password, NM will never ask for the right one. The password is then stored in plain text in a config file.

If you change the config file option flag in /etc/NetworkManager/system-connections/<configname>, then NM asks for password correctly and you do not need to store it here.

It does this regardless of the checkmark that this connection should be available to all users which is BTW also available after you type the password.
Comment 3 AbortRetryFail 2014-02-25 19:51:01 UTC
This is still a problem. 

I've tried to work around this even by editing the /etc/NetworkManager/system-connections/<configname> file to remove the cert-pass=xxxx entry. When you try to connect, NetworkManager prompts the user for the passphrase, as expected. It connects, but then it saves this back to the configuration file! There is no way to NOT save the passphrase for your key!

That makes it no more secure than just having an unencrypted key file stored on your laptop. If stolen, somebody can use that key to access your VPN until the certificate is revoked. With physical access (lost/stolen device), the argument that the file is only readable by root is a moot point.
Comment 4 Adam Pribyl 2014-02-26 12:48:05 UTC
I agree the bug is still present, but the workaround works. Remove the 

cert-pass= 

and add

cert-pass-flags=2

this will avoid the password to be saved and user will be always propmpted. 

Obviously this is not a problem of NetworkManager itself but the NM GUI which does not accomodate this scenario.
Comment 5 AbortRetryFail 2014-02-26 14:30:49 UTC
Thanks, that does work. 

I didn't try it before because you said it would "ensure that the secrets are saved by a user agent," which didn't seem to be conducive to never saving the password.

Is this option documented anywhere? I couldn't find it in the manpage for NetworkManager.conf
Comment 6 Thomas Haller 2014-08-11 11:28:05 UTC
(In reply to comment #5)
> I didn't try it before because you said it would "ensure that the secrets are
> saved by a user agent," which didn't seem to be conducive to never saving the
> password.
> 
> Is this option documented anywhere? I couldn't find it in the manpage for
> NetworkManager.conf

it's in `man nm-settings`. See "Secret flag types".



closing this bug as duplicate of bug 731891 (I feel that the other bug has a better subject, so I dupe this one not the other way around).

*** This bug has been marked as a duplicate of bug 731891 ***