Password Parameter not masked in Console output

601 views
Skip to first unread message

lfast

unread,
Mar 1, 2015, 9:42:55 PM3/1/15
to jenkins...@googlegroups.com
I'm trying to use Password Parameter and Mask Passwords to prevent the password from appearing in the console log. However it still appears.  Global config for Mask Passwords has Password Parameter checked.

Password Param = my_pwd   value=hello world

Script:
   echo $my_pwd

Console Output:
echo hello world
hello world

Baptiste Mathus

unread,
Mar 1, 2015, 10:51:06 PM3/1/15
to jenkins...@googlegroups.com
Hi, seems normal to me, don't do echo on it. 
If you just use the variable, you'll see its value won't get renderer like the others.

Cheers

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/7923ec7a-2486-4433-942e-e5974f0b6d2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

lfast

unread,
Mar 2, 2015, 11:42:27 AM3/2/15
to jenkins...@googlegroups.com, bma...@batmat.net
Let me try again:
Script:
any_command -p $my_pwd

Console Output:
any_command -p the_password_I_typed
error: any_command not found

The password is still displayed.  Maybe I'm misunderstanding what you mean by "just use the variable."  Is masking the use of $my_pwd not supported?

Maciej Jaros

unread,
Mar 17, 2015, 6:04:02 AM3/17/15
to jenkins...@googlegroups.com
2015-03-02 o 17:42, lfast:
Let me try again:
Script:
any_command -p $my_pwd

Console Output:
any_command -p the_password_I_typed
error: any_command not found

The password is still displayed.  Maybe I'm misunderstanding what you mean by "just use the variable."  Is masking the use of $my_pwd not supported?

Not sure about your exact command but adding `set +x` on top of "Execute shell" should block most of what is displayed in the logs. AFAIK the password variable is used as any other variable. There doesn't seem to be any special behaviour around it.

Regards,
Nux.

James Nord

unread,
Mar 21, 2015, 10:30:13 AM3/21/15
to jenkins...@googlegroups.com, Maciej Jaros
There are a few plugins that handle the masking of passwords.

Take a look at https://wiki.jenkins-ci.org/display/JENKINS/Mask+Passwords+Plugin Iirc there is also another plugin.
--
Sent from my phone.
Please excuse my brevity and any auto correct issues.
Reply all
Reply to author
Forward
0 new messages