Warning: A secret was passed to “sh” using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [pw, user]
Thanks, i will try your first snippet.
I was happy to find a working solution that doesn’t result in
Warning: A secret was passed to “sh” using Groovy String interpolation, which is insecure.
Affected argument(s) used the following variable(s): [pw, user]
This means my solution should already be safe to use ?
After reading all the docs and further research, your second proposal was in fact one of my first
attempts, but it didn’t work.
the warning is just telling you that groovy is interpolating it, before passing it to shell, which means your shell will get the processed value. For shell that just means if you look as ps, you’ll see the password in the string. Your solution does that, but doesn’t warn. Its up to you if you care.
Like I said, my solution should work, I just can’t imagine why it wouldn’t work, unless your password gets pre-escaped or something. My solution should pass the username and password verbatium.