Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1596879 - [RFE] Jenkins Slaves should support connecting to HTTPS jenkins masters [NEEDINFO]
Summary: [RFE] Jenkins Slaves should support connecting to HTTPS jenkins masters
Keywords:
Status: NEW
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: Xiaoli Tian
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-29 22:35 UTC by Bruno Andrade
Modified: 2019-03-30 07:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:
bparees: needinfo? (bandrade)


Attachments (Terms of Use)

Description Bruno Andrade 2018-06-29 22:35:19 UTC
Red Hat IT is trying to use 
https://docs.openshift.com/container-platform/3.9/using_images/other_images/jenkins.html#jenkins-authentication
https://docs.openshift.com/container-platform/3.9/using_images/other_images/jenkins_slaves.html. 

Our Infosec team requires end-to-end encryption of all traffic.  Because of this I am creating a directive template and changing from an edge route to a re-encrypt route.  Then I'm adding another layer on top of the jenkins master image that contains a custom init script that does some cert work.  You can find the template, init script, dockerfile, etc at  https://gitlab.corp.redhat.com/dminnich/paas_jenkins.  

Anyhow, the end result is this:
- Jenkins master is listening on only 8443 with certs that were signed using the openshift CA using https://docs.openshift.com/container-platform/3.9/dev_guide/secrets.html#service-serving-certificate-secrets. 
- JENKINS_URL is set to https://172.30.192.44:8443
- Maven jenkins slave is spun up. 
- Slave runs /usr/local/bin/run-jnlp-client  which has these lines 

echo "Downloading ${JENKINS_URL}/jnlpJars/remoting.jar ..."
  curl -sS ${JENKINS_URL}/jnlpJars/remoting.jar -o ${JAR}

errors are thrown like this
curl: (60) Peer's certificate issuer has been marked as not trusted by the user.
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.

The slaves should trust the OpenShift CAs by default.  I thought openshift pods did that by default, but maybe not.  



One other note.  The person that maintains the run-jnlp-client script needs to remove the 
"#NOTE:  periodically check https://ce-gitlab.usersys.redhat.com/ce/jboss-dockerfiles/blob/develop/scripts/os-java-run/added/java-default-options for updates"  line.  

It is against security best practices to ever expose internal hostnames to customers or the public in general.

Comment 1 Ben Parees 2018-07-03 18:03:20 UTC
removing the links here:
https://github.com/openshift/jenkins/pull/635

Comment 2 Ben Parees 2018-07-03 18:05:28 UTC
As for the cert, it's mounted in under /var/run/secrets/kubernetes.io/serviceaccount/ca.crt i believe.  We just need to update the jnlp script to supply it to the java process.

Comment 3 Ben Parees 2018-07-03 18:09:55 UTC
Bruno, can you try adding that cert to see if it makes curl happy?  i'm guessing you'll then hit an issue when the agent java process itself tries to talk to jenkins, though (or that is going to be going over the insecure jnlp port).


Note You need to log in before you can comment on or make changes to this bug.