Proposal to bind gRPC API to localhost by default #2669
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
I just pulled latest gRPC 3.15.0 and noticed that it binds gRPC to 0.0.0.0 / :: by default and exposes API to wild world of the Internet:
As you can see I did not use any arguments or options for it. I'm pretty sure that majority of new deployments starts similar way and they will be vulnerable to attacks and will be insecure by default.
We discussed this issue while ago and it was partially addressed here by providing command line argument to specify API bind host (--api-hosts="::1"): #796
In this PR I changed default wildcard bind to :: which listens on all available interfaces to more specific IPv6 localhost ::1 which makes GoBGP secure by default.
Some may argue that not all servers have IPv6 connectivity but IPv6 localhost is available on all modern distributions.
Thank you!