Tuesday, May 14, 2019

Making sense of VPN encryption

I make many VPN tunnels, primarily with pfSense but I do have some others out in the wild. Currently, I am operating under my own preconceived notions based on my experience and knowledge. I have a computer engineering degree, which is math heavy, but I graduated ~20 years ago. I have not flexed that muscle in over a decade.

Now my understanding (or misconception) is:

1.) Higher the encryption, higher the CPU load – how that works with the likes of AES-NI, I am unsure.

2.) Avoid:

a. Algorithms - Blowfish, 3DES & CAST12

b. Hashes - SHA1, MD5

c. Diffie-Hellman groups – 1, 2, 5, 22, 23, 24

3.) GCM has better throughput than CBC

Now normally I used to use SHA2-256 with AES256 and a DH group of 14. Recently when both firewalls don’t suck I do AES256-GCM at 128 bits, SHA512 and a DH16. I also do this on both phases, with the same DH group on PFS.

What I do not know:

1.) What is this AES-XCBC hash and is it better? In any way.

2.) Ideally, I install overkill firewalls when hardware and provision them very well when virtual. So what is the real best
bang-for-the-buck in terms of not kneecapping performance but in case I get audited I don’t have some snooty
thinks he knows it all give a “ugh, why did he do that?! That’s so weak or stupid”. I would rather get a “Well… damn.”

3.) Lifetimes, I have some set with Phase 1 at 24 hours and phase 2 at 12 hours and others where Phase 1 is 4 hours
and phase 2 is hourly. Mostly in an attempt possibly futile to resolve an issue. However – is there a sweetspot?
99.9986% of the time, I’m dealing with 1 – 250 RDP connections over the VPN to (a) terminal server(s) and they just
want it to work.

4.) Any other magic tweaks pertinent to pfSense 2.4? Like is Make before Break good, would that solve the lifetime
issues so I can have smaller lifetimes? MSS clamping? IP Compression?

5.) OpenVPN only but they have a freak ton of algorithms, CBC, CFB, CFB1, CFB8, GCM, OFB. Is their a safest encryption
that has really good throughput? Now I am using mostly Intel with AES-NI and the newer netgates have Marvell
arms with the encryption chip butit is 2.4.4-p2 and they *STILL* don’t have hardware crypto really working, they say
it works even though you set No hardware crypto, but I don’t know. I do know if I set stuff to 11 and run a whole
bunch of vpn tunnels pumping iperf on all of them, the processors still don’t much peak above idle, maybe small
jumps to 30%. So for the amount I am doing, most of my firewalls have MASSIVE overkill processors.

6.) Am I an idiot, should I give up and become a cabbage farmer?



No comments:

Post a Comment