Last active
July 29, 2019 09:28
-
-
Save adamyordan/cd60c9c597caacd964d4efb96f64a6fc to your computer and use it in GitHub Desktop.
List credentials in Jenkins console. Jenkins store its secrets in plaintext inside memory, therefore we can lookup the credential provider instance and list all the credentials.
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
import com.cloudbees.plugins.credentials.* | |
// list credentials | |
credentials = SystemCredentialsProvider.getInstance().getCredentials() | |
println credentials | |
// get credential value | |
println '' | |
println credentials[2].getPrivateKey() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment