-
Notifications
You must be signed in to change notification settings - Fork 687
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
Adds support for v3 Onion urls to ./securedrop-admin tailsconfig` #4675
Adds support for v3 Onion urls to ./securedrop-admin tailsconfig` #4675
Conversation
eb554af
to
23decc7
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4675 +/- ##
========================================
Coverage 82.67% 82.67%
========================================
Files 45 45
Lines 3122 3122
Branches 338 338
========================================
Hits 2581 2581
Misses 454 454
Partials 87 87 Continue to review full report at Codecov.
|
e47f7a1
to
b0709cf
Compare
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.
For case 1
TASK [tails-config : Set normal user ownership on subset of directories.] **************************************
ok: [localhost] => (item=/home/amnesia/Persistent/.securedrop)
ok: [localhost] => (item=/home/amnesia/Desktop)
ok: [localhost] => (item=/home/amnesia/.local/share/applications)
TASK [tails-config : Assemble desktop icon info.] **************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'stdout'\n\nThe error appears to have been in '/home/amnesia/Persistent/securedrop/install_files/ansible-base/roles/tails-config/tasks/create_desktop_shortcuts.yml': line 62, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# Storing as host fact so we can loop over the data in one task.\n- name: Assemble desktop icon info.\n ^ here\n"}
NO MORE HOSTS LEFT *********************************************************************************************
NO MORE HOSTS LEFT *********************************************************************************************
to retry, use: --limit @/home/amnesia/Persistent/securedrop/install_files/ansible-base/securedrop-tails.retry
PLAY RECAP *****************************************************************************************************
localhost : ok=18 changed=2 unreachable=0 failed=1
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.
Case 2: v2 and v3 enabled
Test plan:
- run
./securedrop-admin tailsconfig
and verify that it completes successfully - Verify that
/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
- verify that the
/var/lib/tor/onion_auth
directory was created and contains 3 distinct.auth_private
files with the contents of the v3 files - verify that the Journalist Interface and Source Interface are available via their desktop shortcuts at their v3 addresses
Did not test ssh values as my v3 is not automatically setup yet
- verify that
~/.ssh/config
contains entries forapp
andmon
with their v3 URLs - verify that
~/.ssh/config
contains entries forapp-legacy
andmon-legacy
with their v2 URLs - verify that servers are accessible via
ssh app
andssh mon
- verify that servers are accessible via
ssh app-legacy
andssh mon-legacy
Case 3: v3 only
Test plan:
- run
./securedrop-admin tailsconfig
and verify that it completes successfully - Verify that
/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
- verify that the
/var/lib/tor/onion_auth
directory was created and contains 3 distinct.auth_private
files with the contents of the v3 files - verify that the Journalist Interface and Source Interface are available via their desktop shortcuts at their v3 addresses
Did not test ssh values as my v3 is not automatically setup yet
- verify that
~/.ssh/config
contains entries forapp
andmon
with their v3 URLs - verify that servers are accessible via
ssh app
andssh mon
Journalist Workstation testing
Case 1: v2 enabled (previous state)
Setup:
- instance installed with
v2_onionservice=true, v3_onion_service=false
, using the Add v3 onion support to tor-hidden-services ansible role #4652 candidate branch if the changes in Add v3 onion support to tor-hidden-services ansible role #4652 are not yet merged and rebased into this branch - v2
app-source-ths
andapp-journalist-aths
files must be present ininstall_files/ansible-base
. - v3 files must not be present.
Test plan:
- run
./securedrop-admin tailsconfig
and verify that it completes successfully - verify that the Journalist Interface and Source Interface are available via their desktop shortcuts at their v2 addresses
^^^ this failed as mentioned in the comment above.
Case 2: v3 only (previous state)
Setup:
Test plan:
- run
./securedrop-admin tailsconfig
and verify that it completes successfully - Verify that
/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
- verify that the
/var/lib/tor/onion_auth
directory was created and contains a single.auth_private
file with the contents of theapp-journalist.auth_private
file - verify that the Journalist Interface and Source Interface are available via their desktop shortcuts at their v3 addresses
Ansible overrides facts if they are reused even with when statements. We are creating two varaiables from either v2 or from v3 addresses based on what is available and then using those.
9c42b9a
to
7b302c0
Compare
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.
This is now approved from my side. 🦄
Preserves the v2 Onion lookup logic, but prefers v3 Onions if those are found on the Admin Workstation. Ensures that Admins connecting to the servers after migrating to v3 Onion URLs are using them for SSH.
@rmol Do you want to review it once? I can then merge it after your review. |
Based on visual review, looks like there's only one piece missing: updates to the Example patch for proposed changes
Not pushing that commit because I haven't tested it in Tails. Take a look and holler if you have different thoughts on implementation, @zenmonkeykstop. |
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.
In the v3-only scenario for the Admin Workstation, this step will pass:
verify that servers are accessible via
ssh app
andssh mon
However I expect that a subsequent ./securedrop-admin install
will fail, because of missing updates to install_files/ansible-base/inventory-dynamic
. See patch in comment suggesting an approach; if you agree the changes are warranted, @zenmonkeykstop, please add a commit and holler back for follow-up review!
I was trying admin case 2 (v2 and v3 enabled), and got an error when installing the servers, at This was at bbad1cb. I'm out of time today, but will dig into it in the morning. |
Thanks for the dynamic inventory fix @conorsch ! Running through the v3-only scenario now and adding a second |
I got through the admin test plans today, despite several apparent flakes that were resolved by rebooting the admin workstation and trying again. 🙄 The only joy I had with the journalist workstation was that the source interface was visible in the v3-only scenario (haven't reinstalled to v2+v3 yet), but |
@rmol Can you please show us all the files available under In my Tails vm:
|
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.
Sorry to hold this up, everyone. I ran through the journalist workstation tests fresh today and everything worked. TestingAdmin Workstation testingCase 1: v2 only (previous state)Test plan:
Case 2: v2 and v3 enabledTest plan:
Case 3: v3 onlyTest plan:
Journalist Workstation testingCase 1: v2 enabled (previous state)Test plan:
Case 2: v3 only (previous state)Test plan:
|
Looks good to me! Approving based on visual review. We'll be banging on this logic quite a bit in the QA period... |
Status
Work in progress
Description of Changes
Fixes #4629.
This PR adds support for setting up v3 onion urls in 2 cases:
For an Admin Workstation, when v3 support is enabled,
./securedrop-admin tailsconfig
expects to find v3 service info in 4 files:~/Persistent/securedrop/install_files/ansible-base/app-sourcev3-ths
, with format:~/Persistent/securedrop/install_files/ansible-base/app-journalist.auth_private
, with format:~/Persistent/securedrop/install_files/ansible-base/app-ssh.auth_private
, with format:~/Persistent/securedrop/install_files/ansible-base/mon-ssh.auth_private
, with format:An Admin Workstation will also require that the instance's
site-specific
file be present, with the appropriate values for the required configuration.For v3 support on a Journalist Workstation, the
app-sourcev-3ths
andapp-journalist.auth_private
files must be present, and other files mentioned above must not.Testing
Admin Workstation testing
Case 1: v2 only (previous state)
Setup:
v2_onionservice=true, v3_onion_service=false
.-ths
and-aths
files must be present ininstall_files/ansible-base
.Test plan:
./securedrop-admin tailsconfig
and verify that it completes successfuly~/.ssh/config
contains entries forapp
andmon
with their v2 URLsssh app
andssh mon
./securedrop-admin install
completes successfullyCase 2: v2 and v3 enabled
Setup:
v2_onionservice=true, v3_onion_service=true
-ths
and-aths
files must be present ininstall_files/ansible-base
.install_files/ansible-base
.Test plan:
./securedrop-admin tailsconfig
and verify that it completes successfully/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
/var/lib/tor/onion_auth
directory was created and contains 3 distinct.auth_private
files with the contents of the v3 files~/.ssh/config
contains entries forapp
andmon
with their v3 URLs~/.ssh/config
contains entries forapp-legacy
andmon-legacy
with their v2 URLsssh app
andssh mon
ssh app-legacy
andssh mon-legacy
./securedrop-admin install
completes successfullyCase 3: v3 only
Setup:
v2_onionservice=false, v3_onion_service=true
-ths
and-aths
files must not be presentinstall_files/ansible-base
.Test plan:
./securedrop-admin tailsconfig
and verify that it completes successfully/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
/var/lib/tor/onion_auth
directory was created and contains 3 distinct.auth_private
files with the contents of the v3 files~/.ssh/config
contains entries forapp
andmon
with their v3 URLsssh app
andssh mon
./securedrop-admin install
completes successfullyJournalist Workstation testing
Case 1: v2 enabled (previous state)
Setup:
v2_onionservice=true, v3_onion_service=false
app-source-ths
andapp-journalist-aths
files must be present ininstall_files/ansible-base
.install_files/ansible-base/group_vars/all/site-specific
must not be presentTest plan:
./securedrop-admin tailsconfig
and verify that it completes successfullyCase 2: v3 only (previous state)
Setup:
v2_onionservice=true, v3_onion_service=true
orv2_onion_service=false, v3_onion-service=true
app-sourcev3-ths
andapp-journalist.auth_private
files must be present ininstall_files/ansible-base
.install_files/ansible-base/group_vars/all/site-specific
must not be presentTest plan:
./securedrop-admin tailsconfig
and verify that it completes successfully/etc/tor/torrc
contains a lineClientOnionAuthDir /var/lib/tor/onion_auth
/var/lib/tor/onion_auth
directory was created and contains a single.auth_private
file with the contents of theapp-journalist.auth_private
fileDeployment
Any special considerations for deployment? Consider both:
Checklist
If you made changes to
securedrop-admin
:make -C admin test
) pass in the admin development containerIf you made non-trivial code changes: