Skip to content

Commit

Permalink
Merge pull request #5784 from freedomofpress/5128-remove-snappy
Browse files Browse the repository at this point in the history
Fixes #5128 removes snappy from the default installation
  • Loading branch information
emkll authored Feb 12, 2021
2 parents 240a9a9 + 9492b10 commit f4b7805
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions install_files/ansible-base/roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ unused_packages:
- libiw30
- wireless-tools
- wpasupplicant
- snapd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
apt:
name: "{{ unused_packages }}"
state: absent
purge: yes
tags:
- apt
- hardening
Expand Down
10 changes: 9 additions & 1 deletion molecule/testinfra/common/test_system_hardening.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ def test_no_ecrypt_messages_in_logs(host, logfile):
@pytest.mark.parametrize('package', [
'cloud-init',
'libiw30',
'wpasupplicant',
'snapd',
'wireless-tools',
'wpasupplicant',
])
def test_unused_packages_are_removed(host, package):
""" Check if unused package is present """
Expand All @@ -165,3 +166,10 @@ def test_iptables_packages(host):
assert host.package("iptables-persistent").is_installed
else:
assert not host.package("iptables-persistent").is_installed


def test_snapd_absent(host):
assert not host.file("/lib/systemd/system/snapd.service").exists
assert not host.file("/etc/apparmor.d/usr.lib.snapd.snap-confine.real").exists
assert not host.file("/usr/bin/snap").exists
assert not host.file("/var/lib/snapd/snaps").exists

0 comments on commit f4b7805

Please sign in to comment.