How to log details of certificates for each connection in OpenVPN?
Posted: Wed Mar 25, 2020 12:10 pm
I'm running an OpenVPN-server for some IoT-devices and many of those devices need their certificates replaced because the old ones expire. Updating those certificates is a fragile, manual process using slow mobile connections and additionally those devices can be accessed using OVPN only. For this reason, I want to make extra sure that the certificates have been replaced successfully and new connections are established using those. The problem is that I'm unable to find a somewhat easy way to get enough details from OVPN to e.g. see the serials or issue time of of the replaced certs.
So, how to log details of certificates for each connection in OpenVPN?
Best would be some additional column in the status log, but even --status-version 2 doesn't seem to provide any additional details from the certs. Things like common name of the certs are the same between old and new ones. Is there any support for additional custom columns based on internally available data?
I've additionally increased the log level up to 9, but besides logging lot of low level packet-related stuff, I didn't see any additional certificates details of clients as well. Depending on the log level, things could be easily missed, though, so something logging only those certificate details itself would be preferred anyway.
Concepts like "--client-connect" and "--learn-address" seem to provide common names as well only. Additionally, because things are of temporary interest only, I would like to avoid implementing some too custom software for this case.
Thanks!
So, how to log details of certificates for each connection in OpenVPN?
Best would be some additional column in the status log, but even --status-version 2 doesn't seem to provide any additional details from the certs. Things like common name of the certs are the same between old and new ones. Is there any support for additional custom columns based on internally available data?
I've additionally increased the log level up to 9, but besides logging lot of low level packet-related stuff, I didn't see any additional certificates details of clients as well. Depending on the log level, things could be easily missed, though, so something logging only those certificate details itself would be preferred anyway.
Concepts like "--client-connect" and "--learn-address" seem to provide common names as well only. Additionally, because things are of temporary interest only, I would like to avoid implementing some too custom software for this case.
Thanks!