Catalyph wrote: ↑Sat Jul 10, 2021 4:55 am
I have TrueNAS 12 and the OpenVPN service up and running with certificates.
I have certs for each user, thinking that is a User cert became compromised it would be easy to revoke the cert to block vpn access.
Well a users machine was compromised and the cert has possibly copied.
How can I revoke the cert in the TrueNAS server? I cannot find a way that works without having the other 30+ users certs becoming invalid also.
Your thinking was quite correct. This is why we recommend against using the
--duplicate-cn option; so that any single compromised client can easily be blocked.
I can't help you with the specifics of your TrueNAS server and (what I suppose is) its integrated CA management utility, but I can explain a bit about the openvpn side of it, and I'll give you other options for access control.
First, the option you need on the server is
--crl-verify; this tells openvpn where to find the CRL (certificate revocation list) and what to do with it. Please refer to the manual for all the details. It only works if your CA properly publishes the CRL, of course.
Next, there are a couple of simpler options for server-side access control that do not need to involve the TLS CA nor revocation at all. If you create a
--client-config-dir you can
--disable a client by making a file with its certificate CN as the filename. For example if you had a client common name of "rob0" and you wanted to get rid of the scoundrel, and your CCD is /etc/openvpn/ccd, just do:
Code: Select all
echo disable > /etc/openvpn/ccd/rob0
and you'll never have to put up with that client again (be sure of course to kill any existing connection in the
--management interface.)
My personal favorite also involves using a CCD, but in reverse. With the
--ccd-exclusive option set, only clients with files in the CCD (where again, the filename matches the certificate common name) are allowed to connect. This requires a bit of coordination between the server admin and the CA manager, but on any openvpn I have ever run, I was both of those at the same time, so it wasn't a problem.

When you create a new client, and the certificate common name is "
Catalyph", simply:
to enable the new client to connect. And
rm(1) is the way to block any user; just delete (or mv/rename) the file.
I hope this helps, regards, rob0