/policy/cis_debian_linux_rcl.txt

https://bitbucket.org/oscarschneider/ossec-rules · Plain Text · 212 lines · 142 code · 70 blank · 0 comment · 0 complexity · dc51c441300bc6c9a9ba9b98419009cb MD5 · raw file

  1. # @(#) $Id: cis_debian_linux_rcl.txt,v 1.2 2008/07/10 18:03:00 dcid Exp $
  2. #
  3. # OSSEC Linux Audit - (C) 2008 Daniel B. Cid - dcid@ossec.net
  4. #
  5. # Released under the same license as OSSEC.
  6. # More details at the LICENSE file included with OSSEC or online
  7. # at: http://www.ossec.net/en/licensing.html
  8. #
  9. # [Application name] [any or all] [reference]
  10. # type:<entry name>;
  11. #
  12. # Type can be:
  13. # - f (for file or directory)
  14. # - p (process running)
  15. # - d (any file inside the directory)
  16. #
  17. # Additional values:
  18. # For the registry , use "->" to look for a specific entry and another
  19. # "->" to look for the value.
  20. # For files, use "->" to look for a specific value in the file.
  21. #
  22. # Values can be preceeded by: =: (for equal) - default
  23. # r: (for ossec regexes)
  24. # >: (for strcmp greater)
  25. # <: (for strcmp lower)
  26. # Multiple patterns can be specified by using " && " between them.
  27. # (All of them must match for it to return true).
  28. # CIS Checks for Debian/Ubuntu
  29. # Based on Center for Internet Security Benchmark for Debian Linux v1.0
  30. # Main one. Only valid for Debian/Ubuntu.
  31. [CIS - Testing against the CIS Debian Linux Benchmark v1.0] [all required] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  32. f:/etc/debian_version;
  33. f:/proc/sys/kernel/ostype -> Linux;
  34. # Section 1.4 - Partition scheme.
  35. [CIS - Debian Linux 1.4 - Robust partition scheme - /tmp is not on its own partition] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  36. f:/etc/fstab -> !r:/tmp;
  37. [CIS - Debian Linux 1.4 - Robust partition scheme - /opt is not on its own partition] [all] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  38. f:/opt;
  39. f:/etc/fstab -> !r:/opt;
  40. [CIS - Debian Linux 1.4 - Robust partition scheme - /var is not on its own partition] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  41. f:/etc/fstab -> !r:/var;
  42. # Section 2.3 - SSH configuration
  43. [CIS - Debian Linux 2.3 - SSH Configuration - Protocol version 1 enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  44. f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1;
  45. [CIS - Debian Linux 2.3 - SSH Configuration - IgnoreRHosts disabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  46. f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no;
  47. [CIS - Debian Linux 2.3 - SSH Configuration - Empty passwords permitted] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  48. f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes;
  49. [CIS - Debian Linux 2.3 - SSH Configuration - Host based authentication enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  50. f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes;
  51. [CIS - Debian Linux 2.3 - SSH Configuration - Root login allowed] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  52. f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes;
  53. # Section 2.4 Enable system accounting
  54. [CIS - Debian Linux 2.4 - System Accounting - Sysstat not installed] [all] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  55. f:!/etc/default/sysstat;
  56. f:!/var/log/sysstat;
  57. [CIS - Debian Linux 2.4 - System Accounting - Sysstat not enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  58. f:!/etc/default/sysstat;
  59. f:/etc/default/sysstat -> !r:^# && r:ENABLED="false";
  60. # Section 2.5 Install and run Bastille
  61. [CIS - Debian Linux 2.5 - System harderning - Bastille is not installed] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  62. f:!/etc/Bastille;
  63. # Section 2.6 Ensure sources.list Sanity
  64. [CIS - Debian Linux 2.6 - Sources list sanity - Security updates not enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  65. f:!/etc/apt/sources.list;
  66. f:!/etc/apt/sources.list -> !r:^# && r:http://security.debian|http://security.ubuntu;
  67. # Section 3 - Minimize inetd services
  68. [CIS - Debian Linux 3.3 - Telnet enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  69. f:/etc/inetd.conf -> !r:^# && r:telnet;
  70. [CIS - Debian Linux 3.4 - FTP enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  71. f:/etc/inetd.conf -> !r:^# && r:/ftp;
  72. [CIS - Debian Linux 3.5 - rsh/rlogin/rcp enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  73. f:/etc/inetd.conf -> !r:^# && r:shell|login;
  74. [CIS - Debian Linux 3.6 - tftpd enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  75. f:/etc/inetd.conf -> !r:^# && r:tftp;
  76. [CIS - Debian Linux 3.7 - imap enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  77. f:/etc/inetd.conf -> !r:^# && r:imap;
  78. [CIS - Debian Linux 3.8 - pop3 enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  79. f:/etc/inetd.conf -> !r:^# && r:pop;
  80. [CIS - Debian Linux 3.9 - Ident enabled on inetd] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  81. f:/etc/inetd.conf -> !r:^# && r:ident;
  82. # Section 4 - Minimize boot services
  83. [CIS - Debian Linux 4.1 - Disable inetd - Inetd enabled but no services running] [all] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  84. p:inetd;
  85. f:!/etc/inetd.conf -> !r:^# && r:wait;
  86. [CIS - Debian Linux 4.3 - GUI login enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  87. f:/etc/inittab -> !r:^# && r:id:5;
  88. [CIS - Debian Linux 4.6 - Disable standard boot services - Samba Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  89. f:/etc/init.d/samba;
  90. [CIS - Debian Linux 4.7 - Disable standard boot services - NFS Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  91. f:/etc/init.d/nfs-common;
  92. f:/etc/init.d/nfs-user-server;
  93. f:/etc/init.d/nfs-kernel-server;
  94. [CIS - Debian Linux 4.9 - Disable standard boot services - NIS Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  95. f:/etc/init.d/nis;
  96. [CIS - Debian Linux 4.13 - Disable standard boot services - Web server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  97. f:/etc/init.d/apache;
  98. f:/etc/init.d/apache2;
  99. [CIS - Debian Linux 4.15 - Disable standard boot services - DNS server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  100. f:/etc/init.d/bind;
  101. [CIS - Debian Linux 4.16 - Disable standard boot services - MySQL server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  102. f:/etc/init.d/mysql;
  103. [CIS - Debian Linux 4.16 - Disable standard boot services - PostgreSQL server Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  104. f:/etc/init.d/postgresql;
  105. [CIS - Debian Linux 4.17 - Disable standard boot services - Webmin Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  106. f:/etc/init.d/webmin;
  107. [CIS - Debian Linux 4.18 - Disable standard boot services - Squid Enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  108. f:/etc/init.d/squid;
  109. # Section 5 - Kernel tuning
  110. [CIS - Debian Linux 5.1 - Network parameters - Source routing accepted] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  111. f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1;
  112. [CIS - Debian Linux 5.1 - Network parameters - ICMP broadcasts accepted] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  113. f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0;
  114. [CIS - Debian Linux 5.2 - Network parameters - IP Forwarding enabled] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  115. f:/proc/sys/net/ipv4/ip_forward -> 1;
  116. f:/proc/sys/net/ipv6/ip_forward -> 1;
  117. # Section 7 - Permissions
  118. [CIS - Debian Linux 7.1 - Partition /var without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  119. f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/var && !r:nodev;
  120. [CIS - Debian Linux 7.1 - Partition /tmp without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  121. f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/tmp && !r:nodev;
  122. [CIS - Debian Linux 7.1 - Partition /opt without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  123. f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/opt && !r:nodev;
  124. [CIS - Debian Linux 7.1 - Partition /home without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  125. f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/home && !r:nodev ;
  126. [CIS - Debian Linux 7.2 - Removable partition /media without 'nodev' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  127. f:/etc/fstab -> !r:^# && r:/media && !r:nodev;
  128. [CIS - Debian Linux 7.2 - Removable partition /media without 'nosuid' set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  129. f:/etc/fstab -> !r:^# && r:/media && !r:nosuid;
  130. [CIS - Debian Linux 7.3 - User-mounted removable partition /media] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  131. f:/etc/fstab -> !r:^# && r:/media && r:user;
  132. # Section 8 - Access and authentication
  133. [CIS - Debian Linux 8.8 - LILO Password not set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  134. f:/etc/lilo.conf -> !r:^# && !r:restricted;
  135. f:/etc/lilo.conf -> !r:^# && !r:password=;
  136. [CIS - Debian Linux 8.8 - GRUB Password not set] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  137. f:/boot/grub/menu.lst -> !r:^# && !r:password;
  138. [CIS - Debian Linux 9.2 - Account with empty password present] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  139. f:/etc/shadow -> r:^\w+::;
  140. [CIS - Debian Linux 13.11 - Non-root account with uid 0] [any] [http://www.ossec.net/wiki/index.php/CIS_DebianLinux]
  141. f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:;
  142. # EOF