This is a long running topic with lot's of usefull information. And since the
release of 2.4.0 we had some awesome new features.
As i'm constantly trying to improve security in my vpn-configs, i'm trying to wrap-up my ideas over here. Any comment would be very helpfull!
As thoroughly
explained in the security-overview, we need to take care of 2 different security-issues:
- The control-channel
- The data-channel
The first is handled with a TLS-handshake, takes care of the authentication of both client and server
and the exchange of keys for the data-channel. So it's very important to have a reliable crypto-channel here with
Perfect Forward Secrecy , meaning an adversary cannot retreive keys over lang time (i do have tunnels running for years allready).
Luckily for us, this is all solved in current TLS versions, thus choosing a good TLS-ciphersuite does help us.
As this is pretty difficult to choose for a non-crypto-specialist (openvpn --show-tls gives lots of options) you can let OpenVPN choose for you, but enforcing a high-level of crypto by using:
tls-version-min 1.2
In both client and server config.
One of the great new features of 2.4 is the option tls-crypt , which crypts packets and lots of awesome things (see
manpage and
this topic )
Generate the tls-crypt key using:
openvpn --genkey --secret tc.key
And include in your client and server config, either inline using
<tls-crypt> and </tls-crypt>
or
tls-crypt /path/to/tc.key
Now we have a state-of-the-art control-channel which we use to setup our data-channel. As the data-channel has symmetric encryption, we need to use another set of crypto (openvpn --show-ciphers shows you the options) and hashing algoritm (HMAC).
As this another part of black magic for the most of us, i did
some research(1) research(2) research(3) on some sources, including the openvpn documentation and for now it's advised to use AES-256-GCM and SHA256 (Eventually AES-256-CBC when GCM is not available)
Remark: I haven't played with the NCP-cipher options yet. More to follow
Now we need to use a good HMAC (Message Authentication using a hash-algoritm) protocol. SHA256 will do for this, as it it's recommended:
auth SHA256
Every now and then we need to renegotiate the key, used for crypto of the data-channel. The default value is 3600 seconds, which would be a secure enough option. If you are really paranoia you could lower this value to, i.e., 10 minutes by adding
reneg-sec 360
to both client and server.
Wrapping everything up to a server and client-config, i end up with a snippets like this:
tls-version-min 1.2
cipher AES-256-GCM
auth SHA256
dh /path/to/dh.param
tls-crypt /path-to/tc.key
# reneg sec 360
tls-version-min 1.2
cipher AES-256-GCM
auth SHA256
tls-crypt /path-to/tc.key
# reneg-sec 360
As said before, i haven't played with the ncp-ciphers options. And as GCM-mode allready includes HMAC-functions, what's the additional SHA256 adding for security? Still some questions left.
Please, any comments on this?