Encryping credentials in a format that Jenkins can read

40 views
Skip to first unread message

Ali Ok

unread,
Dec 23, 2016, 1:57:44 AM12/23/16
to Jenkins Users
Hi,

Some story:
We are working on a project where we run Jenkins on OpenShift and we have Linux slaves and OSX slaves.
Linux slaves are handled by OpenShift itself, but for OSX slaves we need to do manual work.
In order to make the connection between Jenkins master and OSX slave, we use SSH. For now, we start with password based authentication.

Now, when I make the setup for OSX slave using the GUI, I can see in credentials.xml there is something like this:

        <com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>
          ...
          <password>3uYDDPNS7g9eg8Hq9FLnrN+ZF+SZCteOYnkbl614gf4=</password>
        </com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl>


However, I am having trouble encrypting the password to this text programmatically! The credentials.xml file should be filled by our script.

I have seen many Python scripts which are doing the decryption, but I wasn't able to make them work. Maybe they were for Jenkins 1.x.

Please note that I need to do the encryption using Bash scripts. So, I cannot use the Groovy util.

Has anybody done something similar?

Ali Ok

unread,
Dec 23, 2016, 1:59:12 AM12/23/16
to Jenkins Users
Ah, also, I saw in this thread a similar thing was asked.
The suggestion is to use plain text. What do you think about this?

wtr...@redhat.com

unread,
Dec 23, 2016, 5:18:16 AM12/23/16
to Jenkins Users
This is what openshift is using to encode login passwords:

It may also work in this case. 

Ali Ok

unread,
Dec 28, 2016, 5:27:22 AM12/28/16
to jenkins...@googlegroups.com
Did no encryption of password and I can verify that it works.

Maybe later we can revisit this subject. Need to discuss with my colleagues if storing the password w/o encryption is a problem on a Kubernetes pod.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/7__3FLgqPL0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e168c519-aa15-4c39-854e-c1344af4ff68%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages