File tree Expand file tree Collapse file tree 9 files changed +61
-9
lines changed Expand file tree Collapse file tree 9 files changed +61
-9
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,19 @@ We remove the following packages:
7171 * rsh-server ([ NSA] ( http://www.nsa.gov/ia/_files/os/redhat/rhel5-guide-i731.pdf ) , Chapter 3.2.3)
7272 * prelink ([ open-scap] ( https://static.open-scap.org/ssg-guides/ssg-sl7-guide-ospp-rhel7-server.html#xccdf_org.ssgproject.content_rule_disable_prelink ) )
7373
74+ ## Disabled filesystems
75+
76+ We disable the following filesystems, because they're most likely not used:
77+
78+ * "cramfs"
79+ * "freevxfs"
80+ * "jffs2"
81+ * "hfs"
82+ * "hfsplus"
83+ * "squashfs"
84+ * "udf"
85+ * "vfat"
86+
7487## Example Playbook
7588
7689 - hosts: localhost
Original file line number Diff line number Diff line change 33 hosts : localhost
44 roles :
55 - ansible-os-hardening
6+ pre_tasks :
7+ - name : Run the equivalent of "apt-get update" as a separate step
8+ apt :
9+ update_cache : yes
10+ when : ansible_os_family == 'Debian'
611 vars :
712 os_security_users_allow : change_user
813 os_security_kernel_enable_core_dump : false
5459
5560- name : wrapper playbook for kitchen testing "ansible-os-hardening"
5661 hosts : localhost
62+ pre_tasks :
63+ - name : Run the equivalent of "apt-get update" as a separate step
64+ apt :
65+ update_cache : yes
66+ when : ansible_os_family == 'Debian'
5767 roles :
5868 - ansible-os-hardening
5969
Original file line number Diff line number Diff line change @@ -182,3 +182,15 @@ sysctl_config:
182182# Do not delete the following line or otherwise the playbook will fail
183183# at task 'create a combined sysctl-dict if overwrites are defined'
184184sysctl_overwrite :
185+
186+ # disable unused filesystems
187+ os_unused_filesystems :
188+ - " cramfs"
189+ - " freevxfs"
190+ - " jffs2"
191+ - " hfs"
192+ - " hfsplus"
193+ - " squashfs"
194+ - " udf"
195+ - " vfat"
196+
Original file line number Diff line number Diff line change 2222- include : minimize_access.yml
2323 tags : minimize_acces
2424
25+ - include : modprobe.yml
26+ tags : modprobe
27+
2528- include : pam.yml
2629 tags : pam
2730
Original file line number Diff line number Diff line change 11---
2+ - name : install modprobe to disable filesystems | os-10
3+ package :
4+ name : ' {{modprobe_package}}'
5+ state : ' installed'
6+
7+ - name : disable unused filesystems | os-10
8+ template :
9+ src : ' modprobe.j2'
10+ dest : ' /etc/modprobe.d/dev-sec.conf'
11+ owner : ' root'
12+ group : ' root'
13+ mode : ' 0640'
214
3- # modprobe
Original file line number Diff line number Diff line change 1- install cramfs /bin/true
2- install freevxfs /bin/true
3- install jffs2 /bin/true
4- install hfs /bin/true
5- install hfsplus /bin/true
6- install squashfs /bin/true
7- install udf /bin/true
8- install vfat /bin/true
1+ # {{ ansible_managed | comment }}
92
3+ {% for fs in os_unused_filesystems %}
4+ install {{fs}} /bin/true
5+ {% endfor %}
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ passwdqc_path: '/usr/share/pam-configs/passwdqc'
55tally2_path : ' /usr/share/pam-configs/tally2'
66os_nologin_shell_path : ' /usr/sbin/nologin'
77
8+ modprobe_package : ' kmod'
9+
810# Different distros use different standards for /etc/shadow perms, e.g.
911# RHEL derivatives use root:root 0600, whereas Debian-based use root:shadow 0640.
1012# You must provide key/value pairs for owner, group, and mode if overriding.
Original file line number Diff line number Diff line change 11---
2+
23sysctl_rhel_config :
34 # ExecShield protection against buffer overflows
45 kernel.exec-shield : 1
Original file line number Diff line number Diff line change 1+ ---
2+
3+ modprobe_package : ' module-init-tools'
4+
15os_packages_pam_ccreds : ' pam_ccreds'
26os_packages_pam_passwdqc : ' pam_passwdqc'
37os_packages_pam_cracklib : ' pam_cracklib'
You can’t perform that action at this time.
0 commit comments