Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: recommend adding ClusterSecret resources to EncryptionConfiguration #128

Open
applejag opened this issue Apr 24, 2024 · 0 comments
Open

Comments

@applejag
Copy link

applejag commented Apr 24, 2024

Common Kubernetes hardening trick: encrypting secrets! :) Sorry for bigger issue, it just kind of grew.


Contrast to popular belief, Kubernetes Secrets are not protected by only basic base64 encoding. Kubernetes also has a encryption-at-rest feature.

From the Kubernetes API perspective (i.e when accessing kube-apiserver, such as via kubectl), you always get the decrypted version. Changing encryption-at-rest only changes how the objects are stored in etcd. The encryption and decryption is done by kube-apiserver only, so etcd has no knowledge by itself on how to access the encrypted resources. This does not help if an attacker gets kubectl access to your cluster, but it does help if an attacker gets access to etcd, or perhaps your etcd backups. This is solved by giving kube-apiserver a private key to encrypt and decrypt the data, either from a file or by using a KMS service to not store the sensitive encryption keys on the control-plane nodes.

Most common setups of Kubernetes either comes without encryption-at-rest, or it only encrypts a small subset of resources. Commonly only Secrets. As ClusterSecret resources store sensitive data, then they should also be included in that list.

Would be nice with a chapter in the installation docs to add ClusterSecret resources to the list of encrypted resources, if the user has encryption-at-rest enabled. Doesn't need to be super in-depth, but at least hinting to the Platform/DevOps engineers that there are some more recommended steps they might want to look into.

Docs:


On managed Kubernetes is kind of has less of an impact anyway, as the user of them don't even have access to etcd to begin with. It's more important if you are responsible of the etcd data storage and kube-apiserver hosting. This argument might be worth pointing out to the user as well, so they don't get freaked out that their secrets aren't encrypted at rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant