Skip to content
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 logs playbook to clean up unencrypted tarballs #4596

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions admin/securedrop_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
sdlog = logging.getLogger(__name__)
RELEASE_KEY = '22245C81E3BAEB4138B36061310F561200F4AD77'
DEFAULT_KEYSERVER = 'hkps://keys.openpgp.org'
SUPPORT_ONION_URL = 'http://support6kv2242qx.onion'
SUPPORT_URL = 'https://support.freedom.press'
EXIT_SUCCESS = 0
EXIT_SUBPROCESS_ERROR = 1
EXIT_INTERRUPT = 2
Expand Down Expand Up @@ -741,8 +743,8 @@ def get_logs(args):
os.path.join(args.ansible_path, 'securedrop-logs.yml'),
]
subprocess.check_call(ansible_cmd, cwd=args.ansible_path)
sdlog.info("Encrypt logs and send to [email protected] or upload "
"to the SecureDrop support portal.")
sdlog.info("Please send the encrypted logs to [email protected] or "
"upload them to the SecureDrop support portal: " + SUPPORT_URL)
return 0


Expand Down
22 changes: 17 additions & 5 deletions install_files/ansible-base/securedrop-logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
src: "{{ log_tarball_filename }}"
dest: "{{ playbook_dir }}/{{ log_tarball_filename }}"

- name: Delete tarball from server admin home directory.
file:
path: "{{ log_tarball_filename }}"
state: absent

- name: Clean directory for generated logs to save disk space
file:
path: /tmp/generated-logs
state: absent

- name: Fetch FPF GPG key.
become: no
local_action: >-
Expand All @@ -86,12 +96,14 @@
environment:
GNUPG_HOME: /home/amensia/.gnupg

- name: Delete local unencrypted log tarballs.
become: no
local_action:
module: file
path: "{{ log_tarball_filename }}"
state: absent

- name: Display filenames of local log tarballs.
debug:
msg: >-
Logs copied successfully, find them at {{ (playbook_dir +'/'+ log_tarball_filename )|realpath }}.gpg .

- name: Clean directory for generated logs to save disk space
file:
path: /tmp/generated-logs
state: absent