-
-
Save fjlopezs/5f6bf96c9db7b5f44f20f69745540615 to your computer and use it in GitHub Desktop.
Decrypting Jenkins Password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#To Decrypt Jenkins Password from credentials.xml | |
#<username>jenkins</username> | |
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
#go to the jenkins url | |
http://jenkins-host/script | |
#In the console paste the script | |
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' | |
passwd = hudson.util.Secret.decrypt(hashed_pw) | |
println(passwd) | |
--- | |
String key = "Vo1hb2DfqHO5U0AdneAmVon1B54VLZr6+2I1AoeONhw=" | |
def secret = hudson.util.Secret.fromString(key) | |
println(secret.getPlainText()) | |
This key is just an example, if your try, you would be get a null value, since this key was encrypted with a secret hash. Each installation of Jenkins has a different secret file. | |
There are hash exist with and without curly braces, if your key contains curly braces you must include this in key variable. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment