-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature: Expose Nebula hostmap on a socket #1457
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution. The SSH debug server is definitely a bit painful to setup and I would love to see an easier-to-use debug interface merged. Some background:
That said, on another ticket related to Prometheus service discovery, a user made the point that the DNS server already allows exposing some information publicly without authentication: #920 (comment) How were you thinking about security around this API? |
https://github.com/slackhq/nebula/pull/1457/files#diff-f17225d549b302ca95e2dc524a83c9ad067923eb49ef688e8093c6d45a3e7384R86 there's a todo to refuse (or maybe just warn?) if you bind to something silly. Refusing to bind to (non-localhost || non-nebula-ip) feels right to me. IMO, this HTTP API would be informational, a-la DNS. The driving use-case is to make "nebula aware" applications that can use stuff like group information to make authorization decisions. (such as, you need the ^ this is what makes binding to localhost valuable imo. If we only bound to the nebula IP, applications on the same host would need to discover the nebula IP to use it, which isn't hard, but it's less-pleasant. |
I'd be happy to implement the TODO for interface binding. Personally, I think there is value in having the option to bind to non-localhost interfaces (for example, a proxy terminating nebula before the service in Jacks example) so I'll be starting out with the warning implementation. I'd love to hear other opinions though. |
We discussed this PR a little today and here are the takeaways
One option we keep coming back to is a simple unix domain socket, likely in Another option would be to do plain JSON over HTTP, which is a bit more ergonomic but raises the clients required library complexity and includes attack surface for the client if it were to be speaking with an adversarial There are many other possibilities as well. The argument to having some authentication method mainly comes down to a defense-in-depth strategy. By requiring something here we should be able to avoid low effort drive-by attacks but obviously anyone with In summary: It remains to be unclear what specifically we are trying to accomplish with the api and what amount of security we should try to sprinkle on it, how ergonomic it should or shouldn't be, or how much the person configuring it should need to understand it to avoid an information disclosure foot gun. |
This was stuck in my head so I put together a rough picture of what this approach might look like. If this is more the direction y'all were thinking I'll go ahead and clean this up. Example usage
|
This MR introduces an info server socket to serve information about the Hostmap. This is in reference to #1398.
Required config file additions
Example curls
curl http://127.0.0.2:5555/host/100.100.100.100 {"curve":"P256","details":{"groups":["group1","group2"],"isCa":false,"issuer":"6a20d559ef58a72a2c8e599284fc11bfb95a61b21cd55ec51c0bdd59b4582537","name":"demo","networks":["100.100.100.100/11"],"notAfter":"2026-11-29T11:22:32-06:00","notBefore":"2025-1-03T12:00:11-05:00","unsafeNetworks":["0.0.0.0/0"]},"fingerprint":"c175687fec1ace05821b77b39f4b7520d1839e948fb7140570c0c4ffb99ac67f","publicKey":"77de6cf8a3541e527b6517532d36c0b3e01cdfcf54fe5270b7538881d5886e1885bbaa05b919a17b1d2b7dd49b5bfb103725ef1cf25c6a6212e00943caf9d8191e","signature":"9ec4e33140a71ee6e3c5ccb305f8920c3445d868b24b58f5217f84928e4dca2b8a408c32d108c5b99af0bf1f395a4468b4d21690d1fad1591a216e48d0da5a8c7726f2b34f54","version":2}% curl http://127.0.0.2:5553/hostmap {"demo":{"vpnAddrs":["100.100.100.100"],"lastHandshakeTime":"2025-08-26T09:07:13.609073708-05:00","groups":["demo1","demo2"]},{"demo2":{"vpnAddrs":["100.100.100.101"],"lastHandshakeTime":"2025-08-26T09:07:13.609073708-05:00","groups":["demo3","demo4"]}}