Skip to content

Instantly share code, notes, and snippets.

View MaRuifeng's full-sized avatar
🎯
Focusing

Ruifeng Ma MaRuifeng

🎯
Focusing
View GitHub Profile
@MaRuifeng
MaRuifeng / jenkins-get-masked-passwd.groovy
Last active May 18, 2018 10:51
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