origin icon indicating copy to clipboard operation
origin copied to clipboard

Web console does not provide root/intermediate CA during TLS handshake

Open florent-souliere-smile opened this issue 9 years ago • 12 comments

When namedCertificates is set in master-config.yaml, there is currently no know way to indicate a root/intermediate CA file bundle (although a cafile parameter is mentioned in example openshift-ansible inventory files).

Unfortunately, this CA issue is important when namedCertificates refers to self-signed certificate and key: without that, the TLS handshake does not provide the required CA bundle. Although the CA bundle has been previously imported by hand, any browser (except Firefox) marks the connection to the web console as Insecured.

Version

oc v3.6.0+c4dd4cf kubernetes v1.6.1+5115d708d7 features: Basic-Auth GSSAPI Kerberos SPNEGO

Steps To Reproduce
  1. Generate a root and intermediate CA bundle (ca-chain.cert.pem), and a domain key (star.paas.example.com.key.pem) and certificate (star.paas.example.com.cert.pem) https://jamielinux.com/docs/openssl-certificate-authority/ can be used as a tutorial

  2. In a valid openshift-ansible inventory file, ensure the following lines are set

openshift_master_overwrite_named_certificates=true
openshift_master_named_certificates=[{"certfile": "/local/path/to/certs/star.paas.example.com.cert.pem", "keyfile": "/local/path/to/certs/star.paas.example.com.key.pem", "names": ["master.paas.example.com"], "cafile": "/local/path/to/certs/ca-chain.cert.pem"}]
  1. Install OpenShift this config by calling the appropriate config.yml playbook

e.g. ansible-playbook -i hostfile playbooks/byo/config.yml

  1. In any browser (except Firefox which seems to behave differently), import the CA bundle (ca-chain.cert.pem) in order to trust it

  2. In the same browser, go to the web console URL

e.g. https://master.paas.example.com:8443/

Current Result

The browser does not trust the domain master.paas.example.com, and the certificate hierarchy of this site does not include any reference to the root and intermediate CA.

Expected Result

The browser trusts the domain master.paas.example.com, as its certificate hierarchy matches the CA bundle previously imported into it.

Additional information

This scenario has been tested in Chrome 61, Chromium 61, Opera 48, Safari 5.1, Internet Explorer 11

florent-souliere-smile avatar Oct 12 '17 15:10 florent-souliere-smile

cc @liggitt @deads2k

spadgett avatar Oct 13 '17 13:10 spadgett

When namedCertificates is set in master-config.yaml, there is currently no know way to indicate a root/intermediate CA file bundle

include the intermediate chain in the named certificate cert file (e.g. /local/path/to/certs/star.paas.example.com.cert.pem)

liggitt avatar Oct 13 '17 14:10 liggitt

@liggitt Thanks, the workaround is ok and tested!

florent-souliere-smile avatar Oct 17 '17 09:10 florent-souliere-smile

@liggitt can this be closed or is there still a bug here to be fixed?

jwforres avatar Oct 19 '17 21:10 jwforres

re-assigning this to security team as anything to do with certs is not the console anyway, its the masters

jwforres avatar Oct 23 '17 17:10 jwforres

this is working as intended. including the intermediate certs in the named cert file is how to cause the server to present those intermediates.

liggitt avatar Oct 23 '17 17:10 liggitt

@liggitt i'm just coming across this issue (happy to open up a new one) as i am running in to the same issue myself right now. this design seems to be inconsistent to the design of other components distributed with origin such as the hosted router which expect the CA file to be separated from the certificate.

Further the openshift installer seems to indicate (though I could be misinterpreting) that if a CA is present it should be separate files https://github.com/openshift/openshift-ansible/blob/master/inventory/hosts.example#L800-L812

it's unclear how to reconcile these without duplicating the way certificates are loaded to the cluster. If i put the intermediate certificate in the file hosting the named cert and in a CA file then the certificates will be duplicated on the master (in masterCA: ca-bundle.crt) and in the servingInfo for the api

can you let me know how best to raise this? is this more of an installer issue or a origin issue?

davidaah avatar Jan 22 '18 23:01 davidaah

is this more of an installer issue or a origin issue?

Neither. This issue is about intermediates, which must be included in the serving certificate file, so that they are sent from the server to clients as they connect.

liggitt avatar Jan 22 '18 23:01 liggitt

What I mean to say is that for the purposes of each component with certificates, including the master, the intermediate CA is expected separately. To me then it sounds like it may just be (my) confusion in what the openshift-ansible installer wants you to do. Today the installer does not take the intermediate CA file and merge it with the named certificate but it sounds like it should from what you’re saying

On Mon, Jan 22, 2018 at 6:38 PM Jordan Liggitt [email protected] wrote:

is this more of an installer issue or a origin issue?

Neither. This issue is about intermediates, which must be included in the serving certificate file, so that they are sent from the server to clients as they connect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openshift/origin/issues/16834#issuecomment-359611975, or mute the thread https://github.com/notifications/unsubscribe-auth/AQdkXsuhRWyezoI1rkQz5oJiRmZw2pQpks5tNRwEgaJpZM4P3NOB .

--

David Hocky [email protected] [email protected]

davidaah avatar Jan 23 '18 01:01 davidaah

If i'm understanding what you're saying however is that the CA referred to in the above docs is actually a client CA, not the intermediate CA?

davidaah avatar Jan 23 '18 01:01 davidaah

What I mean to say is that for the purposes of each component with certificates, including the master, the intermediate CA is expected separately.

No, it is expected in the same PEM file as the serving cert, appended after the serving cert. This method is supported by many types of servers, including Apache.

To me then it sounds like it may just be (my) confusion in what the openshift-ansible installer wants you to do. Today the installer does not take the intermediate CA file and merge it with the named certificate but it sounds like it should from what you’re saying

No, if your named certificate requires sending an intermediate chain, append that chain to the file that contains the named certificate.

If i'm understanding what you're saying however is that the CA referred to in the above docs is actually a client CA, not the intermediate CA?

This issue is for cases where a custom serving cert was provided for the web console, though the same method applies for client certs that require sending intermediate chains.

liggitt avatar Jan 23 '18 01:01 liggitt

thanks for the detailed explanation! i was able to adjust accordingly

davidaah avatar Jan 23 '18 01:01 davidaah