-
Notifications
You must be signed in to change notification settings - Fork 390
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
Calls to Kong cluster should be made from server not browser #22
Comments
As a workaround, I usually open up an ssh tunnel to the kong instance (e.g. using PuTTY) and use some local port for communication over kong-dashboard, like so |
@BrianHutchison I see your point. But that would be a big code refactoring I cannot afford right now. As suggested @DonMartin76 , you can ssh tunnel. An other option, which is what I personally do is to have Kong Admin API being protected by Kong gateway itself. Let's say your kong node is hosted on x.x.x.x:
You can now protect the port 8001, and access kong admin API with kong dashboard at the address http://x.x.x.x:8000/kong using basic authentication. |
@DonMartin76 Thanks for the work-around, its a good idea but doesn't work really for what I'm trying to do. The goal is to enable employees from wherever their offices are to onboard API consumers (business partners), and they're not really setup for doing that. It would work for me personally as a dev for sure though. @PGBI I think that could work for many use cases, I appreciate the suggestion. |
+1 |
@PGBI, that's a really nifty solution. Would you consider adding it the project wiki or to the README? I dare say I wouldn't have come up with it myself—dug around for several hours before running across it in this issue. |
For background, see this: Kong/kong#133
The Kong admin API has no authentication built into it, which means that anyone that has port access can make unfettered changes. The solution, as stated in the Kong issue above, is to firewall protect that server, typically port 8001.
However, kong-dashboard makes direct calls to that port, which won't work with a firewall in place.
I'd recommend having the browser call the kong-dashboard node server via a route that passes along the request to the defined Kong server (config.url) on port 8001. That way the server that kong-dashboard runs on can is all that needs access to the Kong cluster, and not the machine that the browser is running from. So, instead of the Angular service in browser going direct to Kong cluster, it goes Angular service to node, and then from node to Kong.
Further extensions to kong-dashboard might include login authentication and authorization I presume, and then UI access can be protected, changes logged, etc.
I'm just evaluating Kong & kong-dashboard but if time allows and it would be welcome, might generate a supporting PR.
The text was updated successfully, but these errors were encountered: