-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve detection & handling of duplicate Node ID: #4195
Conversation
@@ -1627,10 +1644,17 @@ ApplicationImp::run() | |||
} | |||
|
|||
void | |||
ApplicationImp::signalStop() | |||
ApplicationImp::signalStop(std::string msg) |
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.
Consider passing msg
by const&
since signalStop
doesn't modify msg
. Theoretically this could save an allocation, though after reviewing all uses of signalStop
, it won't make any difference today.
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.
I'm getting 3 test failures:
$ rippled --unittest=ProtocolVersion
ripple.overlay.ProtocolVersion Convert protocol version to string
ripple.overlay.ProtocolVersion Convert strings to protocol versions
ripple.overlay.ProtocolVersion Protocol version negotiation
#2 failed: ProtocolVersion_test.cpp(85)
#3 failed: ProtocolVersion_test.cpp(87)
#4 failed: ProtocolVersion_test.cpp(90)
105ms, 1 suite, 3 cases, 15 tests total, 3 failures
Weird... I'll look into it. |
Fixed: the unit test was expecting support for obsolete protocol version 2.0 which this commit removed support for. |
The test failures I'm now seeing have slightly changed:
|
Each node on the network is supposed to have a unique cryptographic identity. Typically, this identity is generated randomly at startup and stored for later reuse in the (poorly named) file `wallet.db`. If the file is copied, it is possible for two nodes to share the same node identity. This is generally not desirable and existing servers will detect and reject connections to other servers that have the same key. This commit achives three things: 1. It improves the detection code to pinpoint instances where two distinct servers with the same key connect with each other. In that case, servers will log an appropriate error and shut down pending intervention by the server's operator. 2. It makes it possible for server administrators to securely and easily generate new cryptographic identities for servers using the new `--newnodeid` command line arguments. When a server is started using this command, it will generate and save a random secure identity. 3. It makes it possible to configure the identity using a command line option, which makes it possible to derive it from data or parameters associated with the container or hardware where the instance is running by passing the `--nodeid` option, followed by a single argument identifying the infomation from which the node's identity is derived. For example, the following command will result in nodes with different hostnames having different node identities: `rippled --nodeid $HOSTNAME` The last option is particularly useful for automated cloud-based deployments that minimize the need for storing state and provide unique deployment identifiers. **Important note for server operators:** Depending on variables outside of the the control of this code, such as operating system version or configuration, permissions, and more, it may be possible for other users or programs to be able to access the command line arguments of other processes on the system. If you are operating in a shared environment, you should avoid using this option, preferring instead to use the `[node_seed]` option in the configuration file, and use permissions to limit exposure of the node seed. A user who gains access to the value used to derive the node's unique identity could impersonate that node. The commit also updates the minimum supported server protocol version to `XRPL/2.1`, which has been supported since version 1.5.0 and eliminates support for `XPRL/2.0`.
Fix an issue introduced by XRPLF#4195 / 5a15229 (part of 1.10.0-b1)
Partially revert the functionality introduced with XRPLF#4195 / 5a15229 (part of 1.10.0-b1). Co-authored-by: Nik Bougalis <nikb@bougalis.net>
Partially revert the functionality introduced with #4195 / 5a15229 (part of 1.10.0-b1). Acknowledgements: Aaron Hook for responsibly disclosing this issue. Bug Bounties and Responsible Disclosures: We welcome reviews of the rippled code and urge researchers to responsibly disclose any issues they may find. To report a bug, please send a detailed report to: bugs@xrpl.org --------- Co-authored-by: Nik Bougalis <nikb@bougalis.net>
Partially revert the functionality introduced with XRPLF#4195 / 5a15229 (part of 1.10.0-b1). Acknowledgements: Aaron Hook for responsibly disclosing this issue. Bug Bounties and Responsible Disclosures: We welcome reviews of the rippled code and urge researchers to responsibly disclose any issues they may find. To report a bug, please send a detailed report to: bugs@xrpl.org --------- Co-authored-by: Nik Bougalis <nikb@bougalis.net>
Each node on the network is supposed to have a unique cryptographic identity. Typically, this identity is generated randomly at startup and stored for later reuse in the (poorly named) file `wallet.db`. If the file is copied, it is possible for two nodes to share the same node identity. This is generally not desirable and existing servers will detect and reject connections to other servers that have the same key. This commit achives three things: 1. It improves the detection code to pinpoint instances where two distinct servers with the same key connect with each other. In that case, servers will log an appropriate error and shut down pending intervention by the server's operator. 2. It makes it possible for server administrators to securely and easily generate new cryptographic identities for servers using the new `--newnodeid` command line arguments. When a server is started using this command, it will generate and save a random secure identity. 3. It makes it possible to configure the identity using a command line option, which makes it possible to derive it from data or parameters associated with the container or hardware where the instance is running by passing the `--nodeid` option, followed by a single argument identifying the infomation from which the node's identity is derived. For example, the following command will result in nodes with different hostnames having different node identities: `rippled --nodeid $HOSTNAME` The last option is particularly useful for automated cloud-based deployments that minimize the need for storing state and provide unique deployment identifiers. **Important note for server operators:** Depending on variables outside of the the control of this code, such as operating system version or configuration, permissions, and more, it may be possible for other users or programs to be able to access the command line arguments of other processes on the system. If you are operating in a shared environment, you should avoid using this option, preferring instead to use the `[node_seed]` option in the configuration file, and use permissions to limit exposure of the node seed. A user who gains access to the value used to derive the node's unique identity could impersonate that node. The commit also updates the minimum supported server protocol version to `XRPL/2.1`, which has been supported since version 1.5.0 and eliminates support for `XPRL/2.0`.
Each node on the network is supposed to have a unique cryptographic identity. Typically, this identity is generated randomly at startup and stored for later reuse in the (poorly named) file
wallet.db
.If the file is copied, it is possible for two nodes to share the same node identity. This is generally not desirable and existing servers will detect and reject connections to other servers that have the same key.
This commit achives three things:
--newnodeid
command line arguments. When a server is started using this command, it will generate and save a random secure identity.--nodeid
option, followed by a single argument identifying the infomation from which the node's identity is derived. For example, the following command will result in nodes with different hostnames having different node identities:rippled --nodeid $HOSTNAME
The last option is particularly useful for automated cloud-based deployments that minimize the need for storing state.
Important note for server operators:
Depending on variables outside of the the control of this code, such as operating system version or configuration, permissions, and more, it may be possible for other users or programs to be able to access the command line arguments of other processes on the system.
If you are operating in a shared environment, you should avoid using this option, preferring instead to use the [node_seed] option in the configuration file.
The commit also updates the minimum supported server protocol version to
XRPL/2.1
, which has been supported since version 1.5.0 and eliminates support forXPRL/2.0
.High Level Overview of Change
Context of Change
Type of Change