Skip to contentSkip to conversation

feature request: ability to pass pkcs#11 PIN via command line/config

Openvpn-devel Richard Hartmann 2 participants 5 messages Jun 8, 2007 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi all,

I am setting up a test case where the user is supposed to plug in his USB token before booting. Once he boots up and prior to him logging in to Windows, I need to establish an OpenVPN connection to our aggregator.

To do this, I am using a 'solution' where I abuse a netcat connection to cat the PIN to the token into OpenVPN. My request would be to do one or more of the following:

1) Make OpenVPN aware that it could use the passphrase received via --askpass not only as private key _passphrase_, but as private key _PIN_. (One could argue that this is a bug)

2) Offer --askpin [file], same as --askpass

3) Offer not only pkcs11-pin-cache, but also pkcs11-pin-value or similar

I am fully aware that this is a potential security risk and thus I would suggest using the same approach as with using --askpass via
file: Make it a compile time option. In 99% of the cases, you do _not_ want the user to be able to do it this way. But when someone really knows what he does, why he does and is aware of the implications, there should be a way to make this work without pain.

FYI, I am using 2.1 RC 4. If this issue has been addressed in head, please let me know. Also, if this is the wrong place for this, please tell me where to direct feature requests, I could not find any other place.

Best regards,
Richard

#1 lore raw

As you figured it out... This is not wise in term of security. So I am sorry, but I don't think this should be supported. Especially when you can achieve the same via the management interface.

Best Regards,
Alon Bar-Lev.

Quoted 48 lines · Richard Hartmann

Hi all,

I am setting up a test case where the user is supposed to plug in his USB token before booting. Once he boots up and prior to him logging in to Windows, I need to establish an OpenVPN connection to our aggregator.

To do this, I am using a 'solution' where I abuse a netcat connection to cat the PIN to the token into OpenVPN. My request would be to do one or more of the following:

1) Make OpenVPN aware that it could use the passphrase received via --askpass not only as private key _passphrase_, but as private key _PIN_. (One could argue that this is a bug)

2) Offer --askpin [file], same as --askpass

3) Offer not only pkcs11-pin-cache, but also pkcs11-pin-value or similar

I am fully aware that this is a potential security risk and thus I would suggest using the same approach as with using --askpass via
file: Make it a compile time option. In 99% of the cases, you do _not_ want the user to be able to do it this way. But when someone really knows what he does, why he does and is aware of the implications, there should be a way to make this work without pain.

FYI, I am using 2.1 RC 4. If this issue has been addressed in head, please let me know. Also, if this is the wrong place for this, please tell me where to direct feature requests, I could not find any other place.

Best regards,
Richard

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#2 lore raw

Hi Alon,

Quoted 1 line

This is not wise in term of security.

This depends on the use case and the requirements. If there was a way to have the user enter their PIN before logging into Windows, I would gladly use that.
Furthermore, the method I described is still more secure than any solution based on certificates and keys which are stored on the hard drive. With a token, the cert/key exist exactly _once_. Both a keylogger and a trojan would be useless against my setup. The _only_ attack vector involves physical access to the token. If someone steals the token, the end user will not be able to log in and complain to IT. Thus, any stolen certificate can be disabled within days, if not hours.
In the classic case, there is no way to be certain if your locally stored certificate and key along with the passphrases are in the hands of others.

Quoted 1 line

So I am sorry, but I don't think this should be supported.

If you look at --askpass via file, you can see how this problem can be
solved: Offer it to people who pass the test of being able to compile OpenVPN. They either know what they do or they really do not deserve otherwise.

Quoted 1 line

Especially when you can achieve the same via the management interface.

If by management interface you mean the netcat hack I am using, this does not work as desired, yet. While I can flawlessly start my batch files on a running Windows system and connect automagically, every attempt to make this work as a Windows system service failed with a timeout on the server's side. I can only presume that the netcat trick is not working, for some reason.

If you can give me any insights on how to avoid that (or how to pass the PIN as a remote connection password, as I am thinking about replacing the system service with a remote connection, which plays nicely with Windows' GINA), I would be honestly thankful to hear about this, though.

Best regards,
Richard

#3 lore raw

Well... you keep saying that you know what you are doing... So please explain me....
1. What happens if no card is inserted at startup?
2. What happens if the card is removed?
3. What happens if the card is removed and inserted?
4. What happens if the wrong card is inserted?

Smartcards are dynamic in nature, and in order to automate this, you must really know what you are doing. Simply specifying static PIN is really not enough.

So if you really know what you are doing, the management API is the place to automate the process. You can read the token name and decide which PIN to use, you can also deal with token remove and insert.

I don't have a clue why you use netcat and not perl script I offered... But I am sure that if you know what you are doing you can solve this issue.

Replacing GINA seems as a good idea, but this is not the right way to go... If you wish to contribute to other users, a RAS provider for OpenVPN is a solution that all Windows users wait for... RAS is the standard way to look at OpenVPN, so you "dial" during logon.

Best Regards,
Alon Bar-Lev.

Quoted 58 lines · Richard Hartmann

Hi Alon,

Quoted 1 line

This is not wise in term of security.

This depends on the use case and the requirements. If there was a way to have the user enter their PIN before logging into Windows, I would gladly use that.
Furthermore, the method I described is still more secure than any solution based on certificates and keys which are stored on the hard drive. With a token, the cert/key exist exactly _once_. Both a keylogger and a trojan would be useless against my setup. The _only_ attack vector involves physical access to the token. If someone steals the token, the end user will not be able to log in and complain to IT. Thus, any stolen certificate can be disabled within days, if not hours.
In the classic case, there is no way to be certain if your locally stored certificate and key along with the passphrases are in the hands of others.

Quoted 1 line

So I am sorry, but I don't think this should be supported.

If you look at --askpass via file, you can see how this problem can be
solved: Offer it to people who pass the test of being able to compile OpenVPN. They either know what they do or they really do not deserve otherwise.

Quoted 1 line

Especially when you can achieve the same via the management interface.

If by management interface you mean the netcat hack I am using, this does not work as desired, yet. While I can flawlessly start my batch files on a running Windows system and connect automagically, every attempt to make this work as a Windows system service failed with a timeout on the server's side. I can only presume that the netcat trick is not working, for some reason.

If you can give me any insights on how to avoid that (or how to pass the PIN as a remote connection password, as I am thinking about replacing the system service with a remote connection, which plays nicely with Windows' GINA), I would be honestly thankful to hear about this, though.

Best regards,
Richard

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

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

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

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

#7 lore raw
Quoted 7 lines · Richard Hartmann
Quoted 2 lines · Alon Bar-Lev

You keep forgeting that attempting to authenticate to smartcard using invalid PIN will eventually lock it.

If there is only one PIN, that is not any threat. It either authenticates correctly or times out. In neither case is there a wrong PIN sent to the token.

If you use this PIN to authenticate by mistake to another token you will lock this token.
If you remove and insert the token you should require reauthentication, this is how smartcards should be used.

Quoted 3 lines

I think it would be beneficial to every subscriber if we were to stop the debate about the philosophical differences we are having. This is, after all, a developer list.

Before you go and develop you need to soleve the philosophical issues.

Quoted 3 lines

If you can point me to docs for setting up RAS correctly, I would gladly try that approach and report back to the list if and how this works via the new pkcs#11 interface.

http://msdn2.microsoft.com/en-us/library/ms832355.aspx

An OpenVPN GUI can be develop as a provider... This is the best approach for Windows... This has nothing to do with PKCS#11, but will solve your issues as well.

Best Regards,
Alon Bar-Lev.