-
Notifications
You must be signed in to change notification settings - Fork 693
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
Updated restore playbook to validate tor config after v2 removal #5894
Conversation
This pull request fixes 5 alerts when merging 2c37173 into 8d5430d - view on LGTM.com fixed alerts:
|
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.
The awk
torrc cleanup is a nice reduction, but I think it needs a tweak or some post-processing, as it's leaving an empty HiddenServiceDir
line at the end of the file. The tor --verify-config
check passes, as Tor ignores that line, but it's debris.
Testing
v2+v3 (v2nv3.tar.gz
) and v3 (v3.tar.gz
) backup files are required.
v2+v3
From this branch, against a prod system (VM or hardware):
- perform a restore with the command
./securedrop-admin --force restore install_files/ansible-base/v2nv3.tar.gz
- Verify that the restore completes successfully
- Verify that the tasks in
cleanup_v2.yml
run successfully after theReload Apache service
task - Verify that the app server
/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
)
torrc
contains an extra line at the end containing just HiddenServiceDir
.
v2+v3 with HTTPS
(Note: if you don't have a HTTPS backup, fake it! simply untar the v2+v3 backup, add an extra line in etc/tor/torrc
in the v2 source block with the contents HiddenServicePort 443 127.0.0.1:443
, and recreate the tarball! For extra points, add it in the v3 source definition as well.)
From this branch, against a prod system (VM or hardware):
- perform a restore with the command
./securedrop-admin --force restore install_files/ansible-base/v2nv3https.tar.gz
- Verify that the restore completes successfully
- Verify that the tasks in
cleanup_v2.yml
run successfully after theReload Apache service
task - Verify that the app server
/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
) - If HTTPS was enabled in the backup for v3, verify that it is still enabled in the server
/etc/tor/torrc
torrc
contains an extra line at the end containing just HiddenServiceDir
.
v3-only
From this branch, against a prod system (VM or hardware):
- perform a backup with the command
./securedrop-admin --force restore install_files/ansible-base/v3-only.tar.gz
- Verify that the backup completes successfully
- Verify that the tasks in
cleanup_v2.yml
do not run after theReload Apache service
task
This pull request fixes 5 alerts when merging c8b432f into 8d5430d - view on LGTM.com fixed alerts:
|
@rmol a fix has been added. Take another look? |
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.
The sed addition worked.
v2+v3
From this branch, against a prod system (VM or hardware):
- perform a restore with the command
./securedrop-admin --force restore install_files/ansible-base/v2nv3.tar.gz
- Verify that the restore completes successfully
- Verify that the tasks in
cleanup_v2.yml
run successfully after theReload Apache service
task - Verify that the app server
/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
)
v2+v3 with HTTPS
(Note: if you don't have a HTTPS backup, fake it! simply untar the v2+v3 backup, add an extra line in etc/tor/torrc
in the v2 source block with the contents HiddenServicePort 443 127.0.0.1:443
, and recreate the tarball! For extra points, add it in the v3 source definition as well.)
From this branch, against a prod system (VM or hardware):
- perform a backup with the command
./securedrop-admin --force restore install_files/ansible-base/v2nv3https.tar.gz
- Verify that the backup completes successfully
- Verify that the tasks in
cleanup_v2.yml
run successfully after theReload Apache service
task - Verify that the app server
/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
) - If HTTPS was enabled in the backup for v3, verify that it is still enabled in the server
/etc/tor/torrc
v3-only
From this branch, against a prod system (VM or hardware):
- perform a backup with the command
./securedrop-admin --force restore install_files/ansible-base/v3-only.tar.gz
- Verify that the backup completes successfully
- Verify that the tasks in
cleanup_v2.yml
do not run after theReload Apache service
task
Status
Ready for review / Work in progress
Description of Changes
Fixes #5892.
disable_v2.py
with an awk one-liner that catches the case when HTTPS is enabled on a source v2 interfaceTesting
v2+v3 (
v2nv3.tar.gz
) and v3 (v3.tar.gz
) backup files are required.v2+v3
From this branch, against a prod system (VM or hardware):
./securedrop-admin --force restore install_files/ansible-base/v2nv3.tar.gz
cleanup_v2.yml
run successfully after theReload Apache service
task/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
)v2+v3 with HTTPS
(Note: if you don't have a HTTPS backup, fake it! simply untar the v2+v3 backup, add an extra line in
etc/tor/torrc
in the v2 source block with the contentsHiddenServicePort 443 127.0.0.1:443
, and recreate the tarball! For extra points, add it in the v3 source definition as well.)From this branch, against a prod system (VM or hardware):
./securedrop-admin --force restore install_files/ansible-base/v2nv3https.tar.gz
cleanup_v2.yml
run successfully after theReload Apache service
task/etc/tor/torrc
file contains no v2 services (view withssh app cat /etc/tor/torrc
)/etc/tor/torrc
v3-only
From this branch, against a prod system (VM or hardware):
./securedrop-admin --force restore install_files/ansible-base/v3-only.tar.gz
cleanup_v2.yml
do not run after theReload Apache service
taskDeployment
Deployed with GUI or manual update on workstation.
Checklist
If you made non-trivial code changes:
Choose one of the following: