helm: don't warn about group/world-readable KUBECONFIG if it contains no secrets
helm currently warns on every command:
WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: …
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: …
The warning isn’t very useful.
In my case, the kubeconfig uses OIDC for logins, so it doesn’t contain any secrets.
Instead of embedding client key data certs (via client-key-data
), kubeconfig
might also contain paths to files containing secrets (via client-key
). Permissions for these are not checked either.
This check should probably simply be removed. It produces both false positives and false negatives, and understanding kubeconfig
shouldn’t be a concern of helm
either, but of the Kubernetes SDK.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 7
- Comments: 20 (4 by maintainers)
Commits related to this issue
- cmd/helm: drop checkPerms() check This false positives in case of KUBECONFIG files not containing any secrets (OIDC apiserver auth, or separate key material via `client-key`, rather than `client-key-... — committed to flokli/helm by flokli 2 years ago
- cmd/helm: drop checkPerms() check This false positives in case of KUBECONFIG files not containing any secrets (OIDC apiserver auth, or separate key material via `client-key`, rather than `client-key-... — committed to flokli/helm by flokli 2 years ago
- feat(cmd/helm): drop checkPerms() check This false positives in case of KUBECONFIG files not containing any secrets (OIDC apiserver auth, or separate key material via `client-key`, rather than `clien... — committed to flokli/helm by flokli 2 years ago
I think that an environment variable to suppress these warnings is a cleaner approach than simply removing them. Something along the lines of
SUPPRESS_KUBECONFIG_PERMS_WARNING
or something explicit like that.I’m upvoting this. Like (presumably) every other EKS user, my kubeconfig contains
exec: command: aws args: --region BLAH eks get-token --cluster-name BLAH
and no secrets whatsoever. I also have really good group-collaboration reasons why my group wants/needs to share their kubeconfigs with group permissions. This is not an “NTFS” thing, this is a deliberate, well-considered decision. I’d even go so far as to say that’s what group (or indeed world) permissions are FOR, isn’t it?Can we at least point out that the CNCF have been misled into thinking that this file is necessarily sensitive? Why NOT support an option in that kubeconfig to say something like “I hereby declare that this file is not secret or sensitive” for example? Give me the option to make it clear that this was a deliberate, well-considered decision.
My
/etc/passwd
file is also group/world readable. My/etc/shadow
file is group (shadow) readable! I have group mailboxes which are deliberately group readable, and contain far more sensitive info than any of my kubeconfigs. C’mon, have some sense of proportion here.Not stale, people again got bitten by this, see https://github.com/helm/helm/pull/12316#issuecomment-1732527352
@bigwheels16
The problem is that the one who executes
helm
might be not a human, but another program. So this useless warning makes the subprocess running tough and ugly.