Skip to content

Instantly share code, notes, and snippets.

@MaRuifeng
Last active May 18, 2018 10:51
Show Gist options
  • Save MaRuifeng/98ec3653bb7ff33132fbedc644e92437 to your computer and use it in GitHub Desktop.
Save MaRuifeng/98ec3653bb7ff33132fbedc644e92437 to your computer and use it in GitHub Desktop.
Obtain password masked out by the EnvInject plugin in Jenkins
# The EnvInject is a pretty old Jenkins plugin, but it happens to be still in use
# and if a password masked by it is forgotten, it can be retrieved as below.
# Suppose it is a global password configured on the 'Configure System' page on Jenkins.
# Log into the Jenkins server host and look for the encrypted string in envInject.xml.
cd /var/lib/jenkins
vim envInject.xml
# Go to the groovy script console of the Jenkins server (https://JENKINS_HOST:JENKINS_PORT/script), and run below script
println(hudson.util.Secret.fromString('{SamPLEEnctyptEdString}') )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment