Kubernetes secrets created by helm are saved as plaintext in the state
See original GitHub issueIt seems that pulumi doesn’t encrypt the data property of Kubernetes secrets when it is saved to the state. I’m doing the following to deploy charts:
helmv3.NewChart(ctx, deploymentName, chartArgs, pulumi.Provider(p))
I tried using local file backend and s3 backend and had the same result.
My encryption provider is passphrase
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Secrets in Helm chart resource are plaintext in state file #999
When a Pulumi secret is used in a Helm chart resource, its plaintext value ends up in the Pulumi state file where in...
Read more >Secrets | Kubernetes
Kubernetes Secrets are, by default, stored unencrypted in the API server's underlying data store (etcd). Anyone with API access can retrieve or ...
Read more >Manage Auto-generated Secrets In Your Helm Charts - ITNEXT
Using Helm's lookup function, we can inspect the current state of the cluster in order to create & manage the secret within the...
Read more >Kubernetes Secrets - How to Create, Use, & Access Secrets
A secret is a Kubernetes object storing sensitive pieces of data ... Save the file and use the kubectl apply command to create...
Read more >How to keep your Kubernetes secrets secure in Git - Learnk8s
Kubernetes secrets hold the most sensitive information of your application - API keys, tokens, database passwords, etc. If a hacker can retrieve one...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@lblackstone I think the default approach should be that any kubernetes secret generated by helm is considered as secret value that needs to be encrypted.
I tested this out, and it seems to be working as expected for me:
data
andstringData
) were properly masked/encrypted in the state.Data
field did not reveal the secret in the terminal (secret: "[secret]"
)I did notice that the input field in the statefile will contain the secret string in plaintext if you don’t have it marked as secret, so perhaps that was the issue you were seeing?
Here’s the program I tested:
I created the config value with the following:
Here’s the resulting state: