4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 - name: set /etc/openssl directory with proper rights
22 - name: templating path hardener profile.d script
25 dest: /etc/profile.d/hardened_path.sh
28 - name: removing root spool/mail if exists
30 path: /var/spool/mail/root
33 - name: creating root spool/mail
35 path: /var/spool/mail/root
41 - name: removing unused users
45 remove: yes # deletes home, spool etc
46 ignore_errors: yes # sometimes spool not exists, sometimes group is not primary.
53 - name: remove not needed user groups
63 - name: system uids to 999 instead of 199
66 regexp: 'if \[ \$UID -gt 199 \]'
67 replace: 'if [ $UID -gt 999 ]'
69 - name: Removing home per bin from path in skeleton and in the already existing root
73 regexp: '^PATH=.*$HOME/bin'
75 - /etc/skel/.bash_profile
78 - name: create /etc/cron.allow with root
87 - name: remove linked files
92 - /etc/prelink.conf.d/fipscheck.conf
93 - /etc/prelink.conf.d/grub2.conf
94 - /etc/prelink.conf.d/nss-softokn-prelink.conf
96 - name: change auditd config
98 dest: /etc/audit/auditd.conf
100 regexp: '^ *{{ item.key }} *=.+$'
101 line: '{{ item.key }} = {{ item.val }}'
108 - name: No root login access on terminals /etc/securetty