You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
Have you considered securing communication between ES nodes? Search Guard is an open source alternative to Elastic's Shield product that would enable this.
I'm working on a custom image that installs and configures it. I'd be happy to PR if it's something you're interested in. I think enabling SSL by default makes sense, but not necessarily all the other SearchGuard features, like authn/z. The SG SSL plugin does only this.
One compromise I made was to use the same keystore on every node instead of installing a unique one, as this is difficult with Docker / immutable infra, unless using something like Vault and vaultjks to generate the keystores and truststores at runtime.
I'm also using the default settings, which as the QuickStart notes:
This tutorial shows how to quickly set up SG SSL. Note that the settings and passwords we use here are not safe for production, and only meant to get SG SSL working as quickly as possible!
To do it correctly, I think a user would still need to use a custom image?
Agreed. But there will be problems with certificates, Java key/truststores, etc.
One compromise I made was to use the same keystore on every node instead of installing a unique one, as this is difficult with Docker / immutable infra, unless using something like Vault and vaultjks to generate the keystores and truststores at runtime.
Well, if we're to use self-signed certificates, there is a way one can provide a single keystore with a single certificate. Something like:
Makes sense overall, though my ssl is a bit weak so I don't follow the specific commands 100%.
Not sure if you saw but the SG SSL repo provides example scripts that generate the keystore and truststore, similar to what you outlined.
Were you thinking of baking the cert into the image at build time? Can't generate them on startup because all images need to use the same key and trust stores.
We could use ONBUILD and let people optionally build the own images from yours if they want unique certs. Otherwise the certs are exposed to anyone and SSL is near-worthless IIUC.
ONBUILD is a nice solution but with Kubernetes one can leave the certificate generation to the user and just ask them to create a secret which exposes the keystore in the pod filesystem. Either way, a password will always be needed as well and we can leverage on secrets as well.
Right now, I'm heads down with something at work so I won't be able to pick it up. Perhaps, in a week's time. Ping me by then if you don't come up with a solution.
Activity
pires commentedon Jul 7, 2016
No. But I am open to participate in a debate around it or review a related PR.
devth commentedon Jul 7, 2016
I'm working on a custom image that installs and configures it. I'd be happy to PR if it's something you're interested in. I think enabling SSL by default makes sense, but not necessarily all the other SearchGuard features, like authn/z. The SG SSL plugin does only this.
I'm following the SG SSL QuickStart.
One compromise I made was to use the same keystore on every node instead of installing a unique one, as this is difficult with Docker / immutable infra, unless using something like Vault and vaultjks to generate the keystores and truststores at runtime.
I'm also using the default settings, which as the QuickStart notes:
To do it correctly, I think a user would still need to use a custom image?
pires commentedon Jul 7, 2016
Agreed. But there will be problems with certificates, Java key/truststores, etc.
Well, if we're to use self-signed certificates, there is a way one can provide a single keystore with a single certificate. Something like:
CA key, certificate and keystore
Elasticsearch node key, certificate and keystore
First we need a file named
ssl.cnf
with the following contents:Then, execute:
If all goes well, now we just need to generate the keystore:
The
generate_jks
is a shell script with the following usage:and generates:
.p12
file generated in 1Does any of this makes sense to you?
devth commentedon Jul 7, 2016
Makes sense overall, though my ssl is a bit weak so I don't follow the specific commands 100%.
Not sure if you saw but the SG SSL repo provides example scripts that generate the keystore and truststore, similar to what you outlined.
Were you thinking of baking the cert into the image at build time? Can't generate them on startup because all images need to use the same key and trust stores.
We could use
ONBUILD
and let people optionally build the own images from yours if they want unique certs. Otherwise the certs are exposed to anyone and SSL is near-worthless IIUC.pires commentedon Jul 7, 2016
No, I didn't check the repo.
ONBUILD
is a nice solution but with Kubernetes one can leave the certificate generation to the user and just ask them to create a secret which exposes the keystore in the pod filesystem. Either way, a password will always be needed as well and we can leverage on secrets as well.Right now, I'm heads down with something at work so I won't be able to pick it up. Perhaps, in a week's time. Ping me by then if you don't come up with a solution.
devth commentedon Jul 7, 2016
Good point, I hadn't considered K8S secrets. I'll be working on it over the next few days.
devth commentedon Jul 9, 2016
We ended up deciding to use Elastic's Shield product, so I didn't get very far with this. I pushed my changes here: devth/docker-elasticsearch-kubernetes@a550a29
I was adding the keystore and truststore directly. Next step would be to remove that and obtain them from K8S secrets like you suggested.
pires commentedon Aug 24, 2016
Leaving this open as a reference for users looking for same thing.