You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
helm 3 shows secrets with --dry-run option in clear text #7275
helm version version.BuildInfo{Version:"v3.0.2", GitCommit:"19e47ee3283ae98139d98460de796c1be1e3975f", GitTreeState:"clean", GoVersion:"go1.13.5"}
Output of kubectl version:
helm3--dry-run command prints content of the secrets where helm2 just the fact that secret has been created. This creates issue running helm --dry-run in CI/CD tools as it exposes secrets.
helm2 upgrade --install release-name chart --set thanos.sayamlbase64=TESTSECRET --dry-run
Release "release-name" has been upgraded. Happy Helming!
LAST DEPLOYED: Thu Dec 19 14:51:59 2019
NAMESPACE: kube-system
STATUS: DEPLOYED
RESOURCES:
==> v1/Secret
NAME TYPE DATA AGE
thanos-objstore-config Opaque 1 80d
Reacted by paleale, vlitvin, Stefan Rajkovic, George Jenkins, Ian Driver, Mike Herwig, Viktor Stanchev, Artem Zhurbila, Dom-M-C, Célien Nanson and 14 more
ifstrings.EqualFold(s.release.Info.Description, "Dry run complete") ||s.debug {
What is your recommended course of action here?
We could relax this constraint to only display this output when the --debug flag is applied. However, I am concerned about this breaking backwards compatibility, and that there may be users who are relying on this behaviour since this was intentionally introduced.
I can see the argument, but at this point we can't change that output because of our backwards compatibility guarantees. So anything that we'd want to implement shouldn't break that
so, helm2 was not printing secrets and now helm3 does, should it be changed not to print?
helm2 upgrade --install release-name chart --set thanos.sayamlbase64=TESTSECRET --dry-run
Release "release-name" has been upgraded. Happy Helming!
LAST DEPLOYED: Thu Dec 19 14:51:59 2019
NAMESPACE: kube-system
STATUS: DEPLOYED
RESOURCES:
==> v1/Secret
NAME TYPE DATA AGE
thanos-objstore-config Opaque 1 80d
So given our backwards compatibility guarantees, we cannot remove the secret output by default. However, we would be more than willing to review and accept any implementation that uses a feature flag (something like --sanitize) to prevent those values from printing. I'll relabel this as a feature and anyone can implement it
Reacted by Max Valiarovski, Vladimir Ivanov, Sean Erswell-Liljefelt, Marcos Borges, Evans Mungai and adamency
@thomastaylor312 i am not quite understand your comment about backwards compatibility. Helm 2 with dry-run did not exposed secrets, and Helm 3 expose them. So actually there is breaking compatibility changes introduced in Helm 3. Also if regular update/run do not expose secrets, i would expect from dry-run same. Because dry-run means: run as regular, but don't apply changes. We see different behavior here. It would be confusing if we would need to use extra flag for getting same behavior for dry-run and regular run.
Reacted by alert101, myuseridbws, paleale, Tristan Keen, Pranav Marla, dudicoco, Dom-M-C, Hang Du, Max Cascone, Martin Rios and 1 more
Reacted by adamency
Reacted by Pranav Marla, Rohit Appu, Hang Du and Martin Rios
This looks like there are several suggestions and tools to address the issue. Closing.
Reacted by rafaelbattesti, Flavio Elawi, Andrei Sinitson, Deniz Acay, github-usr-name, Tobias Harnickell, Andrei Romanov, Omar El Oubari, Devin Lauderdale and Rick Rackow
Not sure I agree that this should be closed, as it feels like a pretty flagrant miss from a security perspective. Just because duct tape exists doesn't mean we shouldn't expect our tools to work without them.
Reacted by Moslem Neji, Andru Cherny, readonlyuser1, Liam Stanley, Prajwal Muralidhara, Miriam Müller, Derek Roberts, rafaelbattesti, Andrei Sinitson, Deniz Acay and 1 more
I'm curious why there's no open CVE against a blatant security vulnerability that's been open for 3 years. It almost seems like a callout is needed here.
Reacted by Andru Cherny, Miriam Müller, Derek Roberts, rafaelbattesti, Omar El Oubari and johnnyasd12
I know a lot of folks already came here to say how much of a security breach this is, but I'll say it again because it shocks me that Helm as a graduated CNCF project closes this issue like it's nothing after 3.5 years.
And just like @OhZedTee I'm curious as well.
Reacted by Andru Cherny, Nicholas Devenish, Flavio Elawi and bmurashin
We used yq, tail and head to redact any element's value in any depth with any name. (Raspberry PI 4, Ubuntu 23.10, helm vesion 3.10.1)
Say for example the field name has to be redacted everywhere then with yq 4.40.4, tail and head I can do the following:
This will replace name and securityContext values everywhere with REDACTED. There is probably a better shorter way of writing this, but I found it more readable.
Note: Omitting --debug from helm chart will print less metadata. In that case tail should be reduced to +9 from +11.
This looks like there are several suggestions and tools to address the issue. Closing.
There are zero suggestions or tools to address the critical security issue. Rather, there are a several kludges that can be used to workaround it as long as every single team member remembers to use a non-obvious pipe consistently, all the time. That does not address the issue. Adding a --sanitize flag or similar that natively performs the operation without breaking backwards compatibility would be a good resolution.
Reacted by bstrdsmkr, Donald Dragoti and Tobias Harnickell
Do we know the organization or individual who allocated the CVE? This could be useful for tracking. If someone know about it, please let me know. Thanks.
When trying to add the kludges mentioned, there's an unfortunate side-effect: piping output without -o pipefail shell option, means that when Helm dies with an error, the secret-munging thing being piped to returns success rather than failure, so any jobs looking for Helm exit status show success every time. This can be worked around by enabling -o pipefail or using Bash's PIPESTATUS and checking the Helm part of the pipe... but this is now getting a little complicated.
The maintainers said they would be willing for somebody else to contribute a new feature flag to hide secret values. But I would argue that far fewer people depend on this "feature", than will be affected by the security hole it introduces.
Therefore, I would urge @bacongobbler , @thomastaylor312 , and any other Helm contributors, to reconsider the Helm backwards compatibility guarantee here, and implement a fix themselves to implicitly stop showing secret values. Yes, this will be a breaking change. But nobody will blame you for breaking compatibility in order to close a pretty big security hole. I think you would probably expect the same of a different project...
Activity
bacongobbler commentedon Dec 20, 2019
Hi @darkstarmv. It looks as though
helm install --dry-runintentionally displays this output:helm/cmd/helm/status.go
Line 141 in 0eaa881
What is your recommended course of action here?
We could relax this constraint to only display this output when the
--debugflag is applied. However, I am concerned about this breaking backwards compatibility, and that there may be users who are relying on this behaviour since this was intentionally introduced.@thomastaylor312 any thoughts here?
darkstarmv commentedon Dec 20, 2019
i think by default
--dry-runshould not print debug output. Each user has to provide additional flags if they would like to see more information.thomastaylor312 commentedon Dec 20, 2019
I can see the argument, but at this point we can't change that output because of our backwards compatibility guarantees. So anything that we'd want to implement shouldn't break that
darkstarmv commentedon Dec 21, 2019
so,
helm2was not printing secrets and nowhelm3does, should it be changed not to print?thomastaylor312 commentedon Jan 7, 2020
So given our backwards compatibility guarantees, we cannot remove the secret output by default. However, we would be more than willing to review and accept any implementation that uses a feature flag (something like --sanitize) to prevent those values from printing. I'll relabel this as a feature and anyone can implement it
vaivanov commentedon Feb 12, 2020
any updates on this?
bobbywatson3 commentedon Feb 27, 2020
We'd rather not have secrets splashed across each jenkins job's console output. Any update on this? A
--sanitizeflag would be excellent.bacongobbler commentedon Feb 27, 2020
No updates. Feel free to contribute!
EssentialMix commentedon Mar 3, 2020
@thomastaylor312 i am not quite understand your comment about backwards compatibility. Helm 2 with dry-run did not exposed secrets, and Helm 3 expose them. So actually there is breaking compatibility changes introduced in Helm 3. Also if regular update/run do not expose secrets, i would expect from dry-run same. Because dry-run means: run as regular, but don't apply changes. We see different behavior here. It would be confusing if we would need to use extra flag for getting same behavior for dry-run and regular run.
EssentialMix commentedon Mar 3, 2020
I guess this is really depends how we are treating it, as feature or bug? For me this is definitely a bug in dry-run mode.
jkroepke commentedon May 7, 2020
I would say "it works as expected".
The helm diff plugin have a similar functionality. But there is available flag to explicit mask secrets.
myuseridbws commentedon Jun 14, 2020
@EssentialMix has it right. Helm 3 broke the backward compatibility of the Helm 2 --dry-run behavior.
Helm 2 --dry-run did not print any output (let alone secrets) as you can see here:
45 remaining items
joejulian commentedon Jun 5, 2023
This looks like there are several suggestions and tools to address the issue. Closing.
pipeworks-asmith commentedon Jun 6, 2023
Not sure I agree that this should be closed, as it feels like a pretty flagrant miss from a security perspective. Just because duct tape exists doesn't mean we shouldn't expect our tools to work without them.
wirwolf commentedon Jun 6, 2023
Please reopen the issue. Ith an important problem and I wait to fix it in helm
OhZedTee commentedon Jun 15, 2023
I'm curious why there's no open CVE against a blatant security vulnerability that's been open for 3 years. It almost seems like a callout is needed here.
m1rm commentedon Aug 9, 2023
For others bumping into this.
helm template --debug --valuesalso exposes the secrets.A way to avoid the secrets showing up in the CLI output is to pipe the result of the command to sed and mutate it:
sed '/^kind: Secret/,/^---/{//!d;};'For us this resulted in the section looking like this in the output:
yet I fully agree with all others here stating, that this should be solved in helm directly
rafaelbattesti commentedon Sep 28, 2023
I know a lot of folks already came here to say how much of a security breach this is, but I'll say it again because it shocks me that Helm as a graduated CNCF project closes this issue like it's nothing after 3.5 years.
And just like @OhZedTee I'm curious as well.
codersasha commentedon Oct 12, 2023
For anyone still experiencing this issue -- this is a
sedcommand that deletes everything fromUSER-SUPPLIED VALUES:down:We now use this in our deploys, so we can debug when a deploy fails, but not print any secrets/configuration that may reveal sensitive data.
molnare commentedon Dec 6, 2023
We used yq, tail and head to redact any element's value in any depth with any name. (Raspberry PI 4, Ubuntu 23.10, helm vesion 3.10.1)
Say for example the field
namehas to be redacted everywhere then with yq 4.40.4, tail and head I can do the following:What is happening:
If we want to redact more than one element value then multiple yq statements can be chained one after another:
This will replace name and securityContext values everywhere with REDACTED. There is probably a better shorter way of writing this, but I found it more readable.
Note: Omitting
--debugfrom helm chart will print less metadata. In that case tail should be reduced to +9 from +11.github-usr-name commentedon Jan 3, 2024
There are zero suggestions or tools to address the critical security issue. Rather, there are a several kludges that can be used to workaround it as long as every single team member remembers to use a non-obvious pipe consistently, all the time. That does not address the issue. Adding a
--sanitizeflag or similar that natively performs the operation without breaking backwards compatibility would be a good resolution.oscerd commentedon Mar 11, 2024
Do we know the organization or individual who allocated the CVE? This could be useful for tracking. If someone know about it, please let me know. Thanks.
TobyTheHutt commentedon Mar 13, 2024
I opened the CVE. My apologies for not notifying you sooner.
If you need information on use cases or other information, feel free to get in touch.
oscerd commentedon Mar 13, 2024
Thanks for letting me know.
peterwwillis commentedon May 14, 2024
When trying to add the kludges mentioned, there's an unfortunate side-effect: piping output without
-o pipefailshell option, means that when Helm dies with an error, the secret-munging thing being piped to returns success rather than failure, so any jobs looking for Helm exit status show success every time. This can be worked around by enabling-o pipefailor using Bash's PIPESTATUS and checking the Helm part of the pipe... but this is now getting a little complicated.The maintainers said they would be willing for somebody else to contribute a new feature flag to hide secret values. But I would argue that far fewer people depend on this "feature", than will be affected by the security hole it introduces.
Therefore, I would urge @bacongobbler , @thomastaylor312 , and any other Helm contributors, to reconsider the Helm backwards compatibility guarantee here, and implement a fix themselves to implicitly stop showing secret values. Yes, this will be a breaking change. But nobody will blame you for breaking compatibility in order to close a pretty big security hole. I think you would probably expect the same of a different project...