This message was deleted.
# rke2
a
This message was deleted.
c
Treat this as if an attacker compromised the root password or ssh keys to your nodes. Delete the cluster and all the nodes and rebuild from scratch.
Kubernetes does not support certificate revocation so there is no way to revoke access to the client cert that is contained in the admin kubeconfig. You have to completely replace the root CA for the cluster. Even if you do that, you have no way of knowing what the attacker may have planted on the nodes while they had access - so your best bet is to just start over.
d
There was no attack, it's just that the employees initially had access to the cluster using this key, and now one of them has been fired.
You have to completely replace the root CA for the cluster.
Can you advise me please how to do this exactly?
c
don’t share access to the admin kubeconfig. Create unique certs and RBAC for each user so that you can delete them if you need to revoke access.
Rancher will do this for you, as will other projects that offer access management for Kubernetes
d
don’t share access to the admin kubeconfig
Yeah, yeah, I know 😆 I already don't
c
Once you’ve rotated through once, you can remove the old server CA and cross-signed new CA from the bundles and run the
rotate-ca
command again. There is not currently a script to handle this cleanup for you.
d
I've read this article thrice today, along with bash scripts, but unfortunately I couldn't figure out what exactly needs to be done Correct me please if I'm wrong: 1. use
generate-custom-ca-certs.sh
without the
service.key
,
root-ca
and
intermediate-ca
files 2. use
rke2 certificate rotate-ca --force
3. ... yeah, next steps unclear 🥹
c
no, don’t generate custom certs. We do not test going from self-signed to custom.
Read the docs I linked to to rotate the self-signed certs
once you’ve followed those steps, edit the CA bundles to remove the old CA certs, and the cross-signed new CA cert, and then perform the rotate-ca step again.
d
Thanks, I'll try to understand this article again tomorrow 🙏