Features comments/request
Hi all, James,
I'd like to ask for a couple of features (little ones) added to OpenVPN. Comments welcomed.
1) OpenVPN should refuse to start a connection based on shared secret when the file containing that key is world readable (or writable). Paranoia won't even like group readable :-)
Really, that's an important piece (the most?) in that kind of VPN, we don't want it to be public. Just imagine an (non-chrooted) anonymous ftp server, a bad configured web server/cgi-script, a malicious user,...
2) Each OpenVPN daemon should delete its pidfile when stoping, since it was that very same daemon that created it.
It has no sense to have the init.d scripts deleting these files (and stoping nonexistent daemons) since the daemon could have been killed before the init.d script tried to stop it.
Thanks in advance for any comments.
Best regards.
Signature · 5 lines
Alberto Gonzalez Iniesta | They that give up essential liberty [email protected]... | to obtain a little temporary safety Encrypted mail preferred | deserve neither liberty nor safety. Key fingerprint = 9782 04E7 2B75 405C F5E9 0C81 C514 AF8E 4BA4 01C3
Hi Alberto,
Quoted 9 lines
I'd like to ask for a couple of features (little ones) added to OpenVPN. Comments welcomed.
1) OpenVPN should refuse to start a connection based on shared secret when the file containing that key is world readable (or writable). Paranoia won't even like group readable :-)
Really, that's an important piece (the most?) in that kind of VPN, we don't want it to be public. Just imagine an (non-chrooted) anonymous ftp server, a bad configured web server/cgi-script, a malicious user,...
Good idea, however what if someone doesn't want to deal with the protections on every file and instead just eliminates group/world access to the key directory? Therefore, erring on the individual file protections could create a false sense of paranoia?
Quoted 5 lines
2) Each OpenVPN daemon should delete its pidfile when stoping, since it was that very same daemon that created it.
It has no sense to have the init.d scripts deleting these files (and stoping nonexistent daemons) since the daemon could have been killed before the init.d script tried to stop it.
The complication here is that a lot of people will want to downgrade privilege using --user and/or --group. That means that when an OpenVPN daemon is ready to exit, it might lack the privilege to delete its own pidfile. I've seen other daemons deal with this by chowning the pid file to the user/group that the daemon plans to setuid/setgid to.
Having said that, I think both ideas are worth doing.
Thanks,
James
Quoted 5 lines · James Yonan
Hi Alberto,
Quoted 3 lines
I'd like to ask for a couple of features (little ones) added to OpenVPN. Comments welcomed.
Quoted 7 lines
Quoted 3 lines
1) OpenVPN should refuse to start a connection based on shared secret when the file containing that key is world readable (or writable). Paranoia won't even like group readable :-)
Good idea, however what if someone doesn't want to deal with the protections on every file and instead just eliminates group/world access to the key directory? Therefore, erring on the individual file protections could create a false sense of paranoia?
Hi James,
Yes, forcing directory security could be a better solution, but what happens if the user wants to keep the key in a directory like /etc? or /usr/local/etc? From my point of view (Debian's package) there's no problem, I'll probably go for a /etc/openvpn/secrets directory, but just wanted to note this in case you wanted to think about it.
Quoted 11 lines
Quoted 5 lines
2) Each OpenVPN daemon should delete its pidfile when stoping, since it was that very same daemon that created it.
It has no sense to have the init.d scripts deleting these files (and stoping nonexistent daemons) since the daemon could have been killed before the init.d script tried to stop it.The complication here is that a lot of people will want to downgrade privilege using --user and/or --group. That means that when an OpenVPN daemon is ready to exit, it might lack the privilege to delete its own pidfile. I've seen other daemons deal with this by chowning the pid file to the user/group that the daemon plans to setuid/setgid to.
Didn't think of that. Good point. :-)
Thanks for your work.
Best regards,
Alberto
Signature · 5 lines
Alberto Gonzalez Iniesta | They that give up essential liberty [email protected]... | to obtain a little temporary safety Encrypted mail preferred | deserve neither liberty nor safety. Key fingerprint = 9782 04E7 2B75 405C F5E9 0C81 C514 AF8E 4BA4 01C3
----- Original Message -----
From: "Alberto Gonzalez Iniesta" <[email protected]...>
To: "James Yonan" <[email protected]...>
Cc: <[email protected]>
Sent: Thursday, June 27, 2002 1:26 AM
Subject: Re: [Openvpn-devel] Features comments/request
Quoted 4 lines · James Yonan
Quoted 3 lines
Hi Alberto,
Quoted 1 line
I'd like to ask for a couple of features (little ones) added to
OpenVPN.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Comments welcomed.
1) OpenVPN should refuse to start a connection based on shared secret when the file containing that key is world readable (or writable). Paranoia won't even like group readable :-)
Good idea, however what if someone doesn't want to deal with the
protections
Quoted 11 lines
Quoted 3 lines
on every file and instead just eliminates group/world access to the key directory? Therefore, erring on the individual file protections could create a false sense of paranoia?
Hi James,
Yes, forcing directory security could be a better solution, but what happens if the user wants to keep the key in a directory like /etc? or
/usr/local/etc? From my point of view (Debian's package) there's no problem, I'll probably go for a/etc/openvpn/secretsdirectory, but just wanted to note this in case you wanted to think about it.
I added a warning message if key files are group/others accessible (in CVS). I think that's reasonable (as opposed to requiring protections) given the fact that if you want to disable encryption/authentication altogether or use a cleartext-only OpenVPN by building without OpenSSL, you also get a warning message.
Quoted 1 line
Quoted 1 line
Quoted 1 line
2) Each OpenVPN daemon should delete its pidfile when stoping, since
it
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
was that very same daemon that created it.
It has no sense to have the init.d scripts deleting these files (and stoping nonexistent daemons) since the daemon could have been killed before the init.d script tried to stop it.The complication here is that a lot of people will want to downgrade privilege using --user and/or --group. That means that when an OpenVPN daemon is ready to exit, it might lack the privilege to delete its own pidfile. I've seen other daemons deal with this by chowning the pid
file to
Quoted 3 lines
Quoted 1 line
the user/group that the daemon plans to setuid/setgid to.
Didn't think of that. Good point. :-)
The only way I can think to do this would be to fork off the work process before the UID/GID downgrade. Then the parent would just sit around as root and wait until the downgraded child exited, deleting the pidfile. It would work but I'm hesitant to complexify the code and add a new process for something as trivial as deleting a file. Too bad open() doesn't have a delete-on-close flag.
Chowning the pid file doesn't work because unlink needs write access to the directory as well.
Quoted 1 line
Thanks for your work.
Your welcome!
Ciao,
James
Quoted 11 lines
Best regards,
Alberto--
Alberto Gonzalez Iniesta | They that give up essential liberty
[email protected]... | to obtain a little temporary safety
Encrypted mail preferred | deserve neither liberty nor safety.Key fingerprint = 9782 04E7 2B75 405C F5E9 0C81 C514 AF8E 4BA4 01C3