# # This script is Copyright (C) 2004-2018 and is owned by Tenable, Inc. or an Affiliate thereof. # # This script is released under the Tenable Subscription License and # may not be used from within scripts released under another license # without authorization from Tenable, Inc. # # See the following licenses for details: # # http://static.tenable.com/prod_docs/Nessus_6_SLA_and_Subscription_Agreement.pdf # # @PROFESSIONALFEED@ # $Revision: 1.8 $ # $Date: 2018/08/20 $ # # description : This document implements the security configuration as recommended by the # CIS Red Hat Enterprise Linux 7 Benchmark v2.2.0 # # https://workbench.cisecurity.org/files/1860 # # #CIS CentOS EL7 L1 v2.2.0 # # CIS # CentOS EL7 Server L1 # 2.2.0 # https://workbench.cisecurity.org/files/1860 # #unix,cis,redhat,enterprise,linux,rhel,rhel_7 #LEVEL,CSCv6 # # #GDM_BANNER_MESSAGE #Authorized uses only. All activity may be monitored and reported. #Login message #Message to display prior to graphical login. # # #HOSTS_ALLOW_NETWORK #192.168.0.0/255.255.0.0 #Network list #This comma seperated list of networks will be placed in the hosts.allow file in order to allow access to the target only from these networks. # # #NTP_SERVER #10.0.0.2 #Network Time Server #Host address of the NTP server for the target. # # #SYSLOG_SERVER #10.0.0.2 #Log server #Host address of the sytem log server for the target to send logs to. # # # system : "Linux" type : FILE_CONTENT_CHECK description : "CentOS Linux 7 is installed" file : "/etc/redhat-release" regex : "^[\\s]*CentOS Linux release 7" expect : "^[\\s]*CentOS Linux release 7.*" description : "CIS_CentOS_EL7_Server_L1_v2.2.0.audit from CIS Red Hat Enterprise Linux 7 Benchmark v2.2.0" info : "This audit checks the testable Level 1 guidance in the CIS Red Hat Enterprise Linux 7 Benchmark document." system : "Linux" type : CMD_EXEC description : "1.1.1.1 Ensure mounting of cramfs filesystems is disabled - modprobe" info : "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true Run the following command to unload the cramfs module: # rmmod cramfs" reference : "800-53|CM-7,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80137-3,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/modprobe -n -v cramfs | /usr/bin/awk '{print} END {if (NR == 0) print \"fail\"}'" expect : "install /bin/true" system : "Linux" type : CMD_EXEC description : "1.1.1.1 Ensure mounting of cramfs filesystems is disabled - lsmod" info : "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true Run the following command to unload the cramfs module: # rmmod cramfs" reference : "800-53|CM-7,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80137-3,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/lsmod | /bin/grep cramfs | /bin/awk '{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}'" expect : "pass" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.2 Ensure mounting of freevxfs filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80138-1,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+freevxfs[\\s]" expect : "^[\\s]*install[\\s]+freevxfs[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.3 Ensure mounting of jffs2 filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80139-9,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+jffs2[\\s]" expect : "^[\\s]*install[\\s]+jffs2[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.4 Ensure mounting of hfs filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80140-7,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+hfs[\\s]" expect : "^[\\s]*install[\\s]+hfs[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.5 Ensure mounting of hfsplus filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80141-5,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+hfsplus[\\s]" expect : "^[\\s]*install[\\s]+hfsplus[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.6 Ensure mounting of squashfs filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true Run the following command to unload the squashfs module: # rmmod squashfs" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80142-3,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+squashfs[\\s]" expect : "^[\\s]*install[\\s]+squashfs[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.1.7 Ensure mounting of udf filesystems is disabled" info : "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80143-1,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+udf[\\s]" expect : "^[\\s]*install[\\s]+udf[\\s]+/bin/true[\\s]*$" system : "Linux" type : CMD_EXEC description : "1.1.3 Ensure nodev option set on /tmp partition" info : "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." solution : "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount]Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,nodev /tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80149-8,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /tmp '" expect : "[\\s]*[,]?nodev" system : "Linux" type : CMD_EXEC description : "1.1.4 Ensure nosuid option set on /tmp partition" info : "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." solution : "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount]Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80151-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /tmp '" expect : "[\\s]*[,]?nosuid" system : "Linux" type : CMD_EXEC description : "1.1.5 Ensure noexec option set on /tmp partition" info : "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." solution : "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount]Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,noexec /tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80150-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /tmp '" expect : "[\\s]*[,]?noexec" system : "Linux" type : CMD_EXEC description : "1.1.8 Ensure nodev option set on /var/tmp partition" info : "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." solution : "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /var/tmp '" expect : "[\\s]*[,]?nodev" system : "Linux" type : CMD_EXEC description : "1.1.9 Ensure nosuid option set on /var/tmp partition" info : "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." solution : "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /var/tmp '" expect : "[\\s]*[,]?nosuid" system : "Linux" type : CMD_EXEC description : "1.1.10 Ensure noexec option set on /var/tmp partition" info : "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." solution : "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/mount | /usr/bin/grep 'on /var/tmp '" expect : "[\\s]*[,]?noexec" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.14 Ensure nodev option set on /home partition" info : "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." solution : "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*[^#]*[\\s]+\\/home[\\s]" expect : "^[\\s]*[^#]*[\\s]+\\/home[\\s].*[,]?nodev" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.15 Ensure nodev option set on /dev/shm partition" info : "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." solution : "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80152-2,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s]" expect : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s].*[,]?nodev" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.16 Ensure nosuid option set on /dev/shm partition" info : "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." solution : "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80154-8,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s]" expect : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s].*[,]?nosuid" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.17 Ensure noexec option set on /dev/shm partition" info : "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." solution : "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80153-0,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s]" expect : "^[\\s]*[^#]*[\\s]+\\/dev\\/shm[\\s].*[,]?noexec" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.18 Ensure nodev option set on removable media partitions" info : "Removable media containing character and block special devices could be used to circumvent security controls by allowing non-root users to access sensitive device files such as /dev/kmem or the raw disk partitions." solution : "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s]" expect : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s].*[,]?nodev" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.19 Ensure nosuid option set on removable media partitions" info : "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." solution : "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s]" expect : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s].*[,]?nosuid" system : "Linux" type : FILE_CONTENT_CHECK description : "1.1.20 Ensure noexec option set on removable media partitions" info : "Setting this option on a file system prevents users from executing programs from the removable media. This deters users from being able to introduce potentially malicious software on the system." solution : "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|8,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/fstab" regex : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s]" expect : "^[\\s]*.*[\\s]+/m.*/(floppy|cdrom|corder)[\\s].*[,]?noexec" system : "Linux" type : CMD_EXEC description : "1.1.21 Ensure sticky bit is set on all world-writable directories" info : "Setting the sticky bit on world writable directories prevents users from deleting or renaming files in that directory that are not owned by them. Rationale: This feature prevents the ability to delete or rename files in world writable directories (such as /tmp) that are owned by another user." solution : "Run the following command to set the sticky bit on all world writable directories: # df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -type d -perm -0002 2>/dev/null | xargs chmod a+t" reference : "800-53|AC-3,800-171|3.1.1,800-171|3.1.2,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,CCE|CCE-80130-8,CN-L3|7.1.3.2(b),CN-L3|7.1.3.2(g),LEVEL|1S,PCI-DSSv3.1|7.1.2,PCI-DSSv3.2|7.1.2,SWIFT-CSCv1|5.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/df --local -P | /usr/bin/awk {'if (NR!=1) print $6'} | /usr/bin/xargs -I '{}' /usr/bin/find '{}' -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null | /usr/bin/awk '{print} END {if (NR == 0) print \"none\"}'" expect : "none" system : "Linux" type : CMD_EXEC description : "1.1.22 Disable Automounting" info : "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." solution : "Run the following command to disable autofs: # systemctl disable autofs Impact: The use portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-27498-5,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled autofs | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "1.2.1 Ensure package manager repositories are configured" info : "If a system's package repositories are misconfigured important patches may not be identified or a rogue repository could introduce compromised software. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Configure your package manager repositories according to site policy." reference : "800-53|SI-2,800-171|3.14.1,CSF|ID.RA-1,CSF|PR.IP-12,ITSG-33|SI-2,SWIFT-CSCv1|2.2,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "yum repolist" expect : "" severity : MEDIUM system : "Linux" type : FILE_CONTENT_CHECK description : "1.2.2 Ensure gpgcheck is globally activated" info : "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." solution : "Edit /etc/yum.conf and set 'gpgcheck=1' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to '1'." reference : "800-53|SI-7,CSF|PR.DS-6,SWIFT-CSCv1|6.2,CCE|CCE-26989-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/yum.conf" regex : "^[\\s]*gpgcheck[\\s]*=" expect : "^[\\s]*gpgcheck[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "1.2.3 Ensure GPG keys are configured" info : "It is important to ensure that updates are obtained from a valid source to protect against spoofing that could lead to the inadvertent installation of malware on the system." solution : "Update your package manager GPG keys in accordance with site policy." reference : "800-53|SI-7,CSF|PR.DS-6,SWIFT-CSCv1|6.2,CCE|CCE-26957-1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/rpm -q --queryformat \"%{SUMMARY}\\n\" gpg-pubkey" expect : "gpg\\(Red\\s+Hat,\\s+Inc\\.\\s+\\(release\\s+key\\s*.*\\)\\s+\\[\\)]?" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "1.2.4 Ensure Red Hat Subscription Manager connection is configured" info : "Systems need to be registered with the Red Hat Subscription Manager (RHSM) to receive patch updates. This is usually configured during initial installation. Rationale: It is important to register with the Red Hat Subscription Manager to make sure that patches are updated on a regular basis. This helps to reduce the exposure time as new vulnerabilities are discovered. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Run the following command to connect to the Red Hat Subscription Manager: # subscription-manager register" reference : "800-53|SI-2,800-171|3.14.1,CSF|ID.RA-1,CSF|PR.IP-12,ITSG-33|SI-2,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/subscription-manager identity" expect : "" severity : MEDIUM system : "Linux" type : RPM_CHECK description : "1.3.1 Ensure AIDE is installed" info : "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." solution : "Run the following command to install aide: # yum install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aide --init# mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" reference : "800-53|CM-7,PCI-DSSv3.1|12.3.7,PCI-DSSv3.2|12.3.7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.5.1,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27096-7,CSCv6|2.2,HIPAA|164.308(a)(5)(ii)(B),ITSG-33|SI-2,LEVEL|1S,PCI-DSS|10.5.5,PCI-DSS|11.4,PCI-DSS|5.1" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "aide-0.0.0-0" operator : "gt" required : YES system : "Linux" type : CMD_EXEC description : "1.3.2 Ensure filesystem integrity is regularly checked - crontab" cmd : "/usr/bin/crontab -u root -l | /usr/bin/grep aide" expect : "^((\\d{1,2}|\\*)[\\s]+){5}\\/usr\\/sbin\\/aide[\\s]+--check[\\s]+(.*)$" system : "Linux" type : CMD_EXEC description : "1.3.2 Ensure filesystem integrity is regularly checked - /etc/cron.*" cmd : "/usr/bin/grep -r aide /etc/cron.* /etc/crontab" expect : "^((\\d{1,2}|\\*)[\\s]+){5}\\/usr\\/sbin\\/aide[\\s]+--check[\\s]+(.*)$" description : "1.3.2 Ensure filesystem integrity is regularly checked" info : "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem. Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." solution : "Run the following command- # crontab -u root -e Add the following line to the crontab- 0 5 * * * /usr/sbin/aide --check" reference : "800-53|SI-7,CN-L3|7.1.3.5(b),CSCv6|3.5,CSF|PR.DS-6,ITSG-33|SI-7,LEVEL|1S,SWIFT-CSCv1|6.2" see_also : "https://workbench.cisecurity.org/files/1860" description : "1.3.2 Ensure filesystem integrity is regularly checked" info : "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem. Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." solution : "Run the following command- # crontab -u root -e Add the following line to the crontab- 0 5 * * * /usr/sbin/aide --check" reference : "800-53|SI-7,CN-L3|7.1.3.5(b),CSCv6|3.5,CSF|PR.DS-6,ITSG-33|SI-7,LEVEL|1S,SWIFT-CSCv1|6.2" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : FILE_CHECK_NOT description : "Check that /sys/firmware/efi does not exist" file : "/sys/firmware/efi" system : "Linux" type : FILE_CHECK description : "1.4.1 Ensure permissions on bootloader config are configured - grub.cfg" info : "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg. Additional settings can be found in the /boot/grub2/user.cfg file. Rationale: Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." solution : "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" reference : "800-53|SI-7,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.DS-6,CCE|CCE-26812-8,CCE|CCE-26860-7,CCE|CCE-27054-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/grub2/grub.cfg" owner : "root" mask : "177" group : "root" system : "Linux" type : FILE_CHECK description : "1.4.1 Ensure permissions on bootloader config are configured - user.cfg" info : "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg. Additional settings can be found in the /boot/grub2/user.cfg file. Rationale: Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." solution : "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" reference : "800-53|SI-7,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.DS-6,CCE|CCE-26812-8,CCE|CCE-26860-7,CCE|CCE-27054-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/grub2/user.cfg" owner : "root" mask : "177" group : "root" system : "Linux" type : FILE_CONTENT_CHECK description : "1.4.2 Ensure bootloader password is set" info : "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters Rationale: Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." solution : "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password:" reference : "800-53|SI-7,CSF|PR.DS-6,CCE|CCE-27309-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/grub2/user.cfg" regex : "^[\\s]*GRUB2_PASSWORD" expect : "^[\\s]*GRUB2_PASSWORD[\\s]*=[^\\s]+$" system : "Linux" type : FILE_CHECK description : "1.4.1 Ensure permissions on bootloader config are configured - grub.cfg" info : "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg. Additional settings can be found in the /boot/grub2/user.cfg file. Rationale: Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." solution : "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" reference : "800-53|SI-7,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.DS-6,CCE|CCE-26812-8,CCE|CCE-26860-7,CCE|CCE-27054-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/efi/EFI/redhat/grub.cfg" owner : "root" mask : "177" group : "root" system : "Linux" type : FILE_CHECK description : "1.4.1 Ensure permissions on bootloader config are configured - user.cfg" info : "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg. Additional settings can be found in the /boot/grub2/user.cfg file. Rationale: Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." solution : "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" reference : "800-53|SI-7,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.DS-6,CCE|CCE-26812-8,CCE|CCE-26860-7,CCE|CCE-27054-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/efi/EFI/redhat/user.cfg" owner : "root" mask : "177" group : "root" system : "Linux" type : FILE_CONTENT_CHECK description : "1.4.2 Ensure bootloader password is set" info : "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters Rationale: Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." solution : "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password:" reference : "800-53|SI-7,CSF|PR.DS-6,CCE|CCE-27309-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/efi/EFI/redhat/user.cfg" regex : "^[\\s]*GRUB2_PASSWORD" expect : "^[\\s]*GRUB2_PASSWORD[\\s]*=[^\\s]+$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.4.3 Ensure authentication required for single user mode - rescue.service" info : "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader. Rationale: Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." solution : "Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c '/sbin/sulogin; /usr/bin/systemctl --fail --no-block default'" reference : "800-53|SI-7,CSF|PR.DS-6,CCE|CCE-27287-2,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/usr/lib/systemd/system/rescue.service" regex : "^ExecStart=-/bin/sh -c \"(/usr|)/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\"" expect : "^ExecStart=-/bin/sh -c \"(/usr|)/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\"" system : "Linux" type : FILE_CONTENT_CHECK description : "1.4.3 Ensure authentication required for single user mode - emergency.service" info : "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader. Rationale: Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." solution : "Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c '/sbin/sulogin; /usr/bin/systemctl --fail --no-block default'" reference : "800-53|SI-7,CSF|PR.DS-6,CCE|CCE-27287-2,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/usr/lib/systemd/system/emergency.service" regex : "^ExecStart=-/bin/sh -c \"(/usr|)/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\"" expect : "^ExecStart=-/bin/sh -c \"(/usr|)/sbin/sulogin; /usr/bin/systemctl --fail --no-block default\"" system : "Linux" type : CMD_EXEC description : "1.5.1 Ensure core dumps are restricted - limits.conf limits.d" info : "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user. Rationale: Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see `limits.conf(5)` ). In addition, setting the `fs.suid_dumpable` variable to 0 will prevent setuid programs from dumping core." solution : "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80169-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/grep -s -E '^[[:space:]]*\\*[[:space:]]+hard[[:space:]]+core[[:space:]]+0[[:space:]]*$' /etc/security/limits.conf /etc/security/limits.d/* |/usr/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "1.5.1 Ensure core dumps are restricted - sysctl" info : "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user. Rationale: Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see `limits.conf(5)` ). In addition, setting the `fs.suid_dumpable` variable to 0 will prevent setuid programs from dumping core." solution : "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80169-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl fs.suid_dumpable" expect : "^[\\s]*fs\\.suid_dumpable[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "1.5.1 Ensure core dumps are restricted - sysctl.conf sysctl.d" info : "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user. Rationale: Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see `limits.conf(5)` ). In addition, setting the `fs.suid_dumpable` variable to 0 will prevent setuid programs from dumping core." solution : "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,CCE|CCE-80169-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*fs\\.suid_dumpable[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "1.5.2 Ensure XD/NX support is enabled" info : "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." solution : "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." reference : "800-53|SI-16,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/dmesg | /bin/grep 'NX (Execute' 2>&1" expect : "NX[\\s]+\\(Execute[\\s]+Disable\\)[\\s]+protection:[\\s]+active" system : "Linux" type : CMD_EXEC description : "1.5.3 Ensure address space layout randomization (ASLR) is enabled - sysctl" info : "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process. Rationale: Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" reference : "PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,800-53|CM-6,CCE|CCE-27099-1,CSCv6|3.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl kernel.randomize_va_space" expect : "^[\\s]*kernel\\.randomize_va_space[\\s]*=[\\s]*2[\\s]*$" system : "Linux" type : CMD_EXEC description : "1.5.3 Ensure address space layout randomization (ASLR) is enabled - sysctl.conf sysctl.d" info : "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process. Rationale: Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" reference : "800-53|SI-16,800-171|3.4.2,CCE|CCE-27099-1,CSCv6|3.1,CSF|PR.IP-1,ITSG-33|SC-30,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*kernel\\.randomize_va_space[[:space:]]*=[[:space:]]*2[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" dont_echo_cmd : YES system : "Linux" type : RPM_CHECK description : "1.5.4 Ensure prelink is disabled" info : "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." solution : "Run the following commands to restore binaries to normal and uninstall prelink: # prelink -ua# yum remove prelink" reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27078-5,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "prelink-0.0.0-0" operator : "lt" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "1.7.1.1 Ensure message of the day is configured properly" info : "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the 'uname -a' command once they have logged in." solution : "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v." reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/motd" regex : "\\\\[mrsv]" expect : "\\\\[mrsv]" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "1.7.1.2 Ensure local login warning banner is configured properly" info : "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the 'uname -a' command once they have logged in." solution : "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo 'Authorized uses only. All activity may be monitored and reported.' > /etc/issue" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/issue" regex : "\\\\[mrsv]" expect : "\\\\[mrsv]" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "1.7.1.3 Ensure remote login warning banner is configured properly" info : "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the 'uname -a' command once they have logged in." solution : "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \m, \r, \s, or \v: # echo 'Authorized uses only. All activity may be monitored and reported.' > /etc/issue.net" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-27303-7,CSCv6|3.1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/issue.net" regex : "\\\\[mrsv]" expect : "\\\\[mrsv]" system : "Linux" type : FILE_CHECK description : "1.7.1.4 Ensure permissions on /etc/motd are configured" info : "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." solution : "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd# chmod 644 /etc/motd" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/motd" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "1.7.1.5 Ensure permissions on /etc/issue are configured" info : "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." solution : "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue# chmod 644 /etc/issue" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/issue" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "1.7.1.6 Ensure permissions on /etc/issue.net are configured" info : "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." solution : "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net# chmod 644 /etc/issue.net" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/issue.net" owner : "root" mask : "133" group : "root" system : "Linux" type : RPM_CHECK description : "Check GDM installed" rpm : "gdm-0.0.0-0" operator : "gt" required : YES system : "Linux" type : FILE_CONTENT_CHECK description : "1.7.2 Ensure GDM login banner is configured - user-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." solution : "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-26970-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/dconf/profile/gdm" regex : "^[\\s]*user-db[\\s]*:" expect : "^[\\s]*user-db[\\s]*:[\\s]*user[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.7.2 Ensure GDM login banner is configured - system-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." solution : "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-26970-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/dconf/profile/gdm" regex : "^[\\s]*system-db[\\s]*:" expect : "^[\\s]*system-db[\\s]*:[\\s]*gdm[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.7.2 Ensure GDM login banner is configured - file-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." solution : "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-26970-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/dconf/profile/gdm" regex : "^[\\s]*file-db[\\s]*:" expect : "^[\\s]*file-db[\\s]*:[\\s]*/usr/share/gdm/greeter-dconf-defaults[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.7.2 Ensure GDM login banner is configured - banner message enabled" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." solution : "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-26970-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/dconf/db/gdm.d/*" regex : "^[\\s]*banner-message-enable[\\s]*=" expect : "^[\\s]*banner-message-enable[\\s]*=[\\s]*true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "1.7.2 Ensure GDM login banner is configured - banner message text" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." solution : "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-26892-0,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/dconf/db/gdm.d/*" regex : "^[\\s]*banner-message-text[\\s]*=" # Note: Variable @GDM_BANNER_MESSAGE@ replaced with "Authorized uses only. All activity may be monitored and reported." in field "expect". expect : "^[\\s]*banner-message-text[\\s]*=[\\s]*.Authorized uses only. All activity may be monitored and reported..[\\s]*$" description : "1.7.2 Ensure GDM login banner is configured - user-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. NOTE: gdm is not installed on the target." reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "1.7.2 Ensure GDM login banner is configured - system-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. NOTE: gdm is not installed on the target." reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "1.7.2 Ensure GDM login banner is configured - file-db" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. NOTE: gdm is not installed on the target." reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "1.7.2 Ensure GDM login banner is configured - banner message enabled" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. NOTE: gdm is not installed on the target." reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "1.7.2 Ensure GDM login banner is configured - banner message text" info : "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. Rationale: Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. NOTE: gdm is not installed on the target." reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : CMD_EXEC description : "1.8 Ensure updates, patches, and additional security software are installed" info : "Periodically patches are released for included software either due to security flaws or to include additional functionality. Rationale: Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Use your package manager to update all packages on the system according to site policy. The following command will install all available security updates: # yum update --security" reference : "800-53|SI-2,800-171|3.14.1,CSF|ID.RA-1,CSF|PR.IP-12,ITSG-33|SI-2,CCE|CCE-26895-3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/yum check-update --security" expect : "" severity : MEDIUM system : "Linux" type : XINETD_SVC description : "2.1.1 Ensure chargen services are not enabled - chargen-stream" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off# chkconfig chargen-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "chargen-stream" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.1 Ensure chargen services are not enabled - chargen-dgram" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off# chkconfig chargen-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "chargen-dgram" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.2 Ensure daytime services are not enabled - daytime-stream" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off# chkconfig daytime-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "daytime-stream" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.2 Ensure daytime services are not enabled - daytime-dgram" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off# chkconfig daytime-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "daytime-dgram" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.3 Ensure discard services are not enabled - discard-stream" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off# chkconfig discard-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "discard-stream" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.3 Ensure discard services are not enabled - discard-dgram" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off# chkconfig discard-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "discard-dgram" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.4 Ensure echo services are not enabled - echo-stream" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off# chkconfig echo-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "echo-stream" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.4 Ensure echo services are not enabled - echo-dgram" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off# chkconfig echo-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "echo-dgram" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.5 Ensure time services are not enabled - time-stream" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off# chkconfig time-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "time-stream" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.5 Ensure time services are not enabled - time-dgram" info : "Disabling this service will reduce the remote attack surface of the system." solution : "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off# chkconfig time-stream off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "time-dgram" status : OFF system : "Linux" type : XINETD_SVC description : "2.1.6 Ensure tftp server is not enabled" info : "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server. Rationale: TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." solution : "Run the following command to disable tftp: # chkconfig tftp off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "tftp" status : OFF system : "Linux" type : CMD_EXEC description : "2.1.7 Ensure xinetd is not enabled" info : "If there are no xinetd services required, it is recommended that the daemon be disabled." solution : "Run the following command to disable xinetd : # systemctl disable xinetd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-27443-1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled xinetd | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "disabled" system : "Linux" type : RPM_CHECK description : "Check NTP installed" rpm : "ntp-0.0.0-0" operator : "gt" required : YES system : "Linux" type : RPM_CHECK description : "Check chrony installed" rpm : "chrony-0.0.0-0" operator : "gt" required : YES description : "2.2.1.1 Ensure time synchronization is in use" info : "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." solution : "On physical systems or virtual systems where host based time synchronization is not available run one of the following commands to install either ntp or chrony: # yum install ntp# yum install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." reference : "CCE|CCE-27444-9,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.1 Ensure time synchronization is in use" info : "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." solution : "On physical systems or virtual systems where host based time synchronization is not available run one of the following commands to install either ntp or chrony: # yum install ntp# yum install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." reference : "CCE|CCE-27444-9,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : RPM_CHECK description : "Check NTP installed" rpm : "ntp-0.0.0-0" operator : "gt" required : YES system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.2 Ensure ntp is configured - restrict -4" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ntp.conf" regex : "^[\\s]*restrict[\\s]+-4[\\s][^:]" expect : "^[\\s]*restrict[\\s]+-4[\\s]+default[\\s]+kod[\\s]+nomodify[\\s]+notrap[\\s]+nopeer[\\s]+noquery[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.2 Ensure ntp is configured - restrict -6" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S,PCI-DSS|10.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ntp.conf" regex : "^[\\s]*restrict[\\s]+-6[\\s][^:]" expect : "^[\\s]*restrict[\\s]+-6[\\s]+default[\\s]+kod[\\s]+nomodify[\\s]+notrap[\\s]+nopeer[\\s]+noquery[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.2 Ensure ntp is configured - NTP Server" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-53|AU-8,PCI-DSSv3.1|10.4,PCI-DSSv3.2|10.4,800-171|3.3.7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,CCE|CCE-27278-1,CSCv6|6.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ntp.conf" # Note: Variable @NTP_SERVER@ replaced with "10.0.0.2" in field "regex". regex : "^[\\s]*server[\\s]+10.0.0.2" # Note: Variable @NTP_SERVER@ replaced with "10.0.0.2" in field "expect". expect : "^[\\s]*server[\\s]+10.0.0.2" system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.2 Ensure ntp is configured - OPTIONS" file : "/etc/sysconfig/ntpd" regex : "^OPTIONS=" expect : "-u[\\s]+ntp:ntp" system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.2 Ensure ntp is configured - ExecStart" file : "/usr/lib/systemd/system/ntpd.service" regex : "^ExecStart=" expect : "-u[\\s]+ntp:ntp" description : "2.2.1.2 Ensure ntp is configured - -u ntp:ntp" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.2 Ensure ntp is configured - -u ntp:ntp" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.2 Ensure ntp is configured - restrict -4" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.2 Ensure ntp is configured - restrict -6" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,PCI-DSS|10.4" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.2 Ensure ntp is configured - NTP Server" info : "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at [http://www.ntp.org](http://www.ntp.org/). ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system. Rationale: If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': OPTIONS='-u ntp:ntp'" reference : "800-171|3.3.7,800-53|AU-8,CCE|CCE-27278-1,CSCv6|6.1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,LEVEL|1S,PCI-DSSv3.1|10.4,PCI-DSSv3.2|10.4" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : RPM_CHECK description : "Check chrony installed" rpm : "chrony-0.0.0-0" operator : "gt" required : YES system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.3 Ensure chrony is configured - NTP server" info : "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at . chrony can be configured to be a client and/or a server. Rationale: If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." solution : "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony': OPTIONS='-u chrony'" reference : "800-53|AU-8,800-171|3.3.7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,CCE|CCE-27278-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/chrony.conf" # Note: Variable @NTP_SERVER@ replaced with "10.0.0.2" in field "regex". regex : "^[\\s]*(server|pool)[\\s]+10.0.0.2" # Note: Variable @NTP_SERVER@ replaced with "10.0.0.2" in field "expect". expect : "^[\\s]*(server|pool)[\\s]+10.0.0.2" system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.1.3 Ensure chrony is configured - OPTIONS" info : "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at . chrony can be configured to be a client and/or a server. Rationale: If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." solution : "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony': OPTIONS='-u chrony'" reference : "800-53|CM-6,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/sysconfig/chronyd" regex : "^OPTIONS=" expect : "-u[\\s]+chrony" description : "2.2.1.3 Ensure chrony is configured - NTP server" info : "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at . chrony can be configured to be a client and/or a server. Rationale: If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony': OPTIONS='-u chrony'" reference : "800-171|3.3.7,800-53|AU-8,CCE|CCE-27278-1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "2.2.1.3 Ensure chrony is configured - OPTIONS" info : "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at . chrony can be configured to be a client and/or a server. Rationale: If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony': OPTIONS='-u chrony'" reference : "800-171|3.4.2,800-53|CM-6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : RPM_CHECK description : "2.2.2 Ensure X Window System is not installed" info : "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." solution : "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27218-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "xorg-x11-server-common-0.0.0-0" operator : "lt" required : NO system : "Linux" type : CMD_EXEC description : "2.2.3 Ensure Avahi Server is not enabled" info : "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." solution : "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80338-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled avahi-daemon | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.4 Ensure CUPS is not enabled" info : "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." solution : "Run the following command to disable cups: # systemctl disable cups Impact: Disabling CUPS will prevent printing from the system, a common task for workstation systems." reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80282-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled cups | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.5 Ensure DHCP Server is not enabled" info : "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." solution : "Run the following command to disable dhcpd: # systemctl disable dhcpd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80330-4,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled dhcpd | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.6 Ensure LDAP server is not enabled" info : "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." solution : "Run the following command to disable slapd: # systemctl disable slapd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled slapd | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.7 Ensure NFS and RPC are not enabled - nfs" info : "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network. Rationale: If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." solution : "Run the following commands to disable nfs, nfs-server and rpcbind: # systemctl disable nfs # systemctl disable nfs-server # systemctl disable rpcbind" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80237-1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled nfs | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.7 Ensure NFS and RPC are not enabled - nfs-server" info : "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network. Rationale: If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." solution : "Run the following commands to disable nfs, nfs-server and rpcbind: # systemctl disable nfs # systemctl disable nfs-server # systemctl disable rpcbind" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80237-1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled nfs-server | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.7 Ensure NFS and RPC are not enabled - rpcbind" info : "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network. Rationale: If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." solution : "Run the following commands to disable nfs, nfs-server and rpcbind: # systemctl disable nfs # systemctl disable nfs-server # systemctl disable rpcbind" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80230-6,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled rpcbind | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "(disabled|indirect)" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.8 Ensure DNS Server is not enabled" info : "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." solution : "Run the following command to disable named: # systemctl disable named" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80325-4,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled named | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.9 Ensure FTP Server is not enabled" info : "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." solution : "Run the following command to disable vsftpd: # systemctl disable vsftpd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80244-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled vsftpd | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.10 Ensure HTTP server is not enabled" info : "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." solution : "Run the following command to disable httpd: # systemctl disable httpd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80300-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled httpd | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.11 Ensure IMAP and POP3 server is not enabled" info : "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." solution : "Run the following command to disable dovecot: # systemctl disable dovecot" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80294-2,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled dovecot | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.12 Ensure Samba is not enabled" info : "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." solution : "Run the following command to disable smb: # systemctl disable smb" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80277-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled smb | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.13 Ensure HTTP Proxy Server is not enabled" info : "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." solution : "Run the following command to disable squid: # systemctl disable squid" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80285-0,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled squid | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "2.2.14 Ensure SNMP Server is not enabled" info : "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system. Rationale: The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." solution : "Run the following command to disable snmpd: # systemctl disable snmpd" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80274-4,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled snmpd | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : FILE_CONTENT_CHECK description : "2.2.15 Ensure mail transfer agent is configured for local-only mode" info : "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail. Rationale: The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." solution : "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # systemctl restart postfix" reference : "800-53|CM-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80289-2,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/postfix/main.cf" regex : "^[\\s]*inet_interfaces[\\s]*=[\\s]" expect : "^[\\s]*inet_interfaces[\\s]*=[\\s]*loopback-only[\\s]*$" system : "Linux" type : CMD_EXEC description : "2.2.16 Ensure NIS Server is not enabled" info : "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" solution : "Run the following command to disable ypserv: # systemctl disable ypserv" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled ypserv | /usr/bin/awk '{print} END { if(NR==0) print \"disabled\" }'" expect : "disabled" dont_echo_cmd : YES system : "Linux" type : XINETD_SVC description : "2.2.17 Ensure rsh server is not enabled - rexec" info : "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." solution : "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rexec off# chkconfig rlogin off# chkconfig rsh off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27408-4,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "rexec" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.17 Ensure rsh server is not enabled - rlogin" info : "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." solution : "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rexec off# chkconfig rlogin off# chkconfig rsh off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27336-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "rlogin" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.17 Ensure rsh server is not enabled - rsh" info : "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." solution : "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rexec off# chkconfig rlogin off# chkconfig rsh off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27337-5,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "rsh" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.18 Ensure talk server is not enabled" info : "The software presents a security risk as it uses unencrypted protocols for communication." solution : "Run the following command to disable talk : # chkconfig talk off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "talk" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.19 Ensure telnet server is not enabled" info : "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." solution : "Run the following command to disable telnet : # chkconfig telnet off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27401-9,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "telnet" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.20 Ensure tftp server is not enabled" info : "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." solution : "Run the following command to disable tftp : # chkconfig tftp off" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80212-4,CSCv6|9.1,LEVEL|1S,PCI-DSS|2.2.2" see_also : "https://workbench.cisecurity.org/files/1860" service : "tftp" status : OFF system : "Linux" type : XINETD_SVC description : "2.2.21 Ensure rsync service is not enabled" info : "The rsyncd service can be used to synchronize files between systems over network links. Rationale: The rsyncd service presents a security risk as it uses unencrypted protocols for communication." solution : "Run the following command to disable rsync: # systemctl disable rsyncd" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" service : "rsync" status : OFF system : "Linux" type : RPM_CHECK description : "2.3.1 Ensure NIS Client is not installed" info : "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." solution : "Run the following command to uninstall ypbind: # yum remove ypbind Impact: Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27385-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "ypbind-0.0.0-0" operator : "lt" required : NO system : "Linux" type : RPM_CHECK description : "2.3.2 Ensure rsh client is not installed" info : "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin." solution : "Run the following command to uninstall rsh: # yum remove rsh Impact: Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "rsh-0.0.0-0" operator : "lt" required : NO system : "Linux" type : RPM_CHECK description : "2.3.3 Ensure talk client is not installed" info : "The software presents a security risk as it uses unencrypted protocols for communication." solution : "Run the following command to uninstall talk: # yum remove talk Impact: Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27432-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "talk-0.0.0-0" operator : "lt" required : NO system : "Linux" type : RPM_CHECK description : "2.3.4 Ensure telnet client is not installed" info : "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." solution : "Run the following command to uninstall telnet: # yum remove telnet Impact: Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "telnet-0.0.0-0" operator : "lt" required : NO system : "Linux" type : RPM_CHECK description : "2.3.5 Ensure LDAP client is not installed" info : "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." solution : "Run the following command to uninstall openldap-clients: # yum remove openldap-clients Impact: Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." reference : "800-53|CM-7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "openldap-clients-0.0.0-0" operator : "lt" required : NO system : "Linux" type : CMD_EXEC description : "3.1.1 Ensure IP forwarding is disabled - sysctl" info : "The `net.ipv4.ip_forward` flag is used to tell the system whether it can forward packets or not. Rationale: Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|11,CSCv6|3,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.ip_forward" expect : "^[\\s]*net\\.ipv4\\.ip_forward[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.1.1 Ensure IP forwarding is disabled - sysctlc.conf sysctl.d" info : "The `net.ipv4.ip_forward` flag is used to tell the system whether it can forward packets or not. Rationale: Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CSCv6|11,CSCv6|3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.ip_forward[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.1.2 Ensure packet redirect sending is disabled - 'net.ipv4.conf.all.send_redirects = 0'" info : "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects. Rationale: An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80156-3,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.send_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.send_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.1.2 Ensure packet redirect sending is disabled - 'net.ipv4.conf.default.send_redirects = 0'" info : "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects. Rationale: An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80156-3,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.send_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.send_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.1.2 Ensure packet redirect sending is disabled - files 'net.ipv4.conf.all.send_redirects = 0'" info : "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects. Rationale: An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80156-3,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.send_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.1.2 Ensure packet redirect sending is disabled - files 'net.ipv4.conf.default.send_redirects = 0'" info : "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects. Rationale: An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80156-3,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.send_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.1 Ensure source routed packets are not accepted - 'net.ipv4.conf.default.accept_source_route = 0'" info : "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used. Rationale: Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80162-1,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.accept_source_route" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.accept_source_route[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.1 Ensure source routed packets are not accepted - 'net.ipv4.conf.all.accept_source_route = 0'" info : "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used. Rationale: Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27434-0,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.accept_source_route" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.accept_source_route[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.1 Ensure source routed packets are not accepted - files 'net.ipv4.conf.default.accept_source_route = 0'" info : "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used. Rationale: Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80162-1,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.1 Ensure source routed packets are not accepted - files 'net.ipv4.conf.all.accept_source_route = 0'" info : "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used. Rationale: Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27434-0,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.2 Ensure ICMP redirects are not accepted - 'net.ipv4.conf.all.accept_redirects = 0'" info : "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables. Rationale: Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80158-9,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.accept_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.accept_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.2 Ensure ICMP redirects are not accepted - 'net.ipv4.conf.default.accept_redirects = 0'" info : "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables. Rationale: Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80163-9,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.accept_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.accept_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.2 Ensure ICMP redirects are not accepted - files 'net.ipv4.conf.all.accept_redirects = 0'" info : "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables. Rationale: Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80158-9,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.2 Ensure ICMP redirects are not accepted - files 'net.ipv4.conf.default.accept_redirects = 0'" info : "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables. Rationale: Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80163-9,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.3 Ensure secure ICMP redirects are not accepted - 'net.ipv4.conf.default.secure_redirects = 0'" info : "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure. Rationale: It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80164-7,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.secure_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.secure_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.3 Ensure secure ICMP redirects are not accepted - 'net.ipv4.conf.all.secure_redirects = 0'" info : "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure. Rationale: It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80159-7,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.secure_redirects" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.secure_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.3 Ensure secure ICMP redirects are not accepted - files 'net.ipv4.conf.default.secure_redirects = 0'" info : "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure. Rationale: It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80164-7,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.secure_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.3 Ensure secure ICMP redirects are not accepted - files 'net.ipv4.conf.all.secure_redirects = 0'" info : "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure. Rationale: It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80159-7,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.secure_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.4 Ensure suspicious packets are logged - 'net.ipv4.conf.all.log_martians = 1'" info : "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CCE|CCE-80160-5,LEVEL|1S,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.log_martians" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.log_martians[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.4 Ensure suspicious packets are logged - 'net.ipv4.conf.default.log_martians = 1'" info : "When enabled, this feature logs packets with un-routable source addresses to the kernel log. Rationale: Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CCE|CCE-80161-3,LEVEL|1S,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.log_martians" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.log_martians[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.4 Ensure suspicious packets are logged - files 'net.ipv4.conf.all.log_martians = 1'" info : "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CCE|CCE-80160-5,LEVEL|1S,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.log_martians[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.4 Ensure suspicious packets are logged - files 'net.ipv4.conf.default.log_martians = 1'" info : "When enabled, this feature logs packets with un-routable source addresses to the kernel log. Rationale: Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CCE|CCE-80161-3,LEVEL|1S,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.log_martians[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.5 Ensure broadcast ICMP requests are ignored - sysctl" info : "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses. Rationale: Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80165-4,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts" expect : "^[\\s]*net\\.ipv4\\.icmp_echo_ignore_broadcasts[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.5 Ensure broadcast ICMP requests are ignored - sysctl.conf sysctl.d" info : "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses. Rationale: Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80165-4,CSF|PR.PT-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.icmp_echo_ignore_broadcasts[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.6 Ensure bogus ICMP responses are ignored - sysctl" info : "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages. Rationale: Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80166-2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses" expect : "^[\\s]*net\\.ipv4\\.icmp_ignore_bogus_error_responses[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.6 Ensure bogus ICMP responses are ignored - sysctl.conf sysctl.d" info : "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages. Rationale: Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80166-2,CSF|PR.PT-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.icmp_ignore_bogus_error_responses[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.7 Ensure Reverse Path Filtering is enabled - 'net.ipv4.conf.default.rp_filter = 1'" info : "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set). Rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80168-8,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.default.rp_filter" expect : "^[\\s]*net\\.ipv4\\.conf\\.default\\.rp_filter[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.7 Ensure Reverse Path Filtering is enabled - 'net.ipv4.conf.all.rp_filter = 1'" info : "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set). Rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80167-0,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.conf.all.rp_filter" expect : "^[\\s]*net\\.ipv4\\.conf\\.all\\.rp_filter[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.7 Ensure Reverse Path Filtering is enabled - files 'net.ipv4.conf.default.rp_filter = 1'" info : "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set). Rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80168-8,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.rp_filter[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.7 Ensure Reverse Path Filtering is enabled - files 'net.ipv4.conf.all.rp_filter = 1'" info : "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set). Rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80167-0,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.rp_filter[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.2.8 Ensure TCP SYN Cookies is enabled - sysctl" info : "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue. Rationale: Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27495-1,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv4.tcp_syncookies" expect : "^[\\s]*net\\.ipv4\\.tcp_syncookies[\\s]*=[\\s]*1[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.2.8 Ensure TCP SYN Cookies is enabled - sysctl.conf sysctl.d" info : "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue. Rationale: Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." solution : "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27495-1,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.tcp_syncookies[[:space:]]*=[[:space:]]*1[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.3.1 Ensure IPv6 router advertisements are not accepted - 'net.ipv6.conf.all.accept_ra = 0'" info : "This setting disables the system's ability to accept IPv6 router advertisements. Rationale: It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80180-3,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv6.conf.all.accept_ra" expect : "^[\\s]*net\\.ipv6\\.conf\\.all\\.accept_ra[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.3.1 Ensure IPv6 router advertisements are not accepted - 'net.ipv6.conf.default.accept_ra = 0'" info : "This setting disables the system's ability to accept IPv6 router advertisements. Rationale: It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80181-1,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|9.2,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv6.conf.default.accept_ra" expect : "^[\\s]*net\\.ipv6\\.conf\\.default\\.accept_ra[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.3.1 Ensure IPv6 router advertisements are not accepted - files 'net.ipv6.conf.all.accept_ra = 0'" info : "This setting disables the system's ability to accept IPv6 router advertisements. Rationale: It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80181-1,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.all\\.accept_ra[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.3.1 Ensure IPv6 router advertisements are not accepted - files 'net.ipv6.conf.default.accept_ra = 0'" info : "This setting disables the system's ability to accept IPv6 router advertisements. Rationale: It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80181-1,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.default\\.accept_ra[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.3.2 Ensure IPv6 redirects are not accepted - 'net.ipv6.conf.default.accept_redirects = 0'" info : "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic. Rationale: It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80183-7,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv6.conf.default.accept_redirects" expect : "^[\\s]*net\\.ipv6\\.conf\\.default\\.accept_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.3.2 Ensure IPv6 redirects are not accepted - 'net.ipv6.conf.all.accept_redirects = 0'" info : "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic. Rationale: It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80182-9,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/sysctl net.ipv6.conf.all.accept_redirects" expect : "^[\\s]*net\\.ipv6\\.conf\\.all\\.accept_redirects[\\s]*=[\\s]*0[\\s]*$" system : "Linux" type : CMD_EXEC description : "3.3.2 Ensure IPv6 redirects are not accepted - files 'net.ipv6.conf.default.accept_redirects = 0'" info : "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic. Rationale: It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80183-7,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.default\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : CMD_EXEC description : "3.3.2 Ensure IPv6 redirects are not accepted - files 'net.ipv6.conf.all.accept_redirects = 0'" info : "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic. Rationale: It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." solution : "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-80182-9,CSCv6|9.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.all\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* |/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'" expect : "^pass$" system : "Linux" type : FILE_CONTENT_CHECK description : "3.3.3 Ensure IPv6 is disabled" info : "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6. Rationale: If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." solution : "Edit /etc/default/grub and remove add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX='ipv6.disable=1' Run the following command to update the grub2 configuration: # grub2-mkconfig > /boot/grub2/grub.cfg" reference : "800-53|SI-7,CSF|PR.DS-6,800-171|3.13.1,800-171|3.4.6,800-171|3.4.7,CCE|CCE-80176-1,CIP|007-6-R1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSCv6|9.2,ITSG-33|CM-7,ITSG-33|SC-7,LEVEL|1NS,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3" see_also : "https://workbench.cisecurity.org/files/1860" file : "/boot/grub2/grub.cfg" regex : "^[\\s]*linux.*vmlinuz" expect : "^[\\s]*linux.*vmlinuz.*ipv6.disable=1" system : "Linux" type : RPM_CHECK description : "3.4.1 Ensure TCP Wrappers is installed" info : "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." solution : "Run the following command to install tcp_wrappers: # yum install tcp_wrappers" reference : "800-53|CM-7,PCI-DSSv3.1|12.3.7,PCI-DSSv3.2|12.3.7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.5.1,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CCE|CCE-27361-5,CSCv6|2.2,ITSG-33|SI-2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "tcp_wrappers-0" operator : "gt" required : YES system : "Linux" type : FILE_CONTENT_CHECK description : "3.4.2 Ensure /etc/hosts.allow is configured" info : "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." solution : "Run the following command to create /etc/hosts.allow: # echo 'ALL: /, /, ...' >/etc/hosts.allow where each / combination (for example, '192.168.1.0/255.255.255.0') represents one network block in use by your organization that requires access to this system." reference : "800-53|SC-7,800-171|3.13.1,800-171|3.13.6,CN-L3|7.1.2.2(c),CSF|PR.PT-4,ITSG-33|SC-7,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/hosts.allow" regex : "^[\\s]*ALL[\\s]*:" # Note: Variable @HOSTS_ALLOW_NETWORK@ replaced with "192.168.0.0/255.255.0.0" in field "expect". expect : "^[\\s]*ALL[\\s]*:[\\s]*192.168.0.0/255.255.0.0[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "3.4.3 Ensure /etc/hosts.deny is configured" info : "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the system." solution : "Run the following command to create /etc/hosts.deny: # echo 'ALL: ALL' >> /etc/hosts.deny" reference : "800-53|SC-7,800-171|3.13.1,800-171|3.13.6,CN-L3|7.1.2.2(c),CSF|PR.PT-4,ITSG-33|SC-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/hosts.deny" regex : "ALL:" expect : "^ALL:[\\s\\t]*ALL$" system : "Linux" type : FILE_CHECK description : "3.4.4 Ensure permissions on /etc/hosts.allow are configured" info : "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following commands to set permissions on /etc/hosts.allow: # chown root:root /etc/hosts.allow# chmod 644 /etc/hosts.allow" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/hosts.allow" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "3.4.5 Ensure permissions on /etc/hosts.deny are configured" info : "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate. Rationale: It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following commands to set permissions on /etc/hosts.deny: # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/hosts.deny" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CONTENT_CHECK description : "3.5.1 Ensure DCCP is disabled" info : "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-26828-4,CSCv6|9.1,LEVEL|1NS,PCI-DSS|2.2.2,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+dccp[\\s]" expect : "^[\\s]*install[\\s]+dccp[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "3.5.2 Ensure SCTP is disabled" info : "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27106-4,CSCv6|9.1,LEVEL|1NS,PCI-DSS|2.2.2,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+sctp[\\s]" expect : "^[\\s]*install[\\s]+sctp[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "3.5.3 Ensure RDS is disabled" info : "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1NS,PCI-DSS|2.2.2,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+rds[\\s]" expect : "^[\\s]*install[\\s]+rds[\\s]+/bin/true[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "3.5.4 Ensure TIPC is disabled" info : "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." solution : "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CSCv6|9.1,LEVEL|1NS,PCI-DSS|2.2.2,PCI-DSS|2.2.5" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/modprobe.d/CIS.conf" regex : "^[\\s]*install[\\s]+tipc[\\s]" expect : "^[\\s]*install[\\s]+tipc[\\s]+/bin/true[\\s]*$" system : "Linux" type : RPM_CHECK description : "3.6.1 Ensure iptables is installed" info : "iptables is required for firewall management and configuration." solution : "Run the following command to install iptables: # yum install iptables" reference : "800-53|CM-7,PCI-DSSv3.1|12.3.7,PCI-DSSv3.2|12.3.7,800-171|3.4.8,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.5.1,ISO/IEC-27001|A.12.6.2,SWIFT-CSCv1|2.3,CSCv6|2.2,ITSG-33|SI-2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" rpm : "iptables-0.0.0-0" operator : "gt" required : YES system : "Linux" type : CMD_EXEC description : "3.6.2 Ensure default deny firewall policy - Chain INPUT" info : "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." solution : "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP# iptables -P OUTPUT DROP# iptables -P FORWARD DROP" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27349-0,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/iptables --list | /usr/bin/grep 'Chain INPUT'" regex : "^Chain INPUT \\(policy DROP\\)" expect : "^Chain INPUT \\(policy DROP\\)" system : "Linux" type : CMD_EXEC description : "3.6.2 Ensure default deny firewall policy - Chain FORWARD" info : "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." solution : "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP# iptables -P OUTPUT DROP# iptables -P FORWARD DROP" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27349-0,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/iptables --list | /usr/bin/grep 'Chain FORWARD'" regex : "^Chain FORWARD \\(policy DROP\\)" expect : "^Chain FORWARD \\(policy DROP\\)" system : "Linux" type : CMD_EXEC description : "3.6.2 Ensure default deny firewall policy - Chain OUTPUT" info : "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." solution : "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP# iptables -P OUTPUT DROP# iptables -P FORWARD DROP" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,CCE|CCE-27349-0,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/iptables --list | /usr/bin/grep 'Chain OUTPUT'" regex : "^Chain OUTPUT \\(policy DROP\\)" expect : "^Chain OUTPUT \\(policy DROP\\)" system : "Linux" type : CMD_EXEC description : "3.6.3 Ensure loopback traffic is configured" info : "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT# iptables -A OUTPUT -o lo -j ACCEPT# iptables -A INPUT -s 127.0.0.0/8 -j DROP" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/iptables -L INPUT -v -n; /usr/sbin/iptables -L OUTPUT -v -n" expect : "" severity : MEDIUM system : "Linux" type : CMD_EXEC description : "3.6.4 Ensure outbound and established connections are configured" info : "If rules are not in place for new outbound, and established connections all packets will be dropped by the default policy preventing network usage. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Configure iptables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections: # iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT # iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT # iptables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT# iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT# iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT# iptables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/sbin/iptables -L -v -n" expect : "" severity : MEDIUM system : "Linux" type : CMD_EXEC description : "3.6.5 Ensure firewall rules exist for all open ports" info : "Any ports that have been opened on non-loopback addresses need firewall rules to govern traffic. Rationale: Without a firewall rule configured for open ports default firewall policy will drop all packets to these ports. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "For each port identified in the audit which does not have a firewall rule establish a proper rule for accepting inbound connections: # iptables -A INPUT -p --dport -m state --state NEW -j ACCEPT" reference : "800-53|SC-7,800-171|3.13.1,ITSG-33|SC-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/netstat -ln; /usr/sbin/iptables -L INPUT -v -n" expect : "" severity : MEDIUM system : "Linux" type : CMD_EXEC description : "3.7 Ensure wireless interfaces are disabled" info : "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Run the following command to disable any wireless interfaces: # ip link set down Disable any wireless interfaces in your network configuration. Impact: Many if not all laptop workstations and some desktop workstations will connect via wireless requiring these interfaces be enabled." reference : "800-53|AC-18,CSF|PR.PT-4,ITSG-33|AC-18,SWIFT-CSCv1|2.3,CCE|CCE-27358-1,CSCv6|15.8,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/sbin/iwconfig | /bin/awk '{print} END {if (NR == 0) print \"none\"}'" expect : "none" severity : MEDIUM system : "Linux" type : RPM_CHECK description : "Check for rsyslog package" rpm : "rsyslog-0.0.0-0" operator : "gt" required : YES system : "Linux" type : CMD_EXEC description : "4.2.1.1 Ensure rsyslog Service is enabled" info : "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." solution : "Run the following command to enable rsyslog: # systemctl enable rsyslog" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80188-6,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled rsyslog | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "enabled" description : "4.2.1.2 Ensure logging is configured" info : "The /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files specifies rules for logging and which files are to be used to log certain classes of messages. Rationale: A great deal of important security-related information is sent via rsyslog (e.g., successful and failed su attempts, failed login attempts, root login attempts, etc.) NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the following lines in the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files as appropriate for your environment: *.emerg :omusrmsg:* mail.* -/var/log/mail mail.info -/var/log/mail.info mail.warning -/var/log/mail.warn mail.err /var/log/mail.err news.crit -/var/log/news/news.crit news.err -/var/log/news/news.err news.notice -/var/log/news/news.notice *.=warning;*.=err -/var/log/warn *.crit /var/log/warn *.*;mail.none;news.none -/var/log/messages local0,local1.* -/var/log/localmessages local2,local3.* -/var/log/localmessages local4,local5.* -/var/log/localmessages local6,local7.* -/var/log/localmessages Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "CCE|CCE-80336-1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : CMD_EXEC description : "4.2.1.3 Ensure rsyslog default file permissions configured" info : "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files. Rationale: It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." solution : "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" reference : "800-53|AU-9,800-171|3.3.8,CN-L3|7.1.2.3(d),CN-L3|7.1.3.3(f),CSF|PR.PT-1,ITSG-33|AU-9,CCE|CCE-80191-0,ISO/IEC-27001|A.12.4.1,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep '$FileCreateMode' /etc/rsyslog.conf /etc/rsyslog.d/*.conf" expect : ".*?:\\$FileCreateMode 0640" system : "Linux" type : CMD_EXEC description : "4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host" info : "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" solution : "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-53|AU-9,800-171|3.3.8,CSF|PR.PT-1,ITSG-33|AU-9,CCE|CCE-27343-3,HIPAA|164.312(b),LEVEL|1S,PCI-DSSv3.1|10.5.3,PCI-DSSv3.1|10.5.4,PCI-DSSv3.2|10.5.3,PCI-DSSv3.2|10.5.4,PCI-DSS|10.5.3" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "grep '^*.*[^I][^I]*@' /etc/rsyslog.conf /etc/rsyslog.d/*.conf" regex : ".*?:[\\s]*\\*\\.\\*[\\s]+" # Note: Variable @SYSLOG_SERVER@ replaced with "10.0.0.2" in field "expect". expect : ".*?:[\\s]*\\*\\.\\*[\\s]+\\@\\@10.0.0.2[\\s]*$" type : CMD_EXEC description : "IP configured" cmd : "/usr/sbin/ip addr" # Note: Variable @SYSLOG_SERVER@ replaced with "10.0.0.2" in field "expect". expect : "^[\\s]*inet[\\s]+10.0.0.2/" system : "Linux" type : FILE_CONTENT_CHECK description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - imtcp" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80192-8,CSCv6|9.1,HIPAA|164.312(b),LEVEL|1NS,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/rsyslog.conf" regex : "^[\\s]*\\$ModLoad[\\s]+imtcp[\\s]*$" expect : "^[\\s]*\\$ModLoad[\\s]+imtcp[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - InputTCPServerRun 514" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-53|CM-7,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80193-6,CSCv6|9.1,HIPAA|164.312(b),LEVEL|1NS,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/rsyslog.conf" regex : "^[\\s]*\\$InputTCPServerRun[\\s]+514[\\s]*$" expect : "^[\\s]*\\$InputTCPServerRun[\\s]+514[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - imtcp" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-53|CM-7,CIP|007-6-R1,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80192-8,HIPAA|164.312(b),LEVEL|1NS,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/rsyslog.conf" regex : "^[\\s]*\\$ModLoad[\\s]+imtcp[\\s]*$" expect : "^[\\s]*\\$ModLoad[\\s]+imtcp[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - InputTCPServerRun 514" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-53|CM-7,CIP|007-6-R1,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80193-6,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/rsyslog.conf" regex : "^[\\s]*\\$InputTCPServerRun[\\s]+514[\\s]*$" expect : "^[\\s]*\\$InputTCPServerRun[\\s]+514[\\s]*$" description : "4.2.1.1 Ensure rsyslog Service is enabled" info : "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Run the following command to enable rsyslog: # systemctl enable rsyslog" reference : "800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80188-6,CIP|007-6-R1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.1.2 Ensure logging is configured" info : "The /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files specifies rules for logging and which files are to be used to log certain classes of messages. Rationale: A great deal of important security-related information is sent via rsyslog (e.g., successful and failed su attempts, failed login attempts, root login attempts, etc.). NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the following lines in the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files as appropriate for your environment: *.emerg :omusrmsg:* mail.* -/var/log/mail mail.info -/var/log/mail.info mail.warning -/var/log/mail.warn mail.err /var/log/mail.err news.crit -/var/log/news/news.crit news.err -/var/log/news/news.err news.notice -/var/log/news/news.notice *.=warning;*.=err -/var/log/warn *.crit /var/log/warn *.*;mail.none;news.none -/var/log/messages local0,local1.* -/var/log/localmessages local2,local3.* -/var/log/localmessages local4,local5.* -/var/log/localmessages local6,local7.* -/var/log/localmessages Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "CCE|CCE-80336-1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.1.3 Ensure rsyslog default file permissions configured" info : "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files. Rationale: It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" reference : "800-171|3.3.1,800-171|3.3.2,800-53|AU-12,CCE|CCE-80191-0,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host" info : "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-171|3.3.8,800-53|AU-9,CCE|CCE-27343-3,CSF|PR.PT-1,HIPAA|164.312(b),ITSG-33|AU-9,LEVEL|1S,PCI-DSSv3.1|10.5.3,PCI-DSSv3.1|10.5.4,PCI-DSSv3.2|10.5.3,PCI-DSSv3.2|10.5.4,PCI-DSS|10.5.3" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - imtcp" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80192-8,CIP|007-6-R1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,HIPAA|164.312(b),ITSG-33|CM-7,LEVEL|1NS,PCI-DSS|10.1" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - InputTCPServerRun 514" info : "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" reference : "800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-80193-6,CIP|007-6-R1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : RPM_CHECK description : "Check for syslog-ng package" rpm : "syslog-ng-0.0.0-0" operator : "gt" required : YES system : "Linux" type : CMD_EXEC description : "4.2.2.1 Ensure syslog-ng service is enabled" info : "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." solution : "Run the following command to enable syslog-ng: # systemctl enable syslog-ng" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled syslog-ng | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "enabled" dont_echo_cmd : YES description : "4.2.2.2 Ensure logging is configured" info : "The /etc/syslog-ng/syslog-ng.conf file specifies rules for logging and which files are to be used to log certain classes of messages. Rationale: A great deal of important security-related information is sent via syslog-ng (e.g., successful and failed su attempts, failed login attempts, root login attempts, etc.). NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the log lines in the /etc/syslog-ng/syslog-ng.conf file as appropriate for your environment: log { source(src); source(chroots); filter(f_console); destination(console); }; log { source(src); source(chroots); filter(f_console); destination(xconsole); }; log { source(src); source(chroots); filter(f_newscrit); destination(newscrit); }; log { source(src); source(chroots); filter(f_newserr); destination(newserr); }; log { source(src); source(chroots); filter(f_newsnotice); destination(newsnotice); }; log { source(src); source(chroots); filter(f_mailinfo); destination(mailinfo); }; log { source(src); source(chroots); filter(f_mailwarn); destination(mailwarn); }; log { source(src); source(chroots); filter(f_mailerr); destination(mailerr); }; log { source(src); source(chroots); filter(f_mail); destination(mail); }; log { source(src); source(chroots); filter(f_acpid); destination(acpid); flags(final); }; log { source(src); source(chroots); filter(f_acpid_full); destination(devnull); flags(final); }; log { source(src); source(chroots); filter(f_acpid_old); destination(acpid); flags(final); }; log { source(src); source(chroots); filter(f_netmgm); destination(netmgm); flags(final); }; log { source(src); source(chroots); filter(f_local); destination(localmessages); }; log { source(src); source(chroots); filter(f_messages); destination(messages); }; log { source(src); source(chroots); filter(f_iptables); destination(firewall); }; log { source(src); source(chroots); filter(f_warn); destination(warn); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : FILE_CONTENT_CHECK description : "4.2.2.3 Ensure syslog-ng default file permissions configured" info : "It is important to ensure that log files exist and have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." solution : "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/syslog-ng/syslog-ng.conf" regex : "perm\\(0640\\);" expect : "perm\\(0640\\);" system : "Linux" type : FILE_CONTENT_CHECK description : "4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host - destination logserver" info : "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" solution : "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp('logfile.example.com' port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CSCv6|6.6,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/syslog-ng/syslog-ng.conf" regex : "^[\\s]*destination logserver.*" expect : "^[\\s]*destination logserver.*(udp|tcp).* port.*" system : "Linux" type : FILE_CONTENT_CHECK description : "4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host - log src" info : "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" solution : "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp('logfile.example.com' port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,CSCv6|6.6,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/syslog-ng/syslog-ng.conf" regex : "^[\\s]*log { source\\(src\\); destination\\(logserver\\); };" expect : "^[\\s]*log { source\\(src\\); destination\\(logserver\\); };" system : "Linux" type : CMD_EXEC description : "4.2.2.5 Ensure remote syslog-ng messages are only accepted on designated log hosts" info : "By default, syslog-ng does not listen for log messages coming in from remote systems. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept syslog-ng data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote syslog-ng messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "On designated log hosts edit the /etc/syslog-ng/syslog-ng.conf file and configure the following lines are appropriately: source net{ tcp(); }; destination remote { file('/var/log/remote/${FULLHOST}-log'); }; log { source(net); destination(remote); }; On non designated log hosts edit the /etc/syslog-ng/syslog-ng.conf file and remove or edit any sources that accept network sourced log messages. Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-53|CM-6,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep '\^source net' /etc/syslog-ng/syslog-ng.conf;/usr/bin/grep '\^destination remote' /etc/syslog-ng/syslog-ng.conf;/usr/bin/grep '\^log' /etc/syslog-ng/syslog-ng.conf" expect : "" severity : MEDIUM description : "4.2.2.1 Ensure syslog-ng service is enabled" info : "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Run the following command to enable syslog-ng: # systemctl enable syslog-ng" reference : "800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CIP|007-6-R1,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.2.2 Ensure logging is configured" info : "The /etc/syslog-ng/syslog-ng.conf file specifies rules for logging and which files are to be used to log certain classes of messages. Rationale: A great deal of important security-related information is sent via syslog-ng (e.g., successful and failed su attempts, failed login attempts, root login attempts, etc.) NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the log lines in the /etc/syslog-ng/syslog-ng.conf file as appropriate for your environment: log { source(src); source(chroots); filter(f_console); destination(console); }; log { source(src); source(chroots); filter(f_console); destination(xconsole); }; log { source(src); source(chroots); filter(f_newscrit); destination(newscrit); }; log { source(src); source(chroots); filter(f_newserr); destination(newserr); }; log { source(src); source(chroots); filter(f_newsnotice); destination(newsnotice); }; log { source(src); source(chroots); filter(f_mailinfo); destination(mailinfo); }; log { source(src); source(chroots); filter(f_mailwarn); destination(mailwarn); }; log { source(src); source(chroots); filter(f_mailerr); destination(mailerr); }; log { source(src); source(chroots); filter(f_mail); destination(mail); }; log { source(src); source(chroots); filter(f_acpid); destination(acpid); flags(final); }; log { source(src); source(chroots); filter(f_acpid_full); destination(devnull); flags(final); }; log { source(src); source(chroots); filter(f_acpid_old); destination(acpid); flags(final); }; log { source(src); source(chroots); filter(f_netmgm); destination(netmgm); flags(final); }; log { source(src); source(chroots); filter(f_local); destination(localmessages); }; log { source(src); source(chroots); filter(f_messages); destination(messages); }; log { source(src); source(chroots); filter(f_iptables); destination(firewall); }; log { source(src); source(chroots); filter(f_warn); destination(warn); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.2.3 Ensure syslog-ng default file permissions configured" info : "It is important to ensure that log files exist and have the correct permissions to ensure that sensitive syslog-ng data is archived and protected. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" reference : "800-171|3.3.1,800-171|3.3.2,800-53|AU-12,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,LEVEL|1S,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host - destination logserver" info : "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp('logfile.example.com' port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-171|3.3.1,800-171|3.3.2,800-53|AU-12,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|6.6,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,LEVEL|1NS,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host - log src" info : "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead. Rationale: Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp('logfile.example.com' port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-171|3.3.1,800-171|3.3.2,800-53|AU-12,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSCv6|6.6,CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,LEVEL|1NS,TBA-FIISB|45.1.1" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.2.5 Ensure remote syslog-ng messages are only accepted on designated log hosts" info : "By default, syslog-ng does not listen for log messages coming in from remote systems. Rationale: The guidance in the section ensures that remote log hosts are configured to only accept syslog-ng data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote syslog-ng messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "On designated log hosts edit the /etc/syslog-ng/syslog-ng.conf file and configure the following lines are appropriately: source net{ tcp(); }; destination remote { file('/var/log/remote/${FULLHOST}-log'); }; log { source(net); destination(remote); }; On non designated log hosts edit the /etc/syslog-ng/syslog-ng.conf file and remove or edit any sources that accept network sourced log messages. Run the following command to reload the syslog-ng configuration: # pkill -HUP syslog-ng" reference : "800-171|3.4.2,800-53|CM-6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : RPM_CHECK description : "4.2.3 rsyslog install check" rpm : "rsyslog-0.0.0-0" operator : "gt" required : YES system : "Linux" type : RPM_CHECK description : "4.2.3 syslog-ng install check" rpm : "syslog-ng-0.0.0-0" operator : "gt" required : YES description : "4.2.3 Ensure rsyslog or syslog-ng is installed" info : "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." solution : "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" reference : "LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" description : "4.2.3 Ensure rsyslog or syslog-ng is installed" info : "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" reference : "CCE|CCE-80187-8,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : FILE_CHECK description : "4.2.4 Ensure permissions on all logfiles are configured" info : "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." solution : "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80189-4,CCE|CCE-80190-2,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/var/log/*" mask : "037" description : "4.3 Ensure logrotate is configured" info : "The system includes the capability of rotating log files regularly to avoid filling up the system with logs or making the logs unmanageable large. The file /etc/logrotate.d/syslog is the configuration file used to rotate log files created by syslog or rsyslog. Rationale: By keeping the log files smaller and more manageable, a system administrator can easily archive these files to another system and spend less time looking through inordinately large log files. NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance." solution : "Edit /etc/logrotate.conf and /etc/logrotate.d/* to ensure logs are rotated according to site policy." reference : "CCE|CCE-80195-1,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" system : "Linux" type : CMD_EXEC description : "5.1.1 Ensure cron daemon is enabled" info : "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." solution : "Run the following command to enable cron: # systemctl enable crond" reference : "CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.4.6,800-171|3.4.7,800-53|CM-7,CCE|CCE-27323-5,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSCv6|9.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/systemctl is-enabled crond | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'" expect : "enabled" dont_echo_cmd : YES system : "Linux" type : FILE_CHECK description : "5.1.2 Ensure permissions on /etc/crontab are configured" info : "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." solution : "Run the following commands to set ownership and permissions on /etc/crontab: # chown root:root /etc/crontab# chmod og-rwx /etc/crontab" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/crontab" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.1.3 Ensure permissions on /etc/cron.hourly are configured" info : "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Rationale: Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." solution : "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.hourly" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.1.4 Ensure permissions on /etc/cron.daily are configured" info : "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Rationale: Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." solution : "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.daily" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.1.5 Ensure permissions on /etc/cron.weekly are configured" info : "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Rationale: Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." solution : "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.weekly" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.1.6 Ensure permissions on /etc/cron.monthly are configured" info : "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Rationale: Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." solution : "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.monthly" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.1.7 Ensure permissions on /etc/cron.d are configured" info : "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Rationale: Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." solution : "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.d" owner : "root" mask : "077" group : "root" type : FILE_CHECK description : "cron.allow exists" file : "/etc/cron.allow" system : "Linux" type : FILE_CHECK description : "5.1.8 Ensure at/cron is restricted to authorized users - cron.allow" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.allow" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK_NOT description : "5.1.8 Ensure at/cron is restricted to authorized users - cron.deny" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.deny" system : "Linux" type : FILE_CHECK_NOT description : "5.1.8 Ensure at/cron is restricted to authorized users - cron.allow" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.allow" system : "Linux" type : FILE_CHECK description : "5.1.8 Ensure at/cron is restricted to authorized users - cron.deny" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.deny" owner : "root" mask : "077" group : "root" type : FILE_CHECK description : "at.allow exists" file : "/etc/at.allow" system : "Linux" type : FILE_CHECK description : "5.1.8 Ensure at/cron is restricted to authorized users - at.allow" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/at.allow" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK_NOT description : "5.1.8 Ensure at/cron is restricted to authorized users - at.deny" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/at.deny" system : "Linux" type : FILE_CHECK_NOT description : "5.1.8 Ensure at/cron is restricted to authorized users - at.allow" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.allow" system : "Linux" type : FILE_CHECK description : "5.1.8 Ensure at/cron is restricted to authorized users - at.deny" info : "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." solution : "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny# rm /etc/at.deny# touch /etc/cron.allow# touch /etc/at.allow# chmod og-rwx /etc/cron.allow# chmod og-rwx /etc/at.allow# chown root:root /etc/cron.allow# chown root:root /etc/at.allow" reference : "800-53|AC-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.1.7,CSF|PR.AC-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/cron.deny" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CHECK description : "5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured" info : "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root. Rationale: The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." solution : "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" owner : "root" mask : "077" group : "root" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.2 Ensure SSH Protocol is set to 2" info : "SSH v1 suffers from insecurities that do not affect SSH v2." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" reference : "CIP|007-6-R1,800-53|CM-7,CCE|CCE-27320-1,CSF|PR.IP-1,CSF|PR.PT-3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*Protocol[\\s]" expect : "^[\\s]*Protocol[\\s]+2[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.3 Ensure SSH LogLevel is set to INFO" info : "SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information. INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" reference : "800-53|AU-12,800-171|3.3.1,800-171|3.3.2,CN-L3|7.1.3.3(a),CN-L3|7.1.3.3(b),CN-L3|7.1.3.3(c),CSF|DE.CM-1,CSF|DE.CM-3,CSF|DE.CM-7,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.1,ITSG-33|AU-12,TBA-FIISB|45.1.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*LogLevel[\\s]" expect : "^[\\s]*LogLevel[\\s]+INFO[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.4 Ensure SSH X11 forwarding is disabled" info : "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" reference : "800-53|CM-6,CIP|007-6-R1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*X11Forwarding[\\s]" expect : "^[\\s]*X11Forwarding[\\s]+no[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.5 Ensure SSH MaxAuthTries is set to 4 or less" info : "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CSCv6|16.7,CSF|PR.AC-3,LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.1.6" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*MaxAuthTries[\\s]" expect : "^[\\s]*MaxAuthTries[\\s]+[1-4][\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.6 Ensure SSH IgnoreRhosts is enabled" info : "Setting this parameter forces users to enter a password when authenticating with ssh." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" reference : "800-53|AC-14,800-53|IA-5,800-171|3.5.2,CSF|PR.AC-1,ITSG-33|AC-14,ITSG-33|IA-5,CCE|CCE-27377-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*IgnoreRhosts[\\s]" expect : "^[\\s]*IgnoreRhosts[\\s]+yes[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.7 Ensure SSH HostbasedAuthentication is disabled" info : "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection ." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" reference : "800-53|AC-14,800-53|IA-5,800-171|3.5.2,CSF|PR.AC-1,ITSG-33|AC-14,ITSG-33|IA-5,CCE|CCE-27413-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*HostbasedAuthentication[\\s]" expect : "^[\\s]*HostbasedAuthentication[\\s]+no[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.8 Ensure SSH root login is disabled" info : "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" reference : "800-53|AC-17,800-171|3.1.15,800-171|3.1.2,CSF|PR.AC-3,CSF|PR.PT-4,ITSG-33|AC-17,SWIFT-CSCv1|5.1,CCE|CCE-27445-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*PermitRootLogin[\\s]" expect : "^[\\s]*PermitRootLogin[\\s]+no[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.9 Ensure SSH PermitEmptyPasswords is disabled" info : "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" reference : "800-53|IA-5,800-171|3.5.2,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*PermitEmptyPasswords[\\s]" expect : "^[\\s]*PermitEmptyPasswords[\\s]+no[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.10 Ensure SSH PermitUserEnvironment is disabled" info : "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-27471-2,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*PermitUserEnvironment[\\s]" expect : "^[\\s]*PermitUserEnvironment[\\s]+no[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.11 Ensure only approved MAC algorithms are used" info : "This variable limits the types of MAC algorithms that SSH can use during communication. Rationale: MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Edit the /etc/ssh/sshd_config file to set the parameter in accordance with site policy. The following includes all supported and accepted MACs: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com" reference : "800-53|SC-13,800-171|3.13.11,CSF|PR.DS-5,ITSG-33|SC-13,CCE|CCE-27295-5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*MACs[\\s]" expect : "^[\\s]*MACs[\\s]" severity : MEDIUM system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.12 Ensure SSH Idle Timeout Interval is configured - ClientAliveInterval" info : "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time. Rationale: Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.. While the recommended setting is 1800 seconds (30 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." solution : "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 1800 ClientAliveCountMax 0" reference : "800-53|AC-12,HIPAA|164.312(a)(2)(iii),PCI-DSSv3.1|12.3.8,PCI-DSSv3.1|8.1.8,PCI-DSSv3.2|12.3.8,PCI-DSSv3.2|8.1.8,800-171|3.1.11,CN-L3|7.1.2.2(d),CN-L3|7.1.3.7(b),ITSG-33|AC-12,CCE|CCE-27433-2,CSCv6|16.4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*ClientAliveInterval[\\s]" expect : "^[\\s]*ClientAliveInterval[\\s]+([1-9]|[1-9][0-9]{1,2}|1[0-7][0-9]{2}|1800)[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.12 Ensure SSH Idle Timeout Interval is configured - ClientAliveCountMax" info : "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time. Rationale: Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.. While the recommended setting is 1800 seconds (30 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." solution : "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 1800 ClientAliveCountMax 0" reference : "800-53|AC-12,HIPAA|164.312(a)(2)(iii),PCI-DSSv3.1|12.3.8,PCI-DSSv3.1|8.1.8,PCI-DSSv3.2|12.3.8,PCI-DSSv3.2|8.1.8,800-171|3.1.11,CN-L3|7.1.2.2(d),CN-L3|7.1.3.7(b),ITSG-33|AC-12,CCE|CCE-27082-7,CSCv6|16.4,CSF|PR.AC-3,LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.1.8" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*ClientAliveCountMax[\\s]" expect : "^[\\s]*ClientAliveCountMax[\\s]+[0-3][\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.13 Ensure SSH LoginGraceTime is set to one minute or less" info : "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access. Rationale: Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" reference : "800-53|AC-12,HIPAA|164.312(a)(2)(iii),PCI-DSSv3.1|12.3.8,PCI-DSSv3.1|8.1.8,PCI-DSSv3.2|12.3.8,PCI-DSSv3.2|8.1.8,800-171|3.1.11,CN-L3|7.1.2.2(d),CN-L3|7.1.3.7(b),ITSG-33|AC-12,CSCv6|16.4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*LoginGraceTime[\\s]" expect : "^[\\s]*LoginGraceTime[\\s]+([1-9]|[1-5][0-9]|60)[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.14 Ensure SSH access is limited" info : "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." solution : "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " reference : "800-53|AC-6,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*(Allow|Deny)(Users|Groups)[\\s]" expect : "^[\\s]*(Allow|Deny)(Users|Groups)[\\s]" system : "Linux" type : FILE_CONTENT_CHECK description : "5.2.15 Ensure SSH warning banner is configured" info : "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" reference : "800-53|AC-8,800-171|3.1.9,ITSG-33|AC-8,CCE|CCE-27314-4,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/ssh/sshd_config" regex : "^[\\s]*Banner[\\s]" expect : "^[\\s]*Banner[\\s]+/etc/issue.net[\\s]*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - password-auth try_first_pass" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "password[\\s]*requisite[\\s]*pam_pwquality\\.so" expect : "try_first_pass" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - system-auth try_first_pass" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,CSF|PR.AC-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "password[\\s]*requisite[\\s]*pam_pwquality\\.so" expect : "try_first_pass" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - password-auth retry=3" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-27160-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "password[\\s]*requisite[\\s]*pam_pwquality\\.so" expect : "retry[\\s]*=[\\s]*3" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - system-auth retry=3" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-27160-1,CSCv6|16.7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "password[\\s]*requisite[\\s]*pam_pwquality\\.so" expect : "retry[\\s]*=[\\s]*3" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - minlen" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,CCE|CCE-27293-0,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/security/pwquality.conf" regex : "^[\\s]*minlen" expect : "^[\\s]*minlen[\\s]*=[\\s]*(8|[8-9]|[1-9][0-9])" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - dcredit" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,CCE|CCE-27214-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/security/pwquality.conf" regex : "^[\\s]*dcredit" expect : "^[\\s]*dcredit[\\s]*=[\\s]*-1" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - ucredit" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,CCE|CCE-27200-5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/security/pwquality.conf" regex : "^[\\s]*ucredit" expect : "^[\\s]*ucredit[\\s]*=[\\s]*-1" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - ocredit" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,CCE|CCE-27360-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/security/pwquality.conf" regex : "^[\\s]*ocredit" expect : "^[\\s]*ocredit[\\s]*=[\\s]*-1" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.1 Ensure password creation requirements are configured - lcredit" info : "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality .so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The following options are set in the /etc/security/pwquality.conf file: - minlen = 8 - password must be 8 characters or more - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Rationale: Strong passwords protect systems from being hacked through brute force methods." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 8 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1" reference : "800-53|IA-5,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,CCE|CCE-27345-8,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/security/pwquality.conf" regex : "^[\\s]*lcredit" expect : "^[\\s]*lcredit[\\s]*=[\\s]*-1" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - system-auth 'auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*auth[\\s]+required[\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+required[\\s]+pam_faillock\\.so[\\s]+preauth[\\s]+audit[\\s]+silent[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - system-auth 'auth [success=1 default=bad] pam_unix.so'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*auth[\\s]+\\[success=1[\\s]+default=bad\\][\\s]*" expect : "^[\\s]*auth[\\s]+\\[success=1[\\s]+default=bad\\][\\s]+pam_unix\.so[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - system-auth 'auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*auth[\\s]+\\[default=die\\][\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+\\[default=die\\][\\s]+pam_faillock\\.so[\\s]+authfail[\\s]+audit[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - system-auth 'auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*auth[\\s]+sufficient[\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+sufficient[\\s]+pam_faillock\\.so[\\s]+authsucc[\\s]+audit[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - password-auth 'auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*auth[\\s]+required[\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+required[\\s]+pam_faillock\\.so[\\s]+preauth[\\s]+audit[\\s]+silent[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - password-auth 'auth [success=1 default=bad] pam_unix.so'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*auth[\\s]+\\[success=1[\\s]+default=bad\\][\\s]*" expect : "^[\\s]*auth[\\s]+\\[success=1[\\s]+default=bad\\][\\s]+pam_unix\.so[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - password-auth 'auth [default=die] pam_faillock.so'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*auth[\\s]+\\[default=die\\][\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+\\[default=die\\][\\s]+pam_faillock\\.so[\\s]+authfail[\\s]+audit[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.2 Lockout for failed password attempts - password-auth 'auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900'" info : "Lock out users after _n_ unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site. Rationale: Locking out user IDs after _n_ unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files and add the following pam_faillock.so lines surrounding a pam_unix.so line modify the pam_unix.so is [success=1 default=bad] as listed in both: auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900 auth [success=1 default=bad] pam_unix.so auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900" reference : "800-53|AC-7,800-171|3.1.8,ITSG-33|AC-7,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2,CCE|CCE-26884-7,CCE|CCE-27297-1,CCE|CCE-27350-8,CSCv6|16.7,LEVEL|1S,PCI-DSS|8.5.11" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*auth[\\s]+sufficient[\\s]+pam_faillock\\.so[\\s]*" expect : "^[\\s]*auth[\\s]+sufficient[\\s]+pam_faillock\\.so[\\s]+authsucc[\\s]+audit[\\s]+deny=5[\\s]+unlock_time=900[\\s]*" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.3 Ensure password reuse is limited - system-auth" info : "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. Rationale: Forcing users not to reuse their past 24 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=24 or password required pam_pwhistory.so remember=24" reference : "800-53|IA-5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.5,PCI-DSSv3.2|8.2.5,800-171|3.5.8,CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.3,CCE|CCE-26923-3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*password[\\s]+(sufficient[\\s]+pam_unix|required[\\s]+pam_pwhistory)\\.so[\\s]*" expect : "remember[\\s]*=[\\s]*24" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.3 Ensure password reuse is limited - password-auth" info : "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. Rationale: Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" reference : "800-53|IA-5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.5,PCI-DSSv3.2|8.2.5,800-171|3.5.8,CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.3,CCE|CCE-26923-3,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*password[\\s]+(sufficient[\\s]+pam_unix|required[\\s]+pam_pwhistory)\\.so[\\s]*" expect : "remember[\\s]*=[\\s]*24" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.4 Ensure password hashing algorithm is SHA-512 - system-auth" info : "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm. Rationale: The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" reference : "800-53|IA-5,800-53|SC-13,800-171|3.13.11,800-171|3.5.10,CSF|PR.AC-1,CSF|PR.DS-5,ITSG-33|IA-5,ITSG-33|SC-13,SWIFT-CSCv1|4.1,TBA-FIISB|26.1,CCE|CCE-27104-9,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/system-auth" regex : "^[\\s]*password[\\s]+sufficient[\\s]+pam_unix\\.so[\\s]*" expect : "sha512" system : "Linux" type : FILE_CONTENT_CHECK description : "5.3.4 Ensure password hashing algorithm is SHA-512 - password-auth" info : "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm. Rationale: The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." solution : "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" reference : "800-53|IA-5,800-53|SC-13,800-171|3.13.11,800-171|3.5.10,CSF|PR.AC-1,CSF|PR.DS-5,ITSG-33|IA-5,ITSG-33|SC-13,SWIFT-CSCv1|4.1,TBA-FIISB|26.1,CCE|CCE-27104-9,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/password-auth" regex : "^[\\s]*password[\\s]+sufficient[\\s]+pam_unix\\.so[\\s]*" expect : "sha512" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.1.1 Ensure password expiration is 90 days or less" info : "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days. Rationale: The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." solution : "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 Modify user parameters for all users with a password set to match: # chage --maxdays 90" reference : "800-53|IA-5,CIP|007-6-R5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2,CSCv6|16,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/login.defs" regex : "^[\\s\\t]*PASS_MAX_DAYS\\s+" expect : "PASS_MAX_DAYS\\s+([1-9]|[1-8][0-9]|90)\\s*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.1.2 Ensure minimum days between password changes is 7 or more" info : "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days. Rationale: By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." solution : "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7" reference : "800-53|IA-5,CIP|007-6-R5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2,800-171|3.5.10,800-171|3.5.7,800-171|3.5.8,800-171|3.5.9,CCE|CCE-27002-5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/login.defs" regex : "^[\\s\\t]*PASS_MIN_DAYS\\s+" expect : "PASS_MIN_DAYS\\s+([7-9]|[1-9][0-9]+)\\s*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.1.3 Ensure password expiration warning days is 7 or more" info : "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." solution : "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 " reference : "800-53|IA-5,CIP|007-6-R5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2,800-171|3.5.10,800-171|3.5.7,800-171|3.5.8,800-171|3.5.9,CCE|CCE-26486-1,LEVEL|1S,PCI-DSS|8.5.9" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/login.defs" regex : "^[\\s]*PASS_WARN_AGE\\s+" expect : "^[\\s]*PASS_WARN_AGE\\s+([7-9]|[1-9][0-9]+)\\s*$" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.1.4 Ensure inactive password lock is 120 days or less" info : "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled. Rationale: Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." solution : "Run the following command to set the default password inactivity period to 120 days: # useradd -D -f 120 Modify user parameters for all users with a password set to match: # chage --inactive 120" reference : "800-53|AC-2,CIP|004-6-R5,PCI-DSSv3.1|8.1.4,PCI-DSSv3.2|8.1.4,CN-L3|7.1.3.2(e),CSF|PR.AC-1,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.6,ITSG-33|AC-2,CCE|CCE-27355-7,CSCv6|16.1,CSCv6|16.6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/default/useradd" regex : "^[\\s]*INACTIVE[\\s]*=[\\s]*" expect : "^[\\s]*INACTIVE[\\s]*=[\\s]*(120|1[0-1][0-9]|[1-9][0-9]|[1-9])[\\s]*$" system : "Linux" type : CMD_EXEC description : "5.4.1.5 Ensure all users last password change date is in the past" info : "All users should have a password change date in the past. Rationale: If a users recorded password change date is in the future then they could bypass any set password expiration. NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance." solution : "Investigate any users with a password change date in the future and correct them. Locking the account, expiring the password, or resetting the password manually may be appropriate." reference : "800-53|IA-5,CIP|007-6-R5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "for i in $(cat /etc/shadow |cut -d: -f1);do echo '\n';echo $i;echo '------';now=$(date '+%b %d, %Y');echo -n 'Current Date : ';echo $now;change_date=$(chage --list $i |grep 'Last password change'| cut -d: -f2|awk '{$1=$1};1');echo -n 'Last Password Change : ';echo $change_date;done" expect : "MANUAL_REVIEW" severity : MEDIUM system : "Linux" type : GRAMMAR_CHECK description : "5.4.2 Ensure system accounts are non-login" info : "It is important to make sure that accounts that are not being used by regular users are prevented from being used to provide an interactive shell. By default Red Hat 7 sets the password field for these accounts to an invalid string, but it is also recommended that the shell field in the passwd file be set to /sbin/nologin. This prevents the account from potentially being used to run any commands." solution : "Set the shell for any accounts returned by the audit script to /sbin/nologin: # usermod -s /sbin/nologin The following script will automatically set all user shells required to /sbin/nologin and lock the sync, shutdown, and halt users: #!/bin/bash for user in `awk -F: '($3 < 1000) {print $1 }' /etc/passwd`; do if [ $user != 'root' ]; then usermod -L $user if [ $user != 'sync' ] && [ $user != 'shutdown' ] && [ $user != 'halt' ]; then usermod -s /sbin/nologin $user fi fi done" reference : "800-53|AC-6,PCI-DSSv3.1|7.1.2,PCI-DSSv3.2|7.1.2,800-171|3.1.5,CN-L3|7.1.3.2(b),CN-L3|7.1.3.2(g),CSF|PR.AC-4,CSF|PR.DS-5,ITSG-33|AC-6,SWIFT-CSCv1|5.1,CCE|CCE-26448-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/passwd" regex : "^[A-Za-z0-9_-]+:x:([1-9][0-9][0-9][0-9]+):[0-9]+:[\"]?[-A-Za-z0-9_ \/-]*[\"]?:[-A-Za-z0-9_\/]+:.*" regex : "^[A-Za-z0-9_-]+:x:([1-9]:|[0-9][0-9]:|[0-9][0-9][0-9]:)[0-9]+:[\"]?[-A-Za-z0-9_ \/-]*[\"]?:[-A-Za-z0-9_\/-]+:/sbin/nologin" regex : "^root:x:0:0:root:/root:/bin/bash" regex : "^sync:x:5:0:sync:/sbin:/bin/sync" regex : "^shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown" regex : "^halt:x:7:0:halt:/sbin:/sbin/halt" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.3 Ensure default group for the root account is GID 0" info : "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." solution : "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" reference : "800-53|AC-2,800-171|3.1.1,CN-L3|7.1.3.2(d),CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/passwd" regex : "^root:" expect : "^root:x:0:0:" system : "Linux" type : FILE_CONTENT_CHECK description : "5.4.4 Ensure default user umask is 027 or more restrictive - /etc/bashrc" info : "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories. Rationale: Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." solution : "Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" reference : "800-53|AC-3,800-171|3.1.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,CCE|CCE-80202-5,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/bashrc" regex : "^[\\s]*umask[\\s]" expect : "^[\\s]*umask[\\s]+[0-7][2-7]7[\\s]*$" system : "Linux" type : CMD_EXEC description : "5.4.4 Ensure default user umask is 027 or more restrictive - /etc/profile /etc/profile.d/*.sh" info : "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories. Rationale: Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." solution : "Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" reference : "800-53|AC-3,800-171|3.1.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,CCE|CCE-80204-1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/grep 'umask' /etc/profile /etc/profile.d/*.sh" regex : "^(.*?:)?[\\s]*umask[\\s]" expect : "^(.*?:)?[\\s]*umask[\\s]+[0-7][2-7]7[\\s]*$" system : "Linux" type : CMD_EXEC description : "5.5 Ensure root login is restricted to system console" info : "Since the system console has special properties to handle emergency situations, it is important to ensure that the console is in a physically secure location and that unauthorized consoles have not been defined." solution : "Remove entries for any consoles that are not in a physically secure location." reference : "800-53|AC-6,CSF|PR.AC-4,ITSG-33|AC-6,SWIFT-CSCv1|5.1,CCE|CCE-27294-8,LEVEL|1NS" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/grep -v \"console\" /etc/securetty | /bin/awk '{ print } END { if (NR==0) print \"none\" }'" expect : "none" dont_echo_cmd : YES system : "Linux" type : FILE_CONTENT_CHECK description : "5.6 Ensure access to the su command is restricted - pam_wheel.so" info : "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." solution : "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid Create a comma separated list of users in the wheel statement in the /etc/group file: wheel:x:10:root," reference : "800-53|AC-6,800-171|3.1.7,CSF|PR.AC-4,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/pam.d/su" regex : "^[\\s]*auth[\\s]+required[\\s]+pam_wheel\\.so[\\s]+use_uid[\\s]*$" expect : "^[\\s]*auth[\\s]+required[\\s]+pam_wheel\\.so[\\s]+use_uid[\\s]*$" system : "Linux" type : CMD_EXEC description : "5.6 Ensure access to the su command is restricted - wheel group contains root" info : "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." solution : "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid Create a comma separated list of users in the wheel statement in the /etc/group file: wheel:x:10:root," reference : "800-53|AC-2,800-171|3.1.1,CN-L3|7.1.3.2(d),CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/bin/grep ^wheel: /etc/group" expect : "^wheel:x:10:root(,|$)" dont_echo_cmd : YES system : "Linux" type : FILE_CHECK description : "6.1.2 Ensure permissions on /etc/passwd are configured" info : "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" reference : "800-53|IA-5,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.AC-1,ITSG-33|IA-5,SWIFT-CSCv1|5.4,TBA-FIISB|26.1,CCE|CCE-26639-5,CCE|CCE-27138-7,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/passwd" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.3 Ensure permissions on /etc/shadow are configured" info : "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." solution : "Run the following commands to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" reference : "800-53|IA-5,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.AC-1,ITSG-33|IA-5,SWIFT-CSCv1|5.4,TBA-FIISB|26.1,CCE|CCE-26795-5,CCE|CCE-27125-4,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/shadow" owner : "root" mask : "777" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.4 Ensure permissions on /etc/group are configured" info : "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." solution : "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" reference : "800-53|IA-5,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.AC-1,ITSG-33|IA-5,SWIFT-CSCv1|5.4,TBA-FIISB|26.1,CCE|CCE-26933-2,CCE|CCE-27037-1,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/group" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.5 Ensure permissions on /etc/gshadow are configured" info : "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information. Rationale: If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." solution : "Run the following chown to set permissions on /etc/gshadow : # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" reference : "800-53|IA-5,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,CSF|PR.AC-1,ITSG-33|IA-5,SWIFT-CSCv1|5.4,TBA-FIISB|26.1,CCE|CCE-26840-9,CCE|CCE-27161-9,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/gshadow" owner : "root" mask : "777" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.6 Ensure permissions on /etc/passwd- are configured" info : "The /etc/passwd- file contains backup user account information. Rationale: It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following command to set permissions on /etc/passwd- : # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/passwd-" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.7 Ensure permissions on /etc/shadow- are configured" info : "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information. Rationale: It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following commands to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/shadow-" owner : "root" mask : "777" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.8 Ensure permissions on /etc/group- are configured" info : "The /etc/group- file contains a backup list of all the valid groups defined in the system. Rationale: It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following command to set permissions on /etc/group- : # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/group-" owner : "root" mask : "133" group : "root" system : "Linux" type : FILE_CHECK description : "6.1.9 Ensure permissions on /etc/gshadow- are configured" info : "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information. Rationale: It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." solution : "Run the following commands to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/gshadow-" owner : "root" mask : "777" group : "root" description : "6.1.10 Ensure no world writable files exist" info : "Unix-based systems support variable settings to control access to files. World writable files are the least secure. See the chmod(2) man page for more information. Rationale: Data in world-writable files can be modified and compromised by any user on the system. World writable files may also indicate an incorrectly written script or program that could potentially be the cause of a larger compromise to the system's integrity." solution : "Removing write access for the 'other' category ( chmod o-w ) is advisable, but always consult relevant vendor documentation to avoid breaking any application dependencies on a given file." reference : "800-53|AC-6,PCI-DSSv3.1|7.1.2,PCI-DSSv3.2|7.1.2,800-171|3.1.5,CN-L3|7.1.3.2(b),CN-L3|7.1.3.2(g),CSF|PR.AC-4,CSF|PR.DS-5,ITSG-33|AC-6,SWIFT-CSCv1|5.1,CCE|CCE-80131-6,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" name : "find_world_writeable_files" description : "6.1.11 Ensure no unowned files or directories exist" info : "Sometimes when administrators delete users from the passwd file they neglect to remove all files owned by those users from the system. Rationale: A new user who is assigned the deleted user's user ID or group ID may then end up 'owning' these files, and thus have more access on the system than was intended." solution : "Locate files that are owned by users or groups not listed in the system configuration files, and reset the ownership of these files to some active user on the system as appropriate." reference : "800-53|AC-16,CSF|PR.AC-4,ITSG-33|AC-16,CCE|CCE-80134-0,CCE|CCE-80135-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" name : "find_orphan_files" description : "6.1.12 Ensure no ungrouped files or directories exist" info : "Sometimes when administrators delete users or groups from the system they neglect to remove all files owned by those users or groups. Rationale: A new user who is assigned the deleted user's user ID or group ID may then end up 'owning' these files, and thus have more access on the system than was intended." solution : "Locate files that are owned by users or groups not listed in the system configuration files, and reset the ownership of these files to some active user on the system as appropriate." reference : "800-53|AC-16,CSF|PR.AC-4,ITSG-33|AC-16,CCE|CCE-80134-0,CCE|CCE-80135-7,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" name : "find_orphan_files" description : "6.1.13 Audit SUID executables" info : "The owner of a file can set the file's permissions to run with the owner's or group's permissions, even if the user running the program is not the owner or a member of the group. The most common reason for a SUID program is to enable users to perform functions (such as changing their password) that require root privileges. Rationale: There are valid reasons for SUID programs, but it is important to identify and review such programs to ensure they are legitimate." info : "NOTE: Any files noted by this check should be manually reviewed to determine if SUID is appropriate for your environment." solution : "Ensure that no rogue SUID programs have been introduced into the system. Review the files returned by the action in the Audit section and confirm the integrity of these binaries." reference : "800-53|AC-6,CSF|PR.AC-4,CCE|CCE-80133-2,LEVEL|1NS,PCI-DSS|10.4" see_also : "https://workbench.cisecurity.org/files/1860" name : "find_suid_sgid_files" severity : MEDIUM description : "6.1.14 Audit SGID executables" info : "The owner of a file can set the file's permissions to run with the owner's or group's permissions, even if the user running the program is not the owner or a member of the group. The most common reason for a SGID program is to enable users to perform functions (such as changing their password) that require root privileges. Rationale: There are valid reasons for SGID programs, but it is important to identify and review such programs to ensure they are legitimate. Review the files returned by the action in the audit section and check to see if system binaries have a different md5 checksum than what from the package. This is an indication that the binary may have been replaced." info : "NOTE: Any files noted by this check should be manually reviewed to determine if SGID is appropriate for your environment." solution : "Ensure that no rogue SGID programs have been introduced into the system. Review the files returned by the action in the Audit section and confirm the integrity of these binaries." reference : "800-53|AC-6,CSF|PR.AC-4,CCE|CCE-80132-4,LEVEL|1NS,PCI-DSS|10.4" see_also : "https://workbench.cisecurity.org/files/1860" name : "find_suid_sgid_files" severity : MEDIUM system : "Linux" type : CMD_EXEC description : "6.2.1 Ensure password fields are not empty" info : "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." solution : "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." reference : "800-53|IA-5,CIP|007-6-R5,HIPAA|164.308(a)(5)(ii)(D),PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,800-171|3.5.7,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSF|PR.AC-1,ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "/usr/bin/cat /etc/shadow | /usr/bin/awk -F : '($2 == \"\") { print $1 \" does not have a password.\";flag++ } END { if(flag<1) print \"none\" }'" expect : "none" dont_echo_cmd : YES system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "6.2.2 Ensure no legacy '+' entries exist in /etc/passwd" info : "These entries may provide an avenue for attackers to gain privileged access on the system." solution : "Remove any legacy '+' entries from /etc/passwd if they exist." reference : "800-53|IA-2,800-171|3.5.1,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/passwd" regex : "^[\\s]*\\+:" expect : "^[\\s]*\\+:" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "6.2.3 Ensure no legacy '+' entries exist in /etc/shadow" info : "These entries may provide an avenue for attackers to gain privileged access on the system." solution : "Remove any legacy '+' entries from /etc/shadow if they exist." reference : "800-53|IA-2,800-171|3.5.1,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/shadow" regex : "^[\\s]*\\+:" expect : "^[\\s]*\\+:" system : "Linux" type : FILE_CONTENT_CHECK_NOT description : "6.2.4 Ensure no legacy '+' entries exist in /etc/group" info : "These entries may provide an avenue for attackers to gain privileged access on the system." solution : "Remove any legacy '+' entries from /etc/group if they exist." reference : "800-53|IA-2,800-171|3.5.1,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" file : "/etc/group" regex : "^[\\s]*\\+:" expect : "^[\\s]*\\+:" description : "6.2.5 Ensure root is the only UID 0 account" info : "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." solution : "Remove any users other than root with UID 0 or assign them a new UID if appropriate." reference : "800-53|AC-6,800-171|3.1.5,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.3,ITSG-33|AC-6,SWIFT-CSCv1|1.2,CCE|CCE-27175-9,CSCv6|5.1,HIPAA|164.312(a)(2)(i),LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.1.1,PCI-DSS|8.5.8" see_also : "https://workbench.cisecurity.org/files/1860" name : "passwd_zero_uid" description : "6.2.6 Ensure root PATH Integrity" info : "Including the current working directory (.) or other writable directory in root's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a Trojan horse program." solution : "Correct or justify any items discovered in the Audit step." reference : "800-53|CM-7,800-171|3.4.7,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,SWIFT-CSCv1|2.3,CCE|CCE-80199-3,CSCv6|8.4,LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.5.8" see_also : "https://workbench.cisecurity.org/files/1860" name : "dot_in_root_path_variable" system : "Linux" type : CMD_EXEC description : "6.2.7 Ensure all users' home directories exist" info : "If the user's home directory does not exist or is unassigned, the user will be placed in '/' and will not be able to write any files or have local environment variables set." solution : "If any users' home directories do not exist, create them and make sure the respective user owns the directory. Users without an assigned home directory should be removed or assigned a home directory as appropriate." reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "cat /etc/passwd | egrep -v '^(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\" && $7 != \"/bin/false\") { print $1 \" \" $3 \" \" $6 }'| while read user uid dir; do if [ ! -d \"$dir\" ]; then echo \"The home directory ($dir) of user $user does not exist.\"; fi; done | /usr/bin/awk '{print} END {if (NR == 0) print \"none\"'}" expect : "^none" system : "Linux" type : CMD_EXEC description : "6.2.8 Ensure users' home directories permissions are 750 or more restrictive" info : "While the system administrator can establish secure permissions for users' home directories, the users can easily override these. Rationale: Group or world-writable user home directories may enable malicious users to steal or modify other users' data or to gain another user's system privileges." solution : "Making global modifications to user home directories without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user file permissions and determine the action to be taken in accordance with site policy." reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80201-7,CSCv6|3.1,LEVEL|1S" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "for dir in $(cat /etc/passwd | egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $6 }'); do if [ ! -d $dir ]; then echo \"The home directory ($dir) of user $user does not exist.\"; else dirperm=$(ls -ld $dir | cut -f1 -d\" \"); if [ $(echo $dirperm | cut -c6) != \"-\" ]; then echo \"Group Write permission set on the home directory ($dir) of user $user\"; fi; if [ $(echo $dirperm | cut -c8) != \"-\" ]; then echo \"Other Read permission set on the home directory ($dir) of user $user\"; fi; if [ $(echo $dirperm | cut -c9) != \"-\" ]; then echo \"Other Write permission set on the home directory ($dir) of user $user\"; fi; if [ $(echo $dirperm | cut -c10) != \"-\" ]; then echo \"Other Execute permission set on the home directory ($dir) of user $user\"; fi; fi; done | /bin/awk '{ print } END { if (NR==0) print \"All home directories have proper permissions\" }'" expect : "All home directories have proper permissions" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "6.2.9 Ensure users own their home directories" info : "The user home directory is space defined for the particular user to set local environment variables and to store personal files. Rationale: Since the user is accountable for files stored in the user home directory, the user must be the owner of the directory." solution : "Change the ownership of any home directories that are not owned by the defined user to the correct user." reference : "800-53|CM-6,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CCE|CCE-80201-7,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "cat /etc/passwd | egrep -v '^(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $1 \" \" $3 \" \" $6 }' | while read user uid dir; do if [ -d \"$dir\" ]; then owner=$(stat -L -c \"%U\" \"$dir\"); if [ \"$owner\" != \"$user\" ]; then echo \"The home directory ($dir) of user $user is owned by $owner.\"; fi fi done | /bin/awk '{ print } END { if (NR==0) print \"All home directories have proper owners\" }'" expect : "All home directories have proper owners" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "6.2.10 Ensure users' dot files are not group or world writable" info : "While the system administrator can establish secure permissions for users' 'dot' files, the users can easily override these. Rationale: Group or world-writable user configuration files may enable malicious users to steal or modify other users' data or to gain another user's system privileges." solution : "Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user dot file permissions and determine the action to be taken in accordance with site policy." reference : "800-53|CM-6,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "for dir in $(cat /etc/passwd | egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $6 }'); do if [ ! -d $dir ]; then echo \"The home directory ($dir) does not exist.\"; else for file in $dir/.[A-Za-z0-9]*; do fileperm=$(ls -ld $file | cut -f1 -d\" \"); if [ $(echo $fileperm | cut -c6) != \"-\" ]; then echo \"Group Write permission set on file $file\"; fi; if [ $(echo $fileperm | cut -c9) != \"-\" ]; then echo \"Other Write permission set on file $file\"; fi; done; fi; done | /bin/awk '{ print } END { if (NR==0) print \"All dot files are not group or world writable\" }'" expect : "All dot files are not group or world writable" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "6.2.11 Ensure no users have .forward files" info : "The .forward file specifies an email address to forward the user's mail to. Rationale: Use of the .forward file poses a security risk in that sensitive data may be inadvertently transferred outside the organization. The .forward file also poses a risk as it can be used to execute commands that may perform unintended actions." solution : "Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .forward files and determine the action to be taken in accordance with site policy." reference : "800-53|CM-7,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CIP|007-6-R1,CSCv6|9.1,LEVEL|1S,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "cat /etc/passwd | egrep -v '^(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $1 \" \" $3 \" \" $6 }' | while read user uid dir; do if [ -f \"$dir/.forward\" ]; then echo \".forward file $dir/.forward exists\"; fi; done | /bin/awk '{ print } END { if (NR==0) print \"No .forward files found\" }'" expect : "No .forward files found" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "6.2.12 Ensure no users have .netrc files" info : "The .netrc file contains data for logging into a remote host for file transfers via FTP. Rationale: The .netrc file presents a significant security risk since it stores passwords in unencrypted form. Even if FTP is disabled, user accounts may have brought over .netrc files from other systems which could pose a risk to those systems." solution : "Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .netrc files and determine the action to be taken in accordance with site policy." reference : "800-53|CM-7,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-80211-6,CIP|007-6-R1,CSCv6|9.1,LEVEL|1S,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,PCI-DSS|2.2.4,SWIFT-CSCv1|2.3,TBA-FIISB|26.1" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "cat /etc/passwd | egrep -v '^(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $1 \" \" $3 \" \" $6 }' | while read user uid dir; do if [ -f \"$dir/.netrc\" ]; then echo \".netrc file $dir/.netrc exists\"; fi; done | /bin/awk '{ print } END { if (NR==0) print \"No .netrc files found\" }'" expect : "No .netrc files found" dont_echo_cmd : YES system : "Linux" type : CMD_EXEC description : "6.2.13 Ensure users' .netrc Files are not group or world accessible" info : "While the system administrator can establish secure permissions for users' .netrc files, the users can easily override these. Rationale: .netrc files may contain unencrypted passwords that may be used to attack other systems." solution : "Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .netrc file permissions and determine the action to be taken in accordance with site policy." reference : "800-53|CM-6,800-171|3.4.2,CSF|PR.IP-1,ITSG-33|CM-6,CSCv6|3.1,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "for dir in $(cat /etc/passwd | egrep -v '(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $6 }'); do if [ -f \"$dir/.netrc\" ]; then fileperm=$(ls -ld $dir/.netrc | cut -f1 -d\" \"); if [ $(echo $fileperm | cut -c5) != \"-\" ]; then echo \"Group Read set on $dir/.netrc\"; fi; if [ $(echo $fileperm | cut -c6) != \"-\" ]; then echo \"Group Write set on $dir/.netrc\"; fi; if [ $(echo $fileperm | cut -c7) != \"-\" ]; then echo \"Group Execute set on $dir/.netrc\"; fi; if [ $(echo $fileperm | cut -c8) != \"-\" ]; then echo \"Other Read set on $dir/.netrc\"; fi; if [ $(echo $fileperm | cut -c9) != \"-\" ]; then echo \"Other Write set on $dir/.netrc\"; fi; if [ $(echo $fileperm | cut -c10) != \"-\" ]; then echo \"Other Execute set on $dir/.netrc\"; fi; fi; done | /bin/awk '{ print } END { if (NR==0) print \"All .netrc files are not group or world accessible\" }'" expect : "All .netrc files are not group or world accessible" system : "Linux" type : CMD_EXEC description : "6.2.14 Ensure no users have .rhosts files" info : "While no .rhosts files are shipped by default, users can easily create them. Rationale: This action is only meaningful if .rhosts support is permitted in the file /etc/pam.conf . Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf , they may have been brought over from other systems and could contain information useful to an attacker for those other systems." solution : "Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .rhosts files and determine the action to be taken in accordance with site policy." reference : "800-53|CM-7,800-171|3.4.6,800-171|3.4.7,CN-L3|7.1.3.5(c),CN-L3|7.1.3.7(d),CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,CCE|CCE-27406-8,CIP|007-6-R1,CSCv6|9.1,LEVEL|1S,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" cmd : "cat /etc/passwd | egrep -v '^(root|halt|sync|shutdown)' | awk -F: '($7 != \"/sbin/nologin\") { print $1 \" \" $3 \" \" $6 }' | while read user uid dir; do if [ -f \"$dir/.rhosts\" ]; then echo \".rhosts file $dir/.rhosts exists\"; fi; done | /bin/awk '{ print } END { if (NR==0) print \"No .rhosts files found\" }'" expect : "No .rhosts files found" dont_echo_cmd : YES system : "Linux" description : "6.2.15 Ensure all groups in /etc/passwd exist in /etc/group" info : "Groups defined in the /etc/passwd file but not in the /etc/group file pose a threat to system security since group permissions are not properly managed." solution : "Analyze the output of the Audit step above and perform the appropriate action to correct any discrepancies found." reference : "800-53|AC-2,800-171|3.1.1,CN-L3|7.1.3.2(d),CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" name : "passwd_invalid_gid" system : "Linux" description : "6.2.16 Ensure no duplicate UIDs exist" info : "Users must be assigned unique UIDs for accountability and to ensure appropriate access protections." solution : "Based on the results of the audit script, establish unique UIDs and review all files owned by the shared UIDs to determine which UID they are supposed to belong to." reference : "800-53|IA-4,800-171|3.5.5,800-171|3.5.6,CN-L3|7.1.2.7(b),CSF|PR.AC-1,ITSG-33|IA-4,CCE|CCE-27503-2,HIPAA|164.312(a)(2)(i),LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.1.1" see_also : "https://workbench.cisecurity.org/files/1860" name : "passwd_duplicate_uid" system : "Linux" description : "6.2.17 Ensure no duplicate GIDs exist" info : "User groups must be assigned unique GIDs for accountability and to ensure appropriate access protections." solution : "Based on the results of the audit script, establish unique GIDs and review all files owned by the shared GID to determine which group they are supposed to belong to." reference : "800-53|IA-4,800-171|3.5.5,800-171|3.5.6,CN-L3|7.1.2.7(b),CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" name : "group_duplicate_gid" system : "Linux" description : "6.2.18 Ensure no duplicate user names exist" info : "If a user is assigned a duplicate user name, it will create and have access to files with the first UID for that username in /etc/passwd. For example, if 'test4' has a UID of 1000 and a subsequent 'test4' entry has a UID of 2000, logging in as 'test4' will use UID 1000. Effectively, the UID is shared, which is a security problem." solution : "Based on the results of the audit script, establish unique user names for the users. File ownerships will automatically reflect the change as long as the users have unique UIDs." reference : "800-53|IA-4,800-171|3.5.5,800-171|3.5.6,CN-L3|7.1.2.7(b),CSF|PR.AC-1,ITSG-33|IA-4,CCE|CCE-80208-2,HIPAA|164.312(a)(2)(i),LEVEL|1S,PCI-DSS|2.2.4,PCI-DSS|8.1.1" see_also : "https://workbench.cisecurity.org/files/1860" name : "passwd_duplicate_username" system : "Linux" description : "6.2.19 Ensure no duplicate group names exist" info : "If a group is assigned a duplicate group name, it will create and have access to files with the first GID for that group in /etc/group. Effectively, the GID is shared, which is a security problem." solution : "Based on the results of the audit script, establish unique names for the user groups. File group ownerships will automatically reflect the change as long as the groups have unique GIDs." reference : "800-53|IA-4,800-171|3.5.5,800-171|3.5.6,CN-L3|7.1.2.7(b),CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,PCI-DSS|2.2.4" see_also : "https://workbench.cisecurity.org/files/1860" name : "group_duplicate_name" description : "CIS_Red_Hat_EL7_Server_L1_v2.2.0.audit from CIS Red Hat Enterprise Linux 7 Benchmark v2.2.0" info : "NOTE: Nessus has not identified that the chosen audit applies to the target device."