Warn about sensitive data in environment variables that aren't in Kubernetes secrets #9354
Replies: 3 comments 3 replies
-
|
@atombrella what's your question? |
Beta Was this translation helpful? Give feedback.
-
|
@simar7 Basically if this could be something to add as a feature in Trivy? I'd find value in such a check. Leaving sensitive data in clear text in a Helm chart and Kubernetes resource definitions also goes under the umbrella of security. The learning curve of Rego is a bit steep, and I'm still battling to get the code in the post to match a Kubernetes deployment file with |
Beta Was this translation helpful? Give feedback.
-
You can already pass in custom data. https://trivy.dev/latest/docs/scanner/misconfiguration/custom/data/
I'm not sure if we should be adding this as a built in check due to the performance limitations mentioned above. This would be a good case to write a custom check that fits your needs. You can pass the data to it using the feature I linked above. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I was unsuccessfully trying to make a custom rule in Rego to warn about Kubernetes secrets that aren't in a Kubernetes secret.
Where something like this would be more correct.
The Rego code that I made an effort to get working:
You already check for tokens and passwords in cleartext when scanning container/docker images. As noted in the comment, I think it would be incorrect to block environment variables whose names have
PASSWORDin them, as I've noticed examples of such variables that are meant to have boolean values etc. I don't know Rego and Trivy internals well enough to determine if it could be a setting with names that definitely should/must be in Kubernetes secrets.Target
Kubernetes
Scanner
Misconfiguration
Beta Was this translation helpful? Give feedback.
All reactions