Imported Upstream version 2.7
[ossec-hids.git] / src / rootcheck / db / cis_rhel_linux_rcl.txt
1 # @(#) $Id: ./src/rootcheck/db/cis_rhel_linux_rcl.txt, 2011/09/08 dcid Exp $
2
3 #
4 # OSSEC Linux Audit - (C) 2008 Daniel B. Cid - dcid@ossec.net
5 #
6 # Released under the same license as OSSEC.
7 # More details at the LICENSE file included with OSSEC or online
8 # at: http://www.ossec.net/en/licensing.html
9 #
10 # [Application name] [any or all] [reference]
11 # type:<entry name>;
12 #
13 # Type can be:
14 #             - f (for file or directory)
15 #             - p (process running)
16 #             - d (any file inside the directory)
17 #
18 # Additional values:
19 # For the registry , use "->" to look for a specific entry and another
20 # "->" to look for the value.
21 # For files, use "->" to look for a specific value in the file.
22 #
23 # Values can be preceeded by: =: (for equal) - default
24 #                             r: (for ossec regexes)
25 #                             >: (for strcmp greater)
26 #                             <: (for strcmp  lower)
27 # Multiple patterns can be specified by using " && " between them.
28 # (All of them must match for it to return true).
29
30
31 # CIS Checks for Red Hat (RHEL 2.1, 3.0, 4.0 and Fedora Core 1,2,3,4 and 5).
32 # Based on CIS Benchmark for Red Hat Enterprise Linux v1.0.5
33
34
35
36 # RC scripts location
37 $rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d;
38
39
40
41 # Main one. Only valid for Red Hat/Fedora.
42 [CIS - Testing against the CIS Red Hat Enterprise Linux Benchmark v1.0.5] [any required] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
43 f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 4;
44 f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 3;
45 f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 2.1;
46 f:/etc/fedora-release -> r:^Fedora && r:release 1;
47 f:/etc/fedora-release -> r:^Fedora && r:release 2;
48 f:/etc/fedora-release -> r:^Fedora && r:release 3;
49 f:/etc/fedora-release -> r:^Fedora && r:release 4;
50 f:/etc/fedora-release -> r:^Fedora && r:release 5;
51
52
53
54 # Build considerations - Partition scheme.
55 [CIS - Red Hat Linux - Build considerations - Robust partition scheme - /var is not on its own partition] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
56 f:/etc/fstab -> !r:/var;
57
58 [CIS - Red Hat Linux - Build considerations - Robust partition scheme - /home is not on its own partition] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
59 f:/etc/fstab -> !r:/home;
60
61
62
63
64 # Section 1.3 - SSH configuration
65 [CIS - Red Hat Linux 1.3 - SSH Configuration - Protocol version 1 enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
66 f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1;
67
68 [CIS - Red Hat Linux 1.3 - SSH Configuration - IgnoreRHosts disabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
69 f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no;
70
71 [CIS - Red Hat Linux 1.3 - SSH Configuration - Empty passwords permitted] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
72 f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes;
73
74 [CIS - Red Hat Linux 1.3 - SSH Configuration - Host based authentication enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
75 f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes;
76
77 [CIS - Red Hat Linux 1.3 - SSH Configuration - Root login allowed] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
78 f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes;
79
80
81
82 # Section 1.4 Enable system accounting
83 #[CIS - Red Hat Linux 1.4 - System Accounting - Sysstat not installed] [all] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
84 #f:!/var/log/sa;
85
86
87
88 # Section 2.5 Install and run Bastille
89 #[CIS - Red Hat Linux 1.5 - System harderning - Bastille is not installed] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
90 #f:!/etc/Bastille;
91
92
93
94 # Section 2 - Minimize xinetd services
95 [CIS - Red Hat Linux 2.3 - Telnet enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
96 f:/etc/xinetd.c/telnet -> !r:^# && r:disable && r:no;
97
98 [CIS - Red Hat Linux 2.4 - VSFTP enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
99 f:/etc/xinetd.c/vsftpd -> !r:^# && r:disable && r:no;
100
101 [CIS - Red Hat Linux 2.4 - WU-FTP enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
102 f:/etc/xinetd.c/wu-ftpd -> !r:^# && r:disable && r:no;
103
104 [CIS - Red Hat Linux 2.5 - rsh/rlogin/rcp enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
105 f:/etc/xinetd.c/rlogin -> !r:^# && r:disable && r:no;
106 f:/etc/xinetd.c/rsh -> !r:^# && r:disable && r:no;
107 f:/etc/xinetd.c/shell -> !r:^# && r:disable && r:no;
108
109 [CIS - Red Hat Linux 2.6 - tftpd enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
110 f:/etc/xinetd.c/tftpd -> !r:^# && r:disable && r:no;
111
112 [CIS - Red Hat Linux 2.7 - imap enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
113 f:/etc/xinetd.c/imap -> !r:^# && r:disable && r:no;
114 f:/etc/xinetd.c/imaps -> !r:^# && r:disable && r:no;
115
116 [CIS - Red Hat Linux 2.8 - pop3 enabled on xinetd] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
117 f:/etc/xinetd.c/ipop3 -> !r:^# && r:disable && r:no;
118 f:/etc/xinetd.c/pop3s -> !r:^# && r:disable && r:no;
119
120
121
122 # Section 3 - Minimize boot services
123 [CIS - Red Hat Linux 3.1 - Set daemon umask - Default umask is higher than 027] [all] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
124 f:/etc/init.d/functions -> !r:^# && r:^umask && >:umask 027;
125
126 [CIS - Red Hat Linux 3.4 - GUI login enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
127 f:/etc/inittab -> !r:^# && r:id:5;
128
129 [CIS - Red Hat Linux 3.7 - Disable standard boot services - Samba Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
130 d:$rc_dirs -> ^S\d\dsamba$;
131 d:$rc_dirs -> ^S\d\dsmb$;
132
133 [CIS - Red Hat Linux 3.8 - Disable standard boot services - NFS Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
134 d:$rc_dirs -> ^S\d\dnfs$;
135 d:$rc_dirs -> ^S\d\dnfslock$;
136
137 [CIS - Red Hat Linux 3.10 - Disable standard boot services - NIS Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
138 d:$rc_dirs -> ^S\d\dypbind$;
139 d:$rc_dirs -> ^S\d\dypserv$;
140
141 [CIS - Red Hat Linux 3.13 - Disable standard boot services - NetFS Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
142 d:$rc_dirs -> ^S\d\dnetfs$;
143
144 [CIS - Red Hat Linux 3.15 - Disable standard boot services - Apache web server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
145 d:$rc_dirs -> ^S\d\dapache$;
146 d:$rc_dirs -> ^S\d\dhttpd$;
147
148 [CIS - Red Hat Linux 3.15 - Disable standard boot services - TUX web server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
149 d:$rc_dirs -> ^S\d\dtux$;
150
151 [CIS - Red Hat Linux 3.16 - Disable standard boot services - SNMPD process Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
152 d:$rc_dirs -> ^S\d\dsnmpd$;
153
154 [CIS - Red Hat Linux 3.17 - Disable standard boot services - DNS server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
155 d:$rc_dirs -> ^S\d\dnamed$;
156
157 [CIS - Red Hat Linux 3.18 - Disable standard boot services - MySQL server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
158 d:$rc_dirs -> ^S\d\dmysqld$;
159
160 [CIS - Red Hat Linux 3.18 - Disable standard boot services - PostgreSQL server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
161 d:$rc_dirs -> ^S\d\dpostgresql$;
162
163 [CIS - Red Hat Linux 3.19 - Disable standard boot services - Webmin Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
164 d:$rc_dirs -> ^S\d\dwebmin$;
165
166 [CIS - Red Hat Linux 3.20 - Disable standard boot services - Squid Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
167 d:$rc_dirs -> ^S\d\dsquid$;
168
169 [CIS - Red Hat Linux 3.21 - Disable standard boot services - Kudzu hardware detection Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
170 d:$rc_dirs -> ^S\d\dkudzu$;
171
172
173
174 # Section 4 - Kernel tuning
175 [CIS - Red Hat Linux 4.1 - Network parameters - Source routing accepted] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
176 f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1;
177
178 [CIS - Red Hat Linux 4.1 - Network parameters - ICMP broadcasts accepted] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
179 f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0;
180
181 [CIS - Red Hat Linux 4.2 - Network parameters - IP Forwarding enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
182 f:/proc/sys/net/ipv4/ip_forward -> 1;
183 f:/proc/sys/net/ipv6/ip_forward -> 1;
184
185
186
187 # Section 6 - Permissions
188 [CIS - Red Hat Linux 6.1 - Partition /var without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
189 f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/var && !r:nodev;
190
191 [CIS - Red Hat Linux 6.1 - Partition /tmp without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
192 f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/tmp && !r:nodev;
193
194 [CIS - Red Hat Linux 6.1 - Partition /opt without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
195 f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/opt && !r:nodev;
196
197 [CIS - Red Hat Linux 6.1 - Partition /home without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
198 f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/home && !r:nodev ;
199
200 [CIS - Red Hat Linux 6.2 - Removable partition /media without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
201 f:/etc/fstab -> !r:^# && r:/media && !r:nodev;
202
203 [CIS - Red Hat Linux 6.2 - Removable partition /media without 'nosuid' set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
204 f:/etc/fstab -> !r:^# && r:/media && !r:nosuid;
205
206 [CIS - Red Hat Linux 6.3 - User-mounted removable partition allowed on the console] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
207 f:/etc/security/console.perms -> r:^<console>  \d+ <cdrom>;
208 f:/etc/security/console.perms -> r:^<console>  \d+ <floppy>;
209
210
211
212 # Section 7 - Access and authentication
213 [CIS - Red Hat Linux 7.8 - LILO Password not set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
214 f:/etc/lilo.conf -> !r:^# && !r:restricted;
215 f:/etc/lilo.conf -> !r:^# && !r:password=;
216
217 [CIS - Red Hat Linux 7.8 - GRUB Password not set] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
218 f:/boot/grub/menu.lst -> !r:^# && !r:password;
219
220 [CIS - Red Hat Linux 8.2 - Account with empty password present] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
221 f:/etc/shadow -> r:^\w+::;
222
223 [CIS - Red Hat Linux SN.11 - Non-root account with uid 0] [any] [http://www.ossec.net/wiki/index.php/CIS_RHEL]
224 f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:;
225
226
227
228 # Tests specific for VMware ESX - Runs on Red Hat Linux
229 # Will not be tested anywhere else.
230 [VMware ESX - Testing against the Security Harderning benchmark VI3 for ESX 3.5] [any required] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
231 f:/etc/vmware-release -> r:^VMware ESX;
232
233
234 # Virtual Machine Files and Settings - 1
235 # 1.1
236 [VMware ESX - VM settings - Copy operation between guest and console enabled] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
237 d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.copy.disable;
238 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.copy.disable && r:false;
239
240 # 1.2
241 [VMware ESX - VM settings - Paste operation between guest and console enabled] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
242 d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.paste.disable;
243 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.paste.disable && r:false;
244
245 # 1.3
246 [VMware ESX - VM settings - GUI Options enabled] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
247 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.setGUIOptions.enable && r:true;
248
249 # 1.4
250 [VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Rotate size not 100KB] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
251 d:/vmfs/volumes -> .vmx$ -> !r:^log.rotateSize;
252 d:/vmfs/volumes -> .vmx$ -> r:^log.rotateSize && !r:"100000";
253
254 # 1.5
255 [VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Maximum number of logs not 10] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
256 d:/vmfs/volumes -> .vmx$ -> !r:^log.keepOld;
257 d:/vmfs/volumes -> .vmx$ -> r:^log.keepOld && r:"10";
258
259 # 1.6
260 [VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Guests allowed to write SetInfo data to config] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
261 d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.setinfo.disable;
262 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.setinfo.disable && r:false;
263
264 # 1.7
265 [VMware ESX - VM settings - Nonpersistent Disks being used] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
266 d:/vmfs/volumes -> .vmx$ -> r:^scsi\d:\d.mode && r:!independent-nonpersistent;
267
268 # 1.8
269 [VMware ESX - VM settings - Floppy drive present] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
270 d:/vmfs/volumes -> .vmx$ -> r:^floppy\d+.present && r:!false;
271
272 [VMware ESX - VM settings - Serial port present] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
273 d:/vmfs/volumes -> .vmx$ -> r:^serial\d+.present && r:!false;
274
275 [VMware ESX - VM settings - Parallel port present] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
276 d:/vmfs/volumes -> .vmx$ -> r:^parallel\d+.present && r:!false;
277
278 # 1.9
279 [VMware ESX - VM settings - Unauthorized Removal or Connection of Devices allowed] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
280 d:/vmfs/volumes -> .vmx$ -> !r:^Isolation.tools.connectable.disable;
281 d:/vmfs/volumes -> .vmx$ -> r:^Isolation.tools.connectable.disable && r:false;
282
283 # 1.10
284 [VMware ESX - VM settings - Avoid Denial of Service Caused by Virtual Disk Modification Operations - diskWiper enabled] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
285 d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.diskWiper.disable;
286 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.diskWiper.disable && r:false;
287
288 [VMware ESX - VM settings - Avoid Denial of Service Caused by Virtual Disk Modification Operations - diskShrink enabled] [any] [http://www.ossec.net/wiki/index.php/SecurityHardening_VMwareESX]
289 d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.diskShrink.disable;
290 d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.diskShrink.disable && r:false;
291
292
293 # Configuring the Service Console in ESX 3.5 - 2
294 # 2.1
295
296
297 # EOF