Revoke the certificate, not the CA.
Kubernetes can't revoke an x509 client certificate. Lose a laptop holding a kubeconfig and the credential stays valid until it expires, unless you rotate the whole cluster CA. certrevoker blocks one specific certificate within seconds, using only extension points Kubernetes already has.
View on GitHubThe problem
kube-apiserver accepts any client certificate that chains to its CA and hasn't expired. It has no revocation list and no OCSP check, and nothing else stops a certificate.
No revocation check
kube-apiserver checks the chain and the expiry date, nothing more. There is no CRL or OCSP support, and no denylist.
Deleting the CSR does nothing
Certificates issued through the CSR API keep working after the CSR is gone, and Kubernetes deletes approved CSRs within an hour anyway.
RBAC isn't enough
Remove the bindings and the user still gets everything granted to system:authenticated. system:masters skips authorization altogether.
How it works
Since v1.32, kube-apiserver tags every certificate-authenticated request with the certificate's SHA-256, as authentication.kubernetes.io/credential-id. certrevoker puts an authorization webhook in front of Node and RBAC that denies any request carrying a revoked ID.
- 1 · requestClient certificate
- 2 · authenticationX509SHA256=…
- 3 · always firstsystem:masters
- 4 · webhookcertrevoker: deny if revoked
- 5 · authorizerNode
- 6 · authorizerRBAC
An explicit deny, before RBAC
The webhook returns Deny for a revoked credential ID and no opinion otherwise. An explicit deny stops the chain, so no RBAC grant applies to the revoked certificate. Kubelets and aggregated API servers authorize through SubjectAccessReviews, which reach the same webhook.
A record Kubernetes doesn't keep
Every client certificate issued through the CSR API is copied into an IssuedCertificate object before the CSR disappears. Credential IDs the webhook sees in use are recorded too, which catches certificates kubeadm signed directly, such as admin.conf.
Revoke with a reason
Log in with a Kubernetes token. The portal uses that token for every call, so RBAC decides who can revoke and the audit log records them. Paste a certificate or kubeconfig to find its ID. Revocations are ordinary objects, so kubectl works as well.
Tested end to end
Run with scripts/e2e.sh on a kubeadm 1.37.2 cluster with one control-plane node and one worker. Every scenario was checked against the live cluster.
| Scenario | What happened | Time | Check |
|---|---|---|---|
| Revoke in the portal, then call kube-apiserver | Denied: client certificate X509SHA256=… has been revoked: laptop stolen | 10s | pass |
| Revoked certificate, straight to a kubelet | Denied through the kubelet's SubjectAccessReview | 290skubelet cache, 5m default | pass |
| cluster-admin through an RBAC group | Denied; RBAC grants don't apply after an explicit deny | 0s | pass |
| Other users | Unaffected | – | pass |
kubeadm admin.conf, controller-manager, scheduler | Found in use and added to the inventory, though never issued through a CSR | <15s | pass |
Credential ID vs kubectl auth whoami | Identical | – | pass |
| Webhook scaled to zero | Revoked certificate works again (fails open by design), and is denied again once the webhook is back | 0s | pass |
kubeadm super-admin.conf | system:masters is allowed before any webhook runs, so revoking it has no effect. Expected. | – | limit |
| Foot · 8 shownof 26 checks; all are in the README | 7 pass + 1 known limitcounted down this column | 290s maxslowest path: the kubelet cache | 26 / 26checks passed |
The portal
Every certificate the cluster has issued or used, with its validity, when it was last seen, and one action. The portal and this site share one design: flat cells, cyan for what's selected, copper only for revocations.



super-admin.conf flagged as not enforceableDecisions before you deploy
certrevoker is a proof of concept. These trade-offs are yours to accept or change.
The kubelets, controller-manager and scheduler authenticate with client certificates, so the webhook uses failurePolicy: NoOpinion. A certrevoker outage then can't break the cluster, but revoked certificates work until it's back.
No authorizer can deny that group. Keep certificates like kubeadm's super-admin.conf offline. If one leaks, rotating the CA is still the only fix.
About 10s at kube-apiserver (unauthorizedTTL), but up to 5 minutes for requests sent directly to a kubelet, unless kubelets lower cacheAuthorizedTTL. Requests already in progress continue.
Deploy
Four steps on a kubeadm-style cluster. The README has the details and how to roll back.
Build the binary and image, then import the image into containerd on the control-plane node.
go build -o bin/certrevoker \
./cmd/certrevoker
docker build -t certrevoker:dev .A private CA for the webhook and portal, and the client certificate kube-apiserver uses to call the webhook.
./scripts/gen-certs.sh tls \
<control-plane-ip>CRDs, RBAC and the Deployment, installed before kube-apiserver starts calling the webhook.
kubectl apply -f deploy/
kubectl apply -f tls/secret.yamlSwap --authorization-mode for the structured config, which keeps Node and RBAC after the webhook.
--authorization-config=
/etc/kubernetes/certrevoker/
authz-config.yamlUpstream
The likely long-term fix is SIG Auth's KEP-6285, structured x509 authentication configuration. It adds CEL validation rules that can reject specific credential IDs during authentication, which would also cover system:masters. It is still provisional. certrevoker shows what is possible now, and the gaps a built-in mechanism has to close: kubelets, caches, and knowing which certificates exist.
Written in Go on the Kubernetes client libraries. Unit tests run in CI, and an end-to-end script drives a real cluster.