DEV Community

Bogdan Alexandru Militaru
Bogdan Alexandru Militaru

Posted on • Originally published at whyboobo.com on

Get your Jenkins Passwords from secrets

Demo

Check SEO meta: https://metadescriptiontool.com/

First of all, if you have access to your Jenkins server the credentials are stored at:

vi /var/lib/jenkins/credentials.xml

Enter fullscreen mode Exit fullscreen mode

In order tot get your credentials go to http://YOUR\_IP:8080/script and copy and paste the content below the hit RUN.

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("-----------------------")
}

Enter fullscreen mode Exit fullscreen mode

Source: https://devops.stackexchange.com/questions/2191/how-to-decrypt-jenkins-passwords-from-credentials-xml/8692#8692?newreg=9197ac19da1b457fb643798bcfa94e05

Top comments (0)