-
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. #1212
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.
|
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. |
|
Caution Review failedThe pull request is closed. WalkthroughThe implementation of gRPC server creation in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 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)
✨ 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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
jraft-extension/rpc-grpc-impl/src/main/java/com/alipay/sofa/jraft/rpc/impl/GrpcRaftRpcFactory.java(1 hunks)
⏰ 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)
- GitHub Check: sca
🔇 Additional comments (1)
jraft-extension/rpc-grpc-impl/src/main/java/com/alipay/sofa/jraft/rpc/impl/GrpcRaftRpcFactory.java (1)
91-93: Security improvement: Conditional IP binding logic is correct.The implementation correctly addresses the security concern by:
- Binding to the specific IP address when
endpoint.getIp()is not blank- Using port-only binding when no specific IP is provided
- This prevents unintended exposure on all network interfaces (0.0.0.0)
...extension/rpc-grpc-impl/src/main/java/com/alipay/sofa/jraft/rpc/impl/GrpcRaftRpcFactory.java
Show resolved
Hide resolved
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.
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