Skip to content

Instantly share code, notes, and snippets.

@adamyordan
Last active July 29, 2019 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adamyordan/cd60c9c597caacd964d4efb96f64a6fc to your computer and use it in GitHub Desktop.
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.
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