-
Notifications
You must be signed in to change notification settings - Fork 3.8k
DAWN-83 ⁃ p2p authenticate peer on handshake #505 #598
Comments
➤ Kevin Heifner commented: [~jonathan.giszczak] [~phil.mesnier] It seems to me this is out of scope for STAT but it is what Jonathan is currently working on. Should we stop work on this and move to something in scope of STAT? |
➤ Phil Mesnier commented: Jonathan is working on this now because Dan specifically directed him to do so. He is nearly done anyway. |
➤ Kevin Heifner commented: [~jonathan.giszczak] What is your estimate for completion, in terms of story points? |
➤ Jonathan Giszczak commented: All issues addressed. Merge conflicts addressed. All automated tests pass. Ready for peer review and merging. |
➤ Kevin Heifner commented: [~matias.romeo] Why did you mark this as blocked? |
➤ Matias Romeo commented: My bad, It was unintentional! I can't move it back to where it was! |
➤ Corey Lederer commented: No problem [~matias.romeo]. I'll move it back. |
➤ Corey Lederer commented: Placing this back in "Code Review" after is was marked as blocked by accident. |
➤ Bezwada Satyapravin commented: The ATC is very descriptive but it is not clear to me if I should use the launcher to start nodes locally or on testnet. Please advise. |
➤ Jonathan Giszczak commented: The instructions were written for a local testnet, since the daemons will be started and stopped a lot. No need to interfere with the operation of the testnet. |
➤ Bezwada Satyapravin commented: Following commands don't work: MacBook01:build pravin$ programs/launcher/launcher p 3 n 3 i now m none MacBook01:build pravin$ programs/launcher/launcher -p 2 n 3 i now m producer m specified |
➤ Bezwada Satyapravin commented: Jonathan Giszczak, [Nov 17, 2017 at 8:41:41 PM]: Please attach the three config.ini files. And the other note... non-producing node is not sending the correct authorization key. |
➤ Dhanesh Valappil commented: Can you please update ATC for 21 nodes? |
➤ Jonathan Giszczak commented: The ATC requires a "broken" configuration to verify functionality, and so should be executed as written on local nodes. |
➤ Andrianto Lie commented: Fail for the fourth test case. andrianto@MacbookPro build ((HEAD detached at STAT-2017-11-27)) $ programs/launcher/launcher -p 3 -n 3 -i now -m none |
➤ Andrianto Lie commented: The other test cases pass |
➤ Jonathan Giszczak commented: Launcher enhanced to support the remaining test case. |
Verified by QA. |
➤ Corey Lederer commented: Moving to finished, this was moved to closed-withdrawn by mistake. |
github #505
One of the security enhancements identified as part of #291
ATC, Test Plan
Introduction
This issue adds functionality to
eosd
andlauncher
.eosd
can now optionally authenticate connecting peers in the p2p network via public key.eosd
has a new config file setting calledallowed-connection
. Valid values for this setting arenone
,producers
,specified
, andany
. If the setting is not present, it defaults tonone
.launcher
defaults to generating config files withallowed-connection = any
.launcher
has a new command line option to control this setting:-m
. Valid values for this option are identical to those used on theeosd
config file.The repository currently includes a
tests/p2p_tests/sync
directory with atest.sh
script that is run by Travis during every GitHub-initiated build. This script currently tests only the defaultlauncher
setting.Tests
All tests below assume a successful build of the repository. Test commands illustrated below must be run from the top level build directory.
Note: Any or all of the tests described below could be and probably should be automated.
launcher
-driven TestsVerify
producer
-only authentication (positive validation)programs/launcher/launcher -p 3 -n 3 -i now -m producers
eosd
to run for at least 2 minutes.programs/launcher/launcher -k 2
tn_data_0/config.ini
,tn_data_1/config.ini
, andtn_data_2/config.ini
containsallowed-connection = producers
.tn_data_0/stderr.txt
,tn_data_1/stderr.txt
, andtn_data_2/stderr.txt
does not containPeer not authenticated. Closing connection.
Verify
producer
-only authentication (negative validation)programs/launcher/launcher -p 2 -n 3 -i now -m producers
eosd
to run for at least 2 minutes.programs/launcher/launcher -k 2
tn_data_0/config.ini
,tn_data_1/config.ini
, andtn_data_2/config.ini
containsallowed-connection = producers
.producer-name =
lines inconfig.ini
verify either of the correspondingstderr.txt
s containsPeer localhost:9878 sent a handshake with an unauthorized key: EOS1111111111111111111111111111111114T1Anm.
andPeer not authenticated. Closing connection.
producer-name =
lines inconfig.ini
verify the correspondingstderr.txt
does not contain anychain_controller.cpp:235 _push_block
lines and does contain repeatedPeer localhost:9876 sent a handshake with an unauthorized key: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV.
lines.Verify
specified
authenticationprograms/launcher/launcher -p 3 -n 3 -i now -m specified
eosd
to run for at least 2 minutes.programs/launcher/launcher -k 2
tn_data_0/config.ini
,tn_data_1/config.ini
, andtn_data_2/config.ini
containsallowed-connection = specified
, and entries forpeer-key =
andpeer-private-key =
.tn_data_0/stderr.txt
,tn_data_1/stderr.txt
, andtn_data_2/stderr.txt
does not containPeer not authenticated. Closing connection.
Verify
none
authenticationprograms/launcher/launcher -p 3 -n 3 -i now -m none
eosd
to run for at least 2 minutes.programs/launcher/launcher -k 2
tn_data_0/config.ini
,tn_data_1/config.ini
, andtn_data_2/config.ini
does not contain anyallowed-connection =
lines.tn_data_0/stderr.txt
,tn_data_1/stderr.txt
, andtn_data_2/stderr.txt
containsPeer not authenticated. Closing connection.
Manually Configured Tests
Verify
producer
andspecified
authenticationprograms/launcher/launcher -p 2 -n 3 -i now -m producers -m specified
programs/launcher/launcher -k 2
programs/eosc/eosc create key
three times.tn_data_0/config.ini
, change the linepeer-key = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
to include the first public key generated in the preceding step by pasting the value between the double quotes, overwriting the existing value. Be sure to preserve the double quotes.tn_data_0/config.ini
add a secondpeer-key = ""
line containing the second public key generated in the step above.tn_data_0/config.ini
, change the linepeer-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
to include the third key pair generated in the step above by pasting first the public key between the first pair of double quotes and second the private key between the second pair of double quotes.tn_data_1/config.ini
, change the linepeer-key = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
to include the first public key generated in the step above.tn_data_1/config.ini
, add a secondpeer-key = ""
line containing the third public key generated in the step above.tn_data_1/config.ini
, change the linepeer-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
to include the second key pair generated in the step above.tn_data_2/config.ini
, change the linepeer-key = "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
to include the second public key generated in the step above.tn_data_2/config.ini
, add a secondpeer-key = ""
line containing the third public key generated in the step above.tn_data_2/config.ini
, change the linepeer-private-key = ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
to include the first key pair generated in the step above.#* The distribution of keys to config files described above is summarized in the following table:
#* ||config.ini||peer-key||peer-private-key||
|----|----|----|
|tn_data_0|1 ^st^ and 2 ^nd^|3 ^rd^|
|tn_data_1|1 ^st^ and 3 ^rd^|2 ^nd^|
|tn_data_2|2 ^nd^ and 3 ^rd^|1 ^st^|
programs/eosd/eosd --skip-transaction-signatures --data-dir tn_data_0 > tn_data_0/stdout.txt 2> tn_data_0/stderr.txt &
programs/eosd/eosd --skip-transaction-signatures --data-dir tn_data_1 > tn_data_1/stdout.txt 2> tn_data_1/stderr.txt &
programs/eosd/eosd --skip-transaction-signatures --data-dir tn_data_2 > tn_data_2/stdout.txt 2> tn_data_2/stderr.txt &
eosd
to run for at least 2 minutes.pkill eosd
tn_data_0/stderr.txt
,tn_data_1/stderr.txt
, andtn_data_2/stderr.txt
does not containPeer not authenticated. Closing connection.
┆Attachments: config.ini | config.ini | config.ini
The text was updated successfully, but these errors were encountered: