While there is currently no plugin to blacklist single identities (or certificates/keys), the whitelist plugin provides a way to whitelist all allowed identities. It comes with a command to manage the whitelist while the IKE daemon is running.
Doing something similar in a more dynamic way (e.g. to reject all identities that match a certain pattern) is possible via the ext-auth plugin. The configured script (or command) is called after a successful client authentication and receives the client identity in the IKE_REMOTE_ID
environment variable. If the command exits with anything but 0
, the client will be rejected.
Technically, the proper way to block client certificates is via CRL or OCSP. Note that the "hold" reason (--reason certificate-hold
with pki --signcrl
) is primarily relevant if you use delta CRLs, because such revocations can be reverted in a delta CRL via "removeFromCRL" reason (which strongSwan currently doesn't support at all). But as you pointed out, the pki
command currently also doesn't support omitting (i.e. reverting) some of the revocations when using the --lastcrl
option to create a new full CRL based on an old one.
And while you could create a new CRL from scratch that includes all certificates that are currently revoked, the problem is that it's currently not possible to manually specify the serial number (cRLNumber
) of the issued CRL. Unless --lastcrl
(or --basecrl
) is used, it will always be 1. And with the same (or lower) serial, the CRL won't be replace when it's reloaded (unless you clear all credentials and caches completely before loading it, which is only possible with swanctl
and kind of a drastic measure - as would be to restart the IKE daemon just to reload the CRL).
Using OCSP could be an option, because e.g. with openssl ocsp
you could provide a simple index file that you can manually create and modify (see e.g. my answer here for a description of the format). Besides having to run that additional service, a possible disadvantage is that OpenSSL requires that the index contains all currently valid certificates as well.