Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide passwords in Jenkins console output?

The Mask Passwords plugin only allows for preset passwords to be passed in to the build process, so it really does nothing for the security of the Job.

I need a password parameter that needs to be entered every time the job is run (as a parameter) and I need that to be masked in the console output.

From what I am reading, going to Manage Jenkins -> Configure System and selecting to mask Password Parameters should work, but it is not for some reason.. any suggestions?

like image 721
Ian Tait Avatar asked Aug 18 '15 16:08

Ian Tait


People also ask

How do I hide password in Jenkins pipeline?

Installing the Mask Password Plugin Navigate to manage Jenkins and click Manage Plugins. Search for Mask Passwords. Select the plugin then click “Download now and install after restart”. Once Mask Passwords is setup you can click Restart Jenkins to safely reboot.

How do I hide console output in Jenkins?

You can hide your output away from the script by redirecting the output to /dev/null but I think this the most you can do – the commands that you write will still be displayed. You received this message because you are subscribed to the Google Groups "Jenkins Users" group.

Does Jenkins provide console output?

View the console output: From the Jenkins dashboard, click the job link name from the table. Click the build number in the Build History table in the sidebar. If you need to send the console output to Perforce Support, send it as plain text. Click View as plain text in the sidebar menu.

How can I see my password in Jenkins?

And in order to get the password value of ${ENCRYPTED_PASSPHRASE_OR_PASSWORD} : go to credentials, update, in the browser "See source code" and you will get the encrypted password in the data field for password. Then use that function. What if I don't have access to /script . Means Jenkins overall access.


2 Answers

Tested with Jenkins 1.609.1 and Mask Passwords Plugin 2.7.3. You need to activate it in the "Configure System" and also in the job you want to use this. In the job configuration is a point "Mask passwords" which must be activated and then will use the global config to mask passwords.

like image 98
mszalbach Avatar answered Sep 21 '22 17:09

mszalbach


in case that you have a Linux builder you can hide the output of the shell command under the execute shell in the command text box just add in the first line the line:

#!/bin/bash +x
some other commands...

this will hide only the output of the command with the password in the console output

like image 27
dsaydon Avatar answered Sep 17 '22 17:09

dsaydon