Skip to content

Commit b9d5674

Browse files
committed
init: Remove sensitive flag from rpcbind
1 parent adc41cf commit b9d5674

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ void SetupServerArgs(ArgsManager& argsman)
585585
argsman.AddArg("-rest", strprintf("Accept public REST requests (default: %u)", DEFAULT_REST_ENABLE), ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
586586
argsman.AddArg("-rpcallowip=<ip>", "Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times", ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
587587
argsman.AddArg("-rpcauth=<userpw>", "Username and HMAC-SHA-256 hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is included in share/rpcauth. The client then connects normally using the rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can be specified multiple times", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
588-
argsman.AddArg("-rpcbind=<addr>[:port]", "Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY | ArgsManager::SENSITIVE, OptionsCategory::RPC);
588+
argsman.AddArg("-rpcbind=<addr>[:port]", "Bind to given address to listen for JSON-RPC connections. Do not expose the RPC server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost)", ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::RPC);
589589
argsman.AddArg("-rpcdoccheck", strprintf("Throw a non-fatal error at runtime if the documentation for an RPC is incorrect (default: %u)", DEFAULT_RPC_DOC_CHECK), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::RPC);
590590
argsman.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::RPC);
591591
argsman.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::RPC);

test/functional/feature_config_args.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ def test_args_log(self):
126126
expected_msgs=[
127127
'Command-line arg: addnode="some.node"',
128128
'Command-line arg: rpcauth=****',
129-
'Command-line arg: rpcbind=****',
130129
'Command-line arg: rpcpassword=****',
131130
'Command-line arg: rpcuser=****',
132131
'Command-line arg: torpassword=****',
@@ -135,14 +134,17 @@ def test_args_log(self):
135134
],
136135
unexpected_msgs=[
137136
'alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc0',
138-
'127.1.1.1',
139137
'secret-rpcuser',
140138
'secret-torpassword',
139+
'Command-line arg: rpcbind=****',
140+
'Command-line arg: rpcallowip=****',
141141
]):
142142
self.start_node(0, extra_args=[
143143
'-addnode=some.node',
144144
'-rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc0',
145145
'-rpcbind=127.1.1.1',
146+
'-rpcbind=127.0.0.1',
147+
"-rpcallowip=127.0.0.1",
146148
'-rpcpassword=',
147149
'-rpcuser=secret-rpcuser',
148150
'-torpassword=secret-torpassword',

0 commit comments

Comments
 (0)