-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow making requests without CORS headers #17
Conversation
Ok, forget about CSP, elasticsearch-head for firefox uses the following in the manifest:
|
Hi, thank you for contributing to elasticvue. Can you elaborate why you added the Also this will not change the need for CORS settings as you already mentioned. Sadly i will not add a wildcard permission to elasticvue, please see #14 (comment) for details on the reasons for this. |
Forget about it, the idea was to make it connect without configuring CORS.
I understand your concern about security, but having to configure CORS is a great downside when using elasticvue, in some cases users won't have access to configure the cluster. If you insist, I'm okay with that, it's your project, but please clarify this stance in the README file, because "You have enable CORS to allow connection to your elasticsearch cluster" sounds more like a technical limitation than a security preference. It also deserves a mention in the comparison page with other frontends. Lastly, are there plans distribute as an electron app? |
No.
I do not agree completely. This is only true if you compare browser extensions, where it is possible to bypass CORS by setting the permissions. You will always have to configure CORS if you use the hosted version or the docker image (the same goes for similar frontends). Right now elasticvue has way more users that use the docker image compared to the sum of browser extension users, so i do not want to focus to much on that right now. But i agree that it would be way more convenient to not have to configure CORS and just start using elasticvue, i am just not happy with having different usage requirements based on how you use it. What do you think about my proposal in #14 (comment) , at least allowing requests to any local cluster in the browser extension by default? Would that be a usable compromise for you, or do you think that it wont help much? |
I'm trying to migrate away from elasticsearch-head, that's how I found elasticvue and thought it would be a nice replacement for me (and about 10 coworkers). With docker it shouldn't be so hard to solve this, you just need to have a tiny express app proxying requests back and forth ES as well as serving static resources.
While this may be achievable with docker and browser extensions, serving static HTML and letting the browser directly make requests to ES will always have this limitation, so it's a trade-off between homogeneous (crippled) experiences and having a caveat for one way of running elasticvue.
It helps for local development instances, my team also needs to browser shared clusters, some are in local servers (e.g. 192.168.x.x) others are on the cloud which we don't have permissions to enable CORS. It certainly helps but it's far from solving the problem. |
Won't this have the same CORS restrictions again? The express app would need to send a wildcard CORS header to support all imaginable docker setups (because of host/port), with the result that you are again exposing your elasticsearch cluster to every website that you open - this would be way worse then the current situation. Or am i missing something here? Thank you for the discussion so far! |
As per 6a2c713 i have removed the requirement to setup CORS when using browser extensions. I will release a new version in the next few days. |
No, node is not a browser that enforces CORS, here is a proof of concept: https://gist.github.com/andreldm/ad3f9f1790ff2c8d51b63fd82ca8d9c9
No, thank you :)
I'm glad to hear this, once it gets published I'll ping my coworkers, so expect future feedback. |
FYI: I published a new version on the weekend, but it is not yet available in the stores for edge and chrome. Seems like COVID-19 might be a slow down, also they manually check each extension when the permissions are changed, so it could really take a few more days or even weeks until they approve it. |
For Firefox it's been updated and I'm using it, thanks again! |
This trick is taken from elasticsearch-head, works fine with Chrome but not Firefox, I think the missing part is Content-Security-Policy directive with the script hash which I wasn't able to make work properly.
By the way, awesome project, elasticsearch badly needs a decent UI and this looks promising!