community-features icon indicating copy to clipboard operation
community-features copied to clipboard

Support setting SSLVerification parameter in Elasticsearch config

Open sindrepm opened this issue 5 years ago • 4 comments

Description (*)

I am using Elasticsearch operator on Kubernetes (https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html) which enables auth and SSL by default with self-signed certificate. Currently I see no way to use Magento Elasticsearch implementation with self-signed certificates because the curl request fails.

The Elasticsearch PHP client already supports setting a parameter "SSLVerification" to trust self-signed certificates and custom root CA's: https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/security.html#_self_signed_certificates

As the config is already generated from hash based on settings in database it should be trivial to support this feature just by allowing another config key like: catalog/search/elasticsearchX_ssl_verification.

This field should be set to the full certificate path and the client will use it to call setSSLVerification(<path-to-certificate>).

Other options are:

  • Disable TLS in Elasticsearch (not possible in the K8s operator)
  • Use a valid SSL certificate with a FQDN, but this adds unnecessary complexity and potential security issues because the instance has to be exposed externally.

Expected behavior (*)

Add another field "SSL certificate path" in Elasticsearch configuration inside Magento admin panel which is passed to setSSLVerification method when constructing the Elasticsearch PHP client.

Benefits

Simplify usage of Elasticsearch with Magento. Especially important now that MySQL search is deprecated.

Additional information

Feature will not introduce any breaking changes and be purely additive.

sindrepm avatar Sep 20 '19 11:09 sindrepm

Hi @sindrepm. Thank you for your report. To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@sindrepm do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

m2-assistant[bot] avatar Sep 20 '19 11:09 m2-assistant[bot]

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Oct 25 '19 07:10 m2-assistant[bot]

Sounds like it is a useful feature for configure secure elasticsearch with self-signed certificate Marked as Feature Request cc @sdzhepa

engcom-Delta avatar Oct 25 '19 07:10 engcom-Delta

Please someone can help me with this feature? I had same issue

snico-dev avatar Nov 07 '22 22:11 snico-dev