-
Notifications
You must be signed in to change notification settings - Fork 688
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4061 from freedomofpress/fix-cve-2019-3462
Upgrade apt without following redirects on first install, fix CVE-2019-3462
- Loading branch information
Showing
7 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
install_files/ansible-base/roles/install-fpf-repo/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
--- | ||
- include: upgrade_apt.yml | ||
|
||
- name: Install SecureDrop apt repo GPG signing key. | ||
apt_key: | ||
state: present | ||
|
43 changes: 43 additions & 0 deletions
43
install_files/ansible-base/roles/install-fpf-repo/tasks/upgrade_apt.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
# Fix for CVE-2019-3462 (see https://justi.cz/security/2019/01/22/apt-rce.html) | ||
# If apt < 1.4.9, it is vulnerable to CVE-2019-3462 and we must ensure no | ||
# redirects are followed when updating apt via apt. | ||
- name: Upgrade apt without following redirects | ||
shell : > | ||
apt -o Acquire::http::AllowRedirect=false update && | ||
apt -o Acquire::http::AllowRedirect=false --only-upgrade -y install apt | ||
become: yes | ||
register: _apt_upgrade_command_output_results | ||
changed_when: "'1 upgraded, 0 newly installed, 0 to remove' in _apt_upgrade_command_output_results.stdout" | ||
tags: apt | ||
|
||
- name: Inform user that apt traffic is being redirected | ||
assert: | ||
that: | ||
- "'302 Found' not in _apt_upgrade_command_output_results.stdout" | ||
- "'302 Found' not in _apt_upgrade_command_output_results.stderr" | ||
fail_msg: >- | ||
It appears your apt traffic is being redirected. | ||
SecureDrop cannot be installed. For details, see | ||
https://github.com/freedomofpress/securedrop/issues/4058 | ||
- name: Get apt version | ||
shell: dpkg-query --showformat='${Version}' --show apt | ||
register: _apt_query_command_output_result | ||
changed_when: false | ||
tags: | ||
- apt | ||
|
||
- name: Verify that the version of apt installed is not vulnerable to 2019-3462 (Xenial) | ||
assert: | ||
that: _apt_query_command_output_result.stdout is version('1.2.29ubuntu0.1', '>=') | ||
when: ansible_distribution_release == 'xenial' | ||
tags: | ||
- apt | ||
|
||
- name: Verify that the version of apt installed is not vulnerable to 2019-3462 (Trusty) | ||
assert: | ||
that: _apt_query_command_output_result.stdout is version('1.0.1ubuntu2.19', '>=') | ||
when: ansible_distribution_release == 'trusty' | ||
tags: | ||
- apt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# sha256 digest quay.io/freedomofpress/sd-docker-builder:2018_12_11 | ||
5b9b9e66db6d4fda0d82062b6ca715e04d8e2ef2c0065c41a6b7bb8c6062a07d | ||
# sha256 digest quay.io/freedomofpress/sd-docker-builder:2019_01_23 | ||
39033e3a452fd18c0e58abe8e693180ff2cb18fdf4083b293c069bbca64b8ac8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters