This has helped a lot. There are a number of things I didn't understand here before working through your reply. Some of them I am still a bit unsure of. Also, I think I was wrong about being able to simply use the same cert on each node (as I can't get back to that state).
Say I have been given MyCert1.pfx and it's chain is:
RootCA
|->IntermediateCA
|->|-> MyCert1
If I have this on nodeA and I list:
xpack.security.transport.ssl.keystore.path: MyCert1.pfx
xpack.security.transport.ssl.truststore.path: MyCert1.pfx
When I start, I see this at /_xpack/ssl/certificates:
[
{
"path": "MyCert1.pfx",
"format": "PKCS12",
"alias": "37cced9a-63d6-41e4-993a-ee2ad82dee01",
"subject_dn": "CN=foo.com, O=MyCorp, L=City, ST=State, C=US",
"serial_number": "4e5c9247f2d880a5e511e1ecde8f9cd",
"has_private_key": true,
"expiry": "2021-09-18T12:00:00.000Z"
}
]
If I try to start another node (nodeB) with the same cert, then I get:
nodeA: SSLHandshakeException: null cert chain
nodeB: Received fatal alert: bad_certificate
That makes sense I guess. I exported the RootCA and IntermediateCA and created a combined pfx that contained the full chain (fullChain.pfx). Now when I start nodeA I see this at /_xpack/ssl/certificates:
[
{
"path": "fullChain.pfx",
"format": "PKCS12",
"alias": "37cced9a-63d6-41e4-993a-ee2ad82dee01",
"subject_dn": "CN=foo.com, O=MyCorp, L=City, ST=State, C=US",
"serial_number": "4e5c9247f2d880a5e511e1ecde8f9ce",
"has_private_key": true,
"expiry": "2021-09-18T12:00:00.000Z"
},
{
"path": "fullChain.pfx",
"format": "PKCS12",
"alias": "1",
"subject_dn": "CN=My Root CA, OU=www.myCert.com, O=myCert Inc, C=US",
"serial_number": "83be056904246b1a1756ac95991c74b",
"has_private_key": false,
"expiry": "2031-11-10T00:00:00.000Z"
},
{
"path": "fullChain.pfx",
"format": "PKCS12",
"alias": "1",
"subject_dn": "CN=myCert CA-1, O=myCert Inc, C=US",
"serial_number": "19ec1c6bd3f597bb20c3338e551d878",
"has_private_key": false,
"expiry": "2030-08-04T12:00:00.000Z"
}
]
When I start nodeB I still get the same errors. I would think that I am now presenting the full chain when making the connection, so I am confused as to why there is this error.
Ultimately, what I would like to do is to get to your recommendation:
Use a specific subCA for Elasticsearch nodes TLS. This way you need only trust a specific CA certificate other than explicit certificates that rotate. You obviously need controls that ensure that this sub CA only issues certificates for elastisearch nodes.
l am trying to figure out how to get there from here.
-
Does the root CA need to be in the truststore, or will the intermediate(s) suffice?
-
Does the cert that the node is going to present (i.e. the one in keystore) also need to be in the truststore, or is that only for validating certs from callers?
-
If I had the intermediate (and rootCA?) certs in the trust store, would that mean that it would trust any cert that came from that intermediate and I would not have to manage updating for each new cert as they are rolled out?
Thanks again for the detailed help!