Securing Kubernetes secret files for source control? Securing Kubernetes secret files for source control? kubernetes kubernetes

Securing Kubernetes secret files for source control?


It isn't base64 encoded for security, it is to allow binary content to be stored in secrets. You likely should not commit secret definitions to source control.


For confidential secret keys, can you store them in etcd and retrieve them with confd ?

otherwise, if you really want them in scm, then can you use git-crypt? https://github.com/AGWA/git-crypt


I'd deploy them with ansible, and encrypt the secrets using ansible-vault, so they could be inside the repository. In addition, they could be stored as text, applying the base64 filter over a template.

Anyway, as it was said before, secrets are not secure. They are just encoded in base64 and could be decoded with:

kubectl get secret mysecret -o jsonpath="{.data.username}" | base64 -dkubectl get secret mysecret -o jsonpath="{.data.password}" | base64 -d

(what is very useful, by the way)