-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Specified IP addresses can be listened to to prevent risks caused by all-zero listening #1213
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
Conversation
Specified IP addresses can be listened to to prevent risks caused by all-zero listening.
Specified IP addresses can be listened to to prevent risks caused by all-zero listening.
|
Hi @five111, welcome to SOFAStack community, Please sign Contributor License Agreement! After you signed CLA, we will automatically sync the status of this pull request in 3 minutes. |
WalkthroughThe code updates the gRPC server instantiation in the GrpcRaftRpcFactory class to use NettyServerBuilder with an explicit InetSocketAddress, replacing the previous use of ServerBuilder with a port. The change also updates the import statement to use the Netty-specific builder and adds a check for a non-blank IP address. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5-10 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
...extension/rpc-grpc-impl/src/main/java/com/alipay/sofa/jraft/rpc/impl/GrpcRaftRpcFactory.java
Outdated
Show resolved
Hide resolved
code format
code format
code format
|
Hello, you must run |
code format
killme2008
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
done , thanks |


Specified IP addresses can be listened to to prevent risks caused by all-zero listening.
Motivation:
When I used Nacos, I noticed that the jraft port was listening on all zeros. Upon reviewing the Nacos source code, I found that it passed an IP address when creating the jraft server, but sofa-jraft still opted to listen on all zeros, which could introduce some security risks.
Modification:
Determine whether the incoming endpoint contains an IP address. If it does, listen directly on that IP; otherwise, continue to listen on all interfaces with an IP address of 0.
Result:
Specified IP addresses can be listened to to prevent risks caused by all-zero listening.
Summary by CodeRabbit