#
# This script is Copyright (C) 2004-2019 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.4 $
# $Date: 2019/10/22 $
#
# Description : This document consists of a list of best practice checks for a host running the Debian operating system.
# based on: https://workbench.cisecurity.org/files/2242
#
# NOTE : Some items in this .audit require site-specific data to be known to the user in order to function properly.
#
# Please update the following items and edit their values accordingly.
#
#
#CIS Debian 9 Server L1 v1.0.0
#
# CIS
# Debian 9 Server L1
# 1.0.0
# https://workbench.cisecurity.org/files/2242
#
#unix,cis,debian,debian_9,debian_9_server,server
#LEVEL,CSCv7
#
#
# NTP_SERVER
# 192\.168\.0\.1
# NTP server address
# The IP address or FQDN of the Network Time Protocol (NTP) server for your organization.
#
#
# HOSTS_ALLOW_NETWORK
# 192\.0\.2\.0\\/255\.255\.255\.0
# Hosts.allow network
# The IP address and network mask allowed access to the system as it appears in hosts.allow. If all systems are allowed use 'ALL'.
#
#
# SYSLOG_SERVER
# 192.168.0.1
# Log server address
# The IP address or FQDN of the syslog server for your organization.
#
#
# BANNER_TEXT
# Authorized uses only. All activity may be monitored and reported.
# Banner text
# The message displayed prior to the login prompt on the GUI.
#
#
# PAM_DENY_VALUE
# 5
# PAM Max Password Attempts Value
# Maximum number of password attempts for PAM Common Auth settings that conform to your site policy.
#
#
# PAM_LOCKOUT_VALUE
# 900
# PAM Account Lockout Delay Value
# Account lockout delay for PAM Common Auth settings that conform to your site policy.
#
#
# PW_RETRY
# [1-3]
# 5.3.1 - Allowed PW Retries
# retry=3 - Allow 3 tries before sending back a failure.
#
#
# PW_MINLEN
# (1[4-9]|[2-9][0-9])
# 5.3.1 - PW minimum length
# minlen=14 - password must be 14 characters or more
#
#
# PW_DCREDIT
# -1
# 5.3.1 - PW number of digits
# dcredit=-1 - provide at least one digit
#
#
# PW_UCREDIT
# -1
# 5.3.1 - PW number of uppercase chars
# ucredit=-1 - provide at least one uppercase character
#
#
# PW_OCREDIT
# -1
# 5.3.1 - PW number of special chars
# ocredit=-1 - provide at least one special character
#
#
# PW_LCREDIT
# -1
# 5.3.1 - PW number of lowercase chars
# lcredit=-1 - provide at least one lowercase character
#
#
#
system : "Linux"
type : FILE_CONTENT_CHECK
description : "Debian found"
file : "/etc/debian_version"
regex : "^9"
expect : "^9"
description : "CIS_Debian_Linux_9_Server_v1.0.0_L1.audit Level 1"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.1 Ensure mounting of freevxfs filesystems is disabled - modprobe"
info : "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/freevxfs.conf
and add the following line:
install freevxfs /bin/true
Run the following command to unload the freevxfs module:
# rmmod freevxfs"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v freevxfs | /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 freevxfs filesystems is disabled - lsmod"
info : "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/freevxfs.conf
and add the following line:
install freevxfs /bin/true
Run the following command to unload the freevxfs module:
# rmmod freevxfs"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/lsmod | /bin/grep freevxfs | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.2 Ensure mounting of jffs2 filesystems is disabled - modprobe"
info : "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/jffs2.conf
and add the following line:
install jffs2 /bin/true
Run the following command to unload the jffs2 module:
# rmmod jffs2"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v jffs2 | /usr/bin/awk \'{print} END {if (NR == 0) print \"fail\"}\'"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.2 Ensure mounting of jffs2 filesystems is disabled - lsmod"
info : "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/jffs2.conf
and add the following line:
install jffs2 /bin/true
Run the following command to unload the jffs2 module:
# rmmod jffs2"
reference : "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),CSCv7|13,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep jffs2 | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.3 Ensure mounting of hfs filesystems is disabled - modprobe"
info : "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/hfs.conf
and add the following line:
install hfs /bin/true
Run the following command to unload the hfs module:
# rmmod hfs"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v hfs | /usr/bin/awk \'{print} END {if (NR == 0) print \"fail\"}\'"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.3 Ensure mounting of hfs filesystems is disabled - lsmod"
info : "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/hfs.conf
and add the following line:
install hfs /bin/true
Run the following command to unload the hfs module:
# rmmod hfs"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep hfs | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.4 Ensure mounting of hfsplus filesystems is disabled - modprobe"
info : "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/hfsplus.conf
and add the following line:
install hfsplus /bin/true
Run the following command to unload the hfsplus module:
# rmmod hfsplus"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v hfsplus | /usr/bin/awk \'{print} END {if (NR == 0) print \"fail\"}\'"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.4 Ensure mounting of hfsplus filesystems is disabled - lsmod"
info : "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/hfsplus.conf
and add the following line:
install hfsplus /bin/true
Run the following command to unload the hfsplus module:
# rmmod hfsplus"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep hfsplus | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.5 Ensure mounting of udf filesystems is disabled - modprobe"
info : "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/udf.conf
and add the following line:
install udf /bin/true
Run the following command to unload the udf module:
# rmmod udf"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v udf | /usr/bin/awk \'{print} END {if (NR == 0) print \"fail\"}\'"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "1.1.1.5 Ensure mounting of udf filesystems is disabled - lsmod"
info : "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/udf.conf
and add the following line:
install udf /bin/true
Run the following command to unload the udf module:
# rmmod udf"
reference : "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),CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep udf | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.1.2 Ensure /tmp is configured - systemctl"
info : "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications.
Rationale:
Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw.
This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp."
solution : "Configure /etc/fstab as appropriate.
example:
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0
or
Run the following commands to enable systemd /tmp mounting:
systemctl unmask tmp.mount
systemctl enable tmp.mount
Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount:
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid
Impact:
Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition.
Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily.
/tmp utalizing tmpfs can be resized using the size={size} parameter on the Options line on the tmp.mount file"
reference : "CIP|007-6-R1,CSCv7|5.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"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/systemctl is-enabled tmp.mount"
expect : "enabled"
system : "Linux"
type : CMD_EXEC
description : "1.1.2 Ensure /tmp is configured - mount"
info : "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications.
Rationale:
Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw.
This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp."
solution : "Configure /etc/fstab as appropriate.
example:
tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0
or
Run the following commands to enable systemd /tmp mounting:
systemctl unmask tmp.mount
systemctl enable tmp.mount
Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount:
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid
Impact:
Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition.
Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily.
/tmp utalizing tmpfs can be resized using the size={size} parameter on the Options line on the tmp.mount file"
reference : "800-171|3.4.2,800-53|CM-6,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /tmp"
expect : ".*on[\\s]+/tmp[\\s]+type.*"
system : "Linux"
type : CMD_EXEC
description : "1.1.3 Ensure nodev option set on /tmp partition"
info : "The nodevmount option specifies that the filesystem cannot contain special devices.
Rationale:
Since the /tmpfilesystem 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 : "If using the /etc/fstab for configuring /tmp do the following:
Edit the /etc/fstabfile and add nodevto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information.
Run the following command to remount /tmp:
# mount -o remount,nodev /tmp
If using systemd tmp.mount for configuring /tmp do the following:
Edit /etc/systemd/system/local-fs.target.wants/tmp.mount and add the nodev option to the Options line
Example:
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid
Run the following command to remount /tmp:
# mount -o remount,nosuid /tmp
Notes:
If the /etc/fstab includes /tmp it will take precedence over the tmp.mount file"
reference : "800-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /tmp"
expect : "[\\s]*[,]?nodev"
system : "Linux"
type : CMD_EXEC
description : "1.1.4 Ensure nosuid option set on /tmp partition"
info : "The nosuidmount option specifies that the filesystem cannot contain setuid files.
Rationale:
Since the /tmpfilesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp."
solution : "If using the /etc/fstab for configuring /tmp do the following:
Edit the /etc/fstab file and add nosuidto the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information.
Run the following command to remount /tmp:
# mount -o remount,nosuid /tmp
If using systemd tmp.mount for configuring /tmp do the following:
Edit /etc/systemd/system/local-fs.target.wants/tmp.mount and add the nosuid option to the Options line
Example:
[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid
Run the following command to remount /tmp:
# mount -o remount,nosuid /tmp
Notes:
If the /etc/fstab includes /tmp it will take precedence over the tmp.mount file"
reference : "800-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /tmp"
expect : "[\\s]*[,]?nosuid"
system : "Linux"
type : CMD_EXEC
description : "1.1.5 Ensure noexec option set on /tmp partition"
info : "The noexec mount option specifies that the filesystem cannot contain executable binaries.
Rationale:
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
Notes:
systemd includes the tmp.mount service which should be used instead of configuring /etc/fstab. Mounting options are configured in the Options setting in /etc/systemd/system/local-fs.target.wants/tmp.mount."
reference : "800-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /tmp"
expect : "[\\s]*[,]?noexec"
system : "Linux"
type : CMD_EXEC
description : "1.1.8 Ensure nodev option set on /var/tmp partition"
info : "The nodev mount option specifies that the filesystem cannot contain special devices.
Rationale:
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-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /var/tmp"
expect : "[\\s]*[,]?nodev"
system : "Linux"
type : CMD_EXEC
description : "1.1.9 Ensure nosuid option set on /var/tmp partition"
info : "The nosuid mount option specifies that the filesystem cannot contain setuid files.
Rationale:
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-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /var/tmp"
expect : "[\\s]*[,]?nosuid"
system : "Linux"
type : CMD_EXEC
description : "1.1.10 Ensure noexec option set on /var/tmp partition"
info : "The noexec mount option specifies that the filesystem cannot contain executable binaries.
Rationale:
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-171|3.1.5,800-53|AC-6,CSCv7|2.6,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /var/tmp"
expect : "[\\s]*[,]?noexec"
system : "Linux"
type : CMD_EXEC
description : "1.1.14 Ensure nodev option set on /home partition"
info : "The nodev mount option specifies that the filesystem cannot contain special devices.
Rationale:
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
Notes:
The actions in this recommendation refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well."
reference : "800-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /home"
expect : "[\\s]*[,]?nodev"
system : "Linux"
type : CMD_EXEC
description : "1.1.15 Ensure nodev option set on /dev/shm partition"
info : "The nodev mount option specifies that the filesystem cannot contain special devices.
Rationale:
Since the /run/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-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /dev/shm"
expect : "[\\s]*[,]?nodev"
system : "Linux"
type : CMD_EXEC
description : "1.1.16 Ensure nosuid option set on /dev/shm partition"
info : "The nosuid mount option specifies that the filesystem cannot contain setuid files.
Rationale:
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-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /dev/shm"
expect : "[\\s]*[,]?nosuid"
system : "Linux"
type : CMD_EXEC
description : "1.1.17 Ensure noexec option set on /dev/shm partition"
info : "The noexec mount option specifies that the filesystem cannot contain executable binaries.
Rationale:
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-171|3.1.5,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.4.4,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM31,NIAv2|GS3,NIAv2|GS4,NIAv2|GS8c,NIAv2|VL3b,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep /dev/shm"
expect : "[\\s]*[,]?noexec"
system : "Linux"
type : CMD_EXEC
description : "1.1.18 Ensure nodev option set on removable media partitions"
info : "The nodev mount option specifies that the filesystem cannot contain special devices.
Rationale:
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-171|3.1.7,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep -p \'on[\\s]+/dev/(floppy|cdrom|corder|mmcblk)\'"
expect : "nodev"
system : "Linux"
type : CMD_EXEC
description : "1.1.19 Ensure nosuid option set on removable media partitions"
info : "The nosuid mount option specifies that the filesystem cannot contain setuid files.
Rationale:
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-171|3.1.7,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep -P \'on[\\s]+/dev/(floppy|cdrom|corder|mmcblk)\'"
expect : "nosuid"
system : "Linux"
type : CMD_EXEC
description : "1.1.20 Ensure noexec option set on removable media partitions"
info : "The noexec mount option specifies that the filesystem cannot contain executable binaries.
Rationale:
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-171|3.1.7,800-53|AC-6,CSCv7|2.6,CSF|PR.AC-4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/mount | /bin/grep -P \'on[\\s]+/dev/(floppy|cdrom|corder|mmcblk)\'"
expect : "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
Notes:
Some distributions may not support the --local option to df."
reference : "800-171|3.1.1,800-171|3.1.2,800-53|AC-3,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,LEVEL|1S,NESA|T5.5.4,NESA|T7.5.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives.
Rationale:
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.
Notes:
This control should align with the tolerance of the use of portable drives and optical media in the organization. On a server requiring an admin to manually mount media can be part of defense-in-depth to reduce the risk of unapproved software or information being introduced or proprietary software or information being exfiltrated. If admins commonly use flash drives and Server access has sufficient physical controls, requiring manual mounting may not increase security."
reference : "CIP|007-6-R1,CSCv7|8.4,CSCv7|8.5,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/2242"
cmd : "/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 : "Systems need to have package manager repositories configured to ensure they receive the latest patches and updates.
Rationale:
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-171|3.14.1,800-53|SI-2,CSCv7|3.4,CSCv7|3.5,CSF|ID.RA-1,CSF|PR.IP-12,ITSG-33|SI-2,LEVEL|1NS,NESA|T7.6.2,NESA|T7.7.1,NIAv2|PR9,SWIFT-CSCv1|2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/apt-cache policy"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "1.2.2 Ensure GPG keys are configured"
info : "Most packages managers implement GPG key signing to verify package integrity during installation.
Rationale:
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.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance."
solution : "Update your package manager GPG keys in accordance with site policy."
reference : "800-53|SI-7,CSCv7|3.4,CSCv7|3.5,CSF|PR.DS-6,LEVEL|1NS,SWIFT-CSCv1|6.2"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/apt-key list"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "1.3.1 Ensure AIDE is installed"
info : "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system.
Rationale:
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:
# apt-get install aide aide-common
Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options.
Initialize AIDE:
# aideinit"
reference : "800-171|3.4.8,800-53|CM-7,CSCv7|14.9,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.5.1,ISO/IEC-27001|A.12.6.2,LEVEL|1S,PCI-DSSv3.1|12.3.7,PCI-DSSv3.2|12.3.7,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s aide 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "1.3.2 Ensure filesystem integrity is regularly checked - crontab"
cmd : "/usr/bin/crontab -u root -l | /bin/grep aide"
expect : "^((\\d{1,2}|\\*)[\\s]+){5}\\/usr\\/bin\\/aide[\\s]+--config[\\s]+\\/etc\\/aide\\/aide\\.conf[\\s]+--check$"
system : "Linux"
type : CMD_EXEC
description : "1.3.2 Ensure filesystem integrity is regularly checked - /etc/cron.*"
cmd : "/bin/grep -r aide /etc/cron.* /etc/crontab"
expect : "^((\\d{1,2}|\\*)[\\s]+){5}\\/usr\\/bin\\/aide[\\s]+--config[\\s]+\\/etc\\/aide\\/aide\\.conf[\\s]+--check$"
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.
Rationale:
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/bin/aide --config /etc/aide/aide.conf --check"
reference : "CSCv7|14.9,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
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.
Rationale:
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/bin/aide --config /etc/aide/aide.conf --check"
reference : "800-53|SI-7,CN-L3|7.1.3.5(b),CSCv7|14.9,CSF|PR.DS-6,ITSG-33|SI-7,LEVEL|1S,SWIFT-CSCv1|6.2"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : FILE_CHECK
description : "1.4.1 Ensure permissions on bootloader config are configured"
info : "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub.
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/grub/grub.cfg
# chmod og-rwx /boot/grub/grub.cfg
Notes:
This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings."
reference : "800-53|SI-7,CSCv6|3.1,CSCv7|5.1,CSF|PR.DS-6,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/boot/grub/grub.cfg"
owner : "root"
mask : "177"
group : "root"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "1.4.2 Ensure bootloader password is set - set superusers"
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 grub-mkpasswd-pbkdf2:
# grub-mkpasswd-pbkdf2
Enter password:
Reenter password:
Your PBKDF2 is
Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file:
cat <\"
password_pbkdf2
EOF
Run the following command to update the grub2 configuration:
# update-grub
Notes:
This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings."
reference : "800-53|SI-7,CSCv7|5.1,CSF|PR.DS-6,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/boot/grub/grub.cfg"
regex : "^[\\s]*set[\\s]*superusers[\\s]*="
expect : "^[\\s]*set[\\s]*superusers[\\s]*=\".+\"*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "1.4.2 Ensure bootloader password is set - password_pbkdf2"
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 grub-mkpasswd-pbkdf2:
# grub-mkpasswd-pbkdf2
Enter password:
Reenter password:
Your PBKDF2 is
Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file:
cat <\"
password_pbkdf2
EOF
Run the following command to update the grub2 configuration:
# update-grub
Notes:
This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings."
reference : "800-53|SI-7,CSCv7|5.1,CSF|PR.DS-6,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/boot/grub/grub.cfg"
regex : "^[\\s]*password"
expect : "^[\\s]*password_pbkdf2[\\s]+[^\\s]+[\\s]+[^\\s]+[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK_NOT
description : "1.4.3 Ensure authentication required for single user mode"
info : "Single user 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 prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials."
solution : "Run the following command and follow the prompts to set a password for the rootuser:
# passwd root"
reference : "800-53|IA-5,CSCv7|5.1,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,SWIFT-CSCv1|4.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/shadow"
regex : "^root:"
expect : "^root:[\\*!]:"
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-171|3.1.7,800-53|AC-6,CSCv7|13,CSF|PR.AC-4,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
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-171|3.1.7,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/sysctl fs.suid_dumpable"
expect : "^[\\s]*fs\\.suid_dumpable[\\s]*=[\\s]*0[\\s]*$"
type : CMD_EXEC
description : "1.5.2 Ensure XD/NX support is enabled"
info : "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature.
Rationale:
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.
Notes:
Ensure your system supports the XD or NX bit and has PAE support before implementing this recommendation as this may prevent it from booting if these are not supported by your hardware."
reference : "800-53|SI-16,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/dmesg | /bin/grep \'NX (Execute\' 2>&1"
expect : "NX[\\s]+\\(Execute[\\s]+Disable\\)[\\s]+protection:[\\s]+active"
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 : "CSCv7|8.3,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
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"
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,CSCv7|8.5,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -P \'^[\\s]*kernel\\.randomize_va_space[\\s]*=[\\s]*2[\\s]*$\' /etc/sysctl.conf /etc/sysctl.d/* |/usr/bin/awk \'{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "1.5.4 Ensure prelink is disabled"
info : "prelinkis a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases.
Rationale:
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 command to restore binaries to normal:
# prelink -ua
Run the following command to uninstall prelink:
# apt-get remove prelink"
reference : "800-171|3.4.8,800-53|CM-7,CSCv7|14.9,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,LEVEL|1S,NIAv2|SS13a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s prelink 2>&1"
expect : "^[\\s]*dpkg-query: package \\'prelink\\' is not installed and no information is available[\\s]*"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/motd"
regex : "(\\\\[mrsv]|[Dd]ebian)"
expect : "(\\\\[mrsv]|[Dd]ebian)"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/issue"
regex : "(\\\\[mrsv]|[Dd]ebian)"
expect : "(\\\\[mrsv]|[Dd]ebian)"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/issue.net"
regex : "(\\\\[mrsv]|[Dd]ebian)"
expect : "(\\\\[mrsv]|[Dd]ebian)"
system : "Linux"
type : FILE_CHECK
description : "1.7.1.4 Ensure permissions on /etc/motd are configured"
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.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/motd"
mask : "133"
system : "Linux"
type : FILE_CHECK
description : "1.7.1.5 Ensure permissions on /etc/issue are configured"
info : "The contents of the /etc/issue file are displayed to users prior to login for local terminals.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/issue"
mask : "133"
system : "Linux"
type : FILE_CHECK
description : "1.7.1.6 Ensure permissions on /etc/issue.net are configured"
info : "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/issue.net"
mask : "133"
system : "Linux"
type : CMD_EXEC
description : "Check GDM installed"
cmd : "/usr/bin/dpkg -s gdm3 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
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 : "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following:
[org/gnome/login-screen]
banner-message-enable=true
banner-message-text='Authorized uses only. All activity may be monitored and reported.'
Notes:
Additional options and sections may appear in the /etc/dconf/db/gdm.d/01-banner-message file.
If a different GUI login service is in use, consult your documentation and apply an equivalent banner."
reference : "800-171|3.1.9,800-53|AC-8,CSCv7|5.1,ITSG-33|AC-8,LEVEL|1S,NESA|M1.3.6,NESA|M5.2.5,NESA|T5.5.1,NIAv2|AM10a,NIAv2|AM10b,NIAv2|AM10c,NIAv2|AM10d,NIAv2|AM10e"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/gdm3/greeter.dconf-defaults"
regex : "^[\\s]*banner-message-enable[\\s]*="
expect : "^[\\s]*banner-message-enable[\\s]*=[\\s]*true[\\s]*$"
system : "Linux"
type : BANNER_CHECK
description : "1.7.2 Ensure GDM login banner is configured - banner 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 : "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following:
[org/gnome/login-screen]
banner-message-enable=true
banner-message-text='Authorized uses only. All activity may be monitored and reported.'
Notes:
Additional options and sections may appear in the /etc/dconf/db/gdm.d/01-banner-message file.
If a different GUI login service is in use, consult your documentation and apply an equivalent banner."
reference : "800-171|3.1.9,800-53|AC-8,CSCv7|5.1,ITSG-33|AC-8,LEVEL|1S,NESA|M1.3.6"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/gdm3/greeter.dconf-defaults"
# Note: Variable @BANNER_TEXT@ replaced with "Authorized uses only. All activity may be monitored and reported." in field "content".
content : "Authorized uses only. All activity may be monitored and reported."
is_substring : YES
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 : "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following:
[org/gnome/login-screen]
banner-message-enable=true
banner-message-text='Authorized uses only. All activity may be monitored and reported.'
Notes:
Additional options and sections may appear in the /etc/dconf/db/gdm.d/01-banner-message file.
If a different GUI login service is in use, consult your documentation and apply an equivalent banner."
reference : "800-171|3.1.9,800-53|AC-8,CSCv7|5.1,ITSG-33|AC-8,LEVEL|1S,NESA|M1.3.6,NESA|M5.2.5,NESA|T5.5.1,NIAv2|AM10a,NIAv2|AM10b,NIAv2|AM10c,NIAv2|AM10d,NIAv2|AM10e"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "1.7.2 Ensure GDM login banner is configured - banner 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 : "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following:
[org/gnome/login-screen]
banner-message-enable=true
banner-message-text='Authorized uses only. All activity may be monitored and reported.'
Notes:
Additional options and sections may appear in the /etc/dconf/db/gdm.d/01-banner-message file.
If a different GUI login service is in use, consult your documentation and apply an equivalent banner."
reference : "800-171|3.1.9,800-53|AC-8,CSCv7|5.1,ITSG-33|AC-8,LEVEL|1S,NESA|M1.3.6"
see_also : "https://workbench.cisecurity.org/files/2242"
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.
Notes:
Site policy may mandate a testing period before install onto production systems for available updates."
reference : "800-171|3.14.1,800-53|SI-2,CSCv7|3.4,CSCv7|3.5,CSF|ID.RA-1,CSF|PR.IP-12,ITSG-33|SI-2,LEVEL|1NS,NESA|T7.6.2,NESA|T7.7.1,NIAv2|PR9,SWIFT-CSCv1|2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/apt-get -s upgrade"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "2.1.1 Ensure xinetd is not installed"
info : "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests.
Rationale:
If there are no xinetdservices required, it is recommended that the daemon be disabled."
solution : "Run the following command to disable xinetd:
# apt-get remove xinetd"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s xinetd 2>&1"
expect : "^[\\s]*dpkg-query: package \\'xinetd\\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.1.2 Ensure openbsd-inetd is not installed"
info : "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests.
Rationale:
If there are no inetd services required, it is recommended that the daemon be removed."
solution : "Run the following command and verify openbsd-inetd is not installed
apt-get remove openbsd-inetd"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s openbsd-inetd 2>&1"
expect : "^[\\s]*dpkg-query: package \\'openbsd-inetd\\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "Check NTP installed"
cmd : "/usr/bin/dpkg -s ntp 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "Check chrony installed"
cmd : "/usr/bin/dpkg -s chrony 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
description : "2.2.1.1 Ensure time synchronization is in use"
info : "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them.
Rationale:
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 install NTP or chrony using one of the following commands:
# apt-get install ntp
# apt-get install chrony
On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization."
reference : "CSCv7|6.1,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "2.2.1.1 Ensure time synchronization is in use"
info : "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them.
Rationale:
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.
NOTE: NTP or Chrony not installed."
solution : "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands:
# apt-get install ntp
# apt-get install chrony
On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization."
reference : "CSCv7|6.1,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "Check NTP installed"
cmd : "/usr/bin/dpkg -s ntp 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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]*){6}$"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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]*){6}$"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.3.7,800-53|AU-8,CSCv6|6.1,CSCv7|6.1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,LEVEL|1S,NESA|T3.6.7,NIAv2|NS44,NIAv2|NS45,NIAv2|NS46,NIAv2|NS47,PCI-DSSv3.1|10.4,PCI-DSSv3.2|10.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ntp.conf"
# Note: Variable @NTP_SERVER@ replaced with "192\\.168\\.0\\.1" in field "regex".
regex : "^[\\s]*server[\\s]+192\\.168\\.0\\.1[\\s]*$"
# Note: Variable @NTP_SERVER@ replaced with "192\\.168\\.0\\.1" in field "expect".
expect : "^[\\s]*server[\\s]+192\\.168\\.0\\.1[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "2.2.1.2 Ensure ntp is configured - RUNASUSER"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/init.d/ntp"
regex : "^[\\s]*RUNASUSER[\\s]*="
expect : "^[\\s]*RUNASUSER[\\s]*=[\\s]*ntp[\\s]*$"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.3.7,800-53|AU-8,CSCv6|6.1,CSCv7|6.1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.4,ITSG-33|AU-8,LEVEL|1S,NESA|T3.6.7,NIAv2|NS44,NIAv2|NS45,NIAv2|NS46,NIAv2|NS47,PCI-DSSv3.1|10.4,PCI-DSSv3.2|10.4"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "2.2.1.2 Ensure ntp is configured - RUNASUSER"
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. 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
Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file:
RUNASUSER=ntp"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|6.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "Check chrony installed"
cmd : "/usr/bin/dpkg -s chrony 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "2.2.1.3 Ensure chrony is configured"
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 http://chrony.tuxfamily.org/. 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/chrony.conf as appropriate:
server "
reference : "800-171|3.1.4,800-53|AC-5,CSCv7|6.1,CSF|PR.DS-5,ITSG-33|AC-5,LEVEL|1S,NESA|T5.1.1,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/chrony/chrony.conf"
regex : "^(server|pool)"
# Note: Variable @NTP_SERVER@ replaced with "192\\.168\\.0\\.1" in field "expect".
expect : "^[\\s]*(server|pool)[\\s]+192\\.168\\.0\\.1"
description : "2.2.1.3 Ensure chrony is configured"
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 http://chrony.tuxfamily.org/. 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/chrony.conf as appropriate:
server "
reference : "800-171|3.1.4,800-53|AC-5,CSCv7|6.1,CSF|PR.DS-5,ITSG-33|AC-5,LEVEL|1S,NESA|T5.1.1,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "2.2.2 Ensure X Window System is not installed"
info : "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login.
Rationale:
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:
apt-get remove xserver-xorg*"
reference : "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),CSCv7|2.6,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -l xserver-xorg*"
expect : "^[\\s]*dpkg-query: package \\'xserver-xorg.*\\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.2.3 Ensure Avahi Server is not enabled"
info : "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine.
Rationale:
Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface."
solution : "Run the following command to disable avahi-daemon:
# systemctl disable avahi-daemon"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/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 : "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability.
Rationale:
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,CSCv7|9.2,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/2242"
cmd : "/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 - dhcpd"
info : "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses.
Rationale:
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 commands to disable dhcpd:
# systemctl disable isc-dhcp-server
# systemctl disable isc-dhcp-server6"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled isc-dhcp-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.5 Ensure DHCP Server is not enabled - isc-dhcp-server6"
info : "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses.
Rationale:
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 commands to disable dhcpd:
# systemctl disable isc-dhcp-server
# systemctl disable isc-dhcp-server6"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled isc-dhcp-server6 | /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 : "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database.
Rationale:
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,CSCv7|9.2,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/2242"
cmd : "/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-server"
info : "The Network ob体育 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 and rpcbind:
# systemctl disable nfs-server
# systemctl disable rpcbind"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/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 ob体育 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 and rpcbind:
# systemctl disable nfs-server
# systemctl disable rpcbind"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled rpcbind | /usr/bin/awk \'{print} END { if(NR==0) print \"disabled\" }\'"
expect : "disabled"
dont_echo_cmd : YES
system : "Linux"
type : CMD_EXEC
description : "2.2.8 Ensure DNS Server is not enabled"
info : "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network.
Rationale:
Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface."
solution : "Run the following command to disable named:
# systemctl disable bind9"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled bind9 | /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 : "The ob体育 Transfer Protocol (FTP) provides networked computers with the ability to transfer files.
Rationale:
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 package be deleted to reduce the potential attack surface."
solution : "Run the following command to disable vsftpd:
# systemctl disable vsftpd"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/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 : "HTTP or web servers provide the ability to host web site content.
Rationale:
Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface."
solution : "Run the following command to disable apache2:
# systemctl disable apache2"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled apache2 | /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 : "exim is an open source IMAP and POP3 server for Linux based systems.
Rationale:
Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface."
solution : "Run the following commands to remove exim:
# apt-get remove exim4
# apt-get purge exim4
Notes:
Several IMAP/POP3 servers exist and can use other service names. dovecot and cyrus-imap are example services that provide a mail server. These and other services should also be audited."
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s exim4"
expect : "^[\\s]*dpkg-query: package \\'exim4\\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.2.12 Ensure Samba is not enabled"
info : "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems.
Rationale:
If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface."
solution : "Run the following command to disable smbd:
# systemctl disable smbd"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled smbd | /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 : "Squid is a standard proxy server used in many distributions and environments.
Rationale:
If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface."
solution : "Run the following command to disable squid:
# systemctl disable squid"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/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
Notes:
Additional methods of disabling a service exist. Consult your distribution documentation for appropriate methods."
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled snmpd | /usr/bin/awk \'{print} END { if(NR==0) print \"disabled\" }\'"
expect : "disabled"
dont_echo_cmd : YES
system : "Linux"
type : CMD_EXEC
description : "Check if Postfix is installed"
cmd : "/usr/bin/dpkg -s postfix 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "2.2.15 Ensure mail transfer agent is configured for local-only mode - netstat"
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-171|3.4.2,800-53|CM-6,CSCv7|9.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "netstat -an | grep LIST | grep \":25[[:space:]]\" | grep -v \"127.0.0.1:25\" | grep -v \"::1:25\" | awk \'{print} END { if(NR==0) print \"pass\" }\'"
expect : "pass"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "2.2.15 Ensure mail transfer agent is configured for local-only mode - /etc/postfix/main.cf"
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
Notes:
This recommendation is designed around the postfix mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state."
reference : "800-171|3.4.2,800-53|CM-6,CIP|007-6-R1,CSCv6|3.1,CSCv7|9.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/postfix/main.cf"
regex : "^[\\s]*inet_interfaces[\\s]*=[\\s]*"
expect : "^[\\s]*inet_interfaces[\\s]*=[\\s]*loopback-only[\\s]*$"
description : "2.2.15 Ensure mail transfer agent is configured for local-only mode - netstat"
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-171|3.4.2,800-53|CM-6,CSCv7|9.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "2.2.15 Ensure mail transfer agent is configured for local-only mode - /etc/postfix/main.cf"
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-171|3.4.2,800-53|CM-6,CIP|007-6-R1,CSCv6|3.1,CSCv7|9.2,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "2.2.16 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 rsync"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled rsync | /usr/bin/awk \'{print} END { if(NR==0) print \"disabled\" }\'"
expect : "disabled"
dont_echo_cmd : YES
system : "Linux"
type : CMD_EXEC
description : "2.2.17 Ensure NIS Server is not enabled"
info : "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files.
Rationale:
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 nis:
# systemctl disable nis"
reference : "CIP|007-6-R1,CSCv7|9.2,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/2242"
cmd : "/bin/systemctl is-enabled nis | /usr/bin/awk \'{print} END { if(NR==0) print \"disabled\" }\'"
expect : "disabled"
dont_echo_cmd : YES
system : "Linux"
type : CMD_EXEC
description : "2.3.1 Ensure NIS Client is not installed"
info : "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files.
Rationale:
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 nis:
apt-get remove nis
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-171|3.4.8,800-53|CM-7,CSCv7|2.6,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,LEVEL|1S,NIAv2|SS13a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s nis 2>&1"
expect : "^[\\s]*dpkg-query: package \\'nis\\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.3.2 Ensure rsh client is not installed - rsh-client"
info : "The rsh package contains the client commands for the rsh services.
Rationale:
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 rshpackage removes the clients for rsh, rcpand rlogin."
solution : "Run the following command to uninstall rsh:
apt-get remove rsh-client rsh-redone-client"
reference : "800-171|3.4.8,800-53|CM-7,CSCv7|4.5,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,LEVEL|1S,NIAv2|SS13a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s rsh-client 2>&1"
expect : "^[\\s]*dpkg-query: package \'rsh-client\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.3.2 Ensure rsh client is not installed - rsh-redone-client"
info : "The rsh package contains the client commands for the rsh services.
Rationale:
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 rshpackage removes the clients for rsh, rcpand rlogin."
solution : "Run the following command to uninstall rsh:
apt-get remove rsh-client rsh-redone-client
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-171|3.4.8,800-53|CM-7,CSCv7|4.5,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,LEVEL|1S,NIAv2|SS13a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s rsh-redone-client 2>&1"
expect : "^[\\s]*dpkg-query: package \'rsh-redone-client\'[\\s]+is[\\s]+not[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "2.3.3 Ensure talk client is not installed"
info : "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default.
Rationale:
The software presents a security risk as it uses unencrypted protocols for communication."
solution : "Run the following command to uninstall talk:
apt-get remove talk"
reference : "800-171|3.4.8,800-53|CM-7,CSCv7|2.6,CSF|PR.IP-1,CSF|PR.PT-3,ISO/IEC-27001|A.12.6.2,LEVEL|1S,NIAv2|SS13a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s talk 2>&1"
expect : "^[\\s]*dpkg-query: package \'talk\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.3.4 Ensure telnet client is not installed"
info : "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol.
Rationale:
The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The sshpackage provides an encrypted session and stronger security and is included in most Linux distributions."
solution : "Run the following command to uninstall telnet:
# apt-get 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-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),CSCv7|4.5,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s telnet 2>&1"
expect : "^[\\s]*dpkg-query: package \'telnet\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "2.3.5 Ensure LDAP client is not installed"
info : "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database.
Rationale:
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 : "Uninstall ldap-utils using the appropriate package manager or manual installation:
# apt-get remove ldap-utils
Impact:
Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment."
reference : "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),CSCv7|2.6,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s ldap-utils 2>&1"
expect : "^[\\s]*dpkg-query: package \'ldap-utils\' is not installed and no information is available[\\s]*"
system : "Linux"
type : CMD_EXEC
description : "3.1.1 Ensure IP forwarding is disabled - ipv4 sysctl"
info : "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not.
Rationale:
Setting the flags 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
net.ipv6.conf.all.forwarding = 0
Run the following commands to set the active kernel parameters:
# sysctl -w net.ipv4.ip_forward=0
# sysctl -w net.ipv6.conf.all.forwarding=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - ipv4 /etc/sysctl.conf /etc/sysctl.d/*"
info : "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not.
Rationale:
Setting the flags 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
net.ipv6.conf.all.forwarding = 0
Run the following commands to set the active kernel parameters:
# sysctl -w net.ipv4.ip_forward=0
# sysctl -w net.ipv6.conf.all.forwarding=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.ip_forward[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'"
expect : "^pass$"
system : "Linux"
type : CMD_EXEC
description : "3.1.1 Ensure IP forwarding is disabled - ipv6 sysctl"
info : "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not.
Rationale:
Setting the flags 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
net.ipv6.conf.all.forwarding = 0
Run the following commands to set the active kernel parameters:
# sysctl -w net.ipv4.ip_forward=0
# sysctl -w net.ipv6.conf.all.forwarding=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/sysctl net.ipv6.conf.all.forwarding"
expect : "^[\\s]*net\\.ipv6\\.conf\\.all\\.forwarding[\\s]*=[\\s]*0[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "3.1.1 Ensure IP forwarding is disabled - ipv6 /etc/sysctl.conf /etc/sysctl.d/*"
info : "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not.
Rationale:
Setting the flags 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
net.ipv6.conf.all.forwarding = 0
Run the following commands to set the active kernel parameters:
# sysctl -w net.ipv4.ip_forward=0
# sysctl -w net.ipv6.conf.all.forwarding=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.all\\.forwarding[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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 - default sysctl"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - default /etc/sysctl.conf /etc/sysctl.d/*"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.default\\.send_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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 - all sysctl"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - all /etc/sysctl.conf /etc/sysctl.d/*"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.all\\.send_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.all\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv4\\.conf\\.default\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.ipv6.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/sysctl net.ipv6.conf.all.accept_source_route"
expect : "^[\\s]*net\\.ipv6\\.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 - net.ipv6.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/sysctl net.ipv6.conf.default.accept_source_route"
expect : "^[\\s]*net\\.ipv6\\.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 - files 'net.ipv6.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.all\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.ipv6.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, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.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
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.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.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E '^[[:space:]]*net\\.ipv6\\.conf\\.default\\.accept_source_route[[:space:]]*=[[:space:]]*0[[:space:]]*$' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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"
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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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'"
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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.all\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.default\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.ipv6.conf.all.accept_redirects"
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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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.2.2 Ensure ICMP redirects are not accepted - 'net.ipv6.conf.default.accept_redirects'"
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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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.2.2 Ensure ICMP redirects are not accepted - files net.ipv6.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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv6\\.conf\\.all\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.ipv6.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
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.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv6\\.conf\\.default\\.accept_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.all\\.secure_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.default\\.secure_redirects[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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 : "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-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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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-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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "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-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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.all\\.log_martians[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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-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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.default\\.log_martians[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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 - net.ipv4.icmp_echo_ignore_broadcasts = 1"
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 parameters 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - files net.ipv4.icmp_echo_ignore_broadcasts = 1"
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 parameters 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.icmp_echo_ignore_broadcasts[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* |/usr/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 - net.ipv4.icmp_ignore_bogus_error_responses = 1"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - files net.ipv4.icmp_ignore_bogus_error_responses = 1"
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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.icmp_ignore_bogus_error_responses[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.all\\.rp_filter[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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.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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.conf\\.default\\.rp_filter[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/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 - net.ipv4.tcp_syncookies = 1"
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 parameters 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - files net.ipv4.tcp_syncookies = 1"
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 parameters 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv4\\.tcp_syncookies[[:space:]]*=[[:space:]]*1[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* | /usr/bin/awk \'{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}\'"
expect : "^pass$"
system : "Linux"
type : CMD_EXEC
description : "3.2.9 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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.2.9 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
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.2.9 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv6\\.conf\\.all\\.accept_ra[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* |/usr/bin/awk \'{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}\'"
expect : "^pass$"
system : "Linux"
type : CMD_EXEC
description : "3.2.9 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-171|3.13.1,800-53|SC-7,CSCv7|5.1,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -s -E \'^[[:space:]]*net\\.ipv6\\.conf\\.default\\.accept_ra[[:space:]]*=[[:space:]]*0[[:space:]]*$\' /etc/sysctl.conf /etc/sysctl.d/* |/usr/bin/awk \'{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}\'"
expect : "^pass$"
system : "Linux"
type : CMD_EXEC
description : "3.3.1 Ensure TCP Wrappers is installed"
info : "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetdand xinetdsupported the use of tcp wrappers. As inetdand xinetdhave been falling in disuse, any service that can support tcp wrappers will have the libwrap.solibrary attached to it.
Rationale:
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:
apt-get install tcpd
Notes:
To verify if a service supports TCP Wrappers, run the following command:
# ldd | grep libwrap.so
If there is any output, then the service supports TCP Wrappers."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s tcpd 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "3.3.2 Ensure /etc/hosts.allow is configured"
info : "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file.
Rationale:
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.
Notes:
Contents of the /etc/hosts.allow file will vary depending on your network configuration."
reference : "800-171|3.13.1,800-171|3.13.6,800-53|SC-7,CN-L3|7.1.2.2(c),CSCv7|9.4,CSF|PR.PT-4,ITSG-33|SC-7,LEVEL|1NS,NIAv2|GS7b,NIAv2|NS25"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/hosts.allow"
regex : "^[\\s]*ALL[\\s]*:"
# Note: Variable @HOSTS_ALLOW_NETWORK@ replaced with "192\\.0\\.2\\.0\\\\/255\\.255\\.255\\.0" in field "expect".
expect : "^[\\s]*ALL[\\s]*:[\\s]*192\\.0\\.2\\.0\\\\/255\\.255\\.255\\.0[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "3.3.3 Ensure /etc/hosts.deny is configured"
info : "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allowfile.
Rationale:
The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allowis denied access to the system."
solution : "Run the following command to create /etc/hosts.deny:
# echo \"ALL: ALL\" >> /etc/hosts.deny
Notes:
Contents of the /etc/hosts.deny file may include additional options depending on your network configuration."
reference : "800-171|3.13.1,800-171|3.13.6,800-53|SC-7,CN-L3|7.1.2.2(c),CSCv7|9.4,CSF|PR.PT-4,ITSG-33|SC-7,LEVEL|1NS,NIAv2|GS7b,NIAv2|NS25"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/hosts.deny"
regex : "^[\\s]*ALL:"
expect : "^[\\s]*ALL:[\\s]*ALL$"
system : "Linux"
type : FILE_CHECK
description : "3.3.4 Ensure permissions on /etc/hosts.allow are configured"
info : "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/hosts.allow"
mask : "133"
system : "Linux"
type : FILE_CHECK
description : "3.3.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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/hosts.deny"
mask : "133"
system : "Linux"
type : CMD_EXEC
description : "3.4.1 Ensure DCCP is disabled - modprobe"
info : "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/dccp.conf
and add the following line:
install dccp /bin/true"
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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v dccp"
expect : "install[\\s]+/bin/true"
system : "Linux"
type : CMD_EXEC
description : "3.4.1 Ensure DCCP is disabled - lsmod"
info : "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/dccp.conf
and add the following line:
install dccp /bin/true"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep dccp | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\" ; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "3.4.2 Ensure SCTP is disabled - modprobe"
info : "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/sctp.conf
and add the following line:
install sctp /bin/true"
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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v sctp"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "3.4.2 Ensure SCTP is disabled - lsmod"
info : "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/sctp.conf
and add the following line:
install sctp /bin/true"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep sctp | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\"; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "3.4.3 Ensure RDS is disabled - modprobe"
info : "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/rds.conf
and add the following line:
install rds /bin/true"
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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v rds"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "3.4.3 Ensure RDS is disabled - lsmod"
info : "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/rds.conf
and add the following line:
install rds /bin/true"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep rds | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\"; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "3.4.4 Ensure TIPC is disabled - modprobe"
info : "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/tpic.conf
and add the following line:
install tipc /bin/true"
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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/modprobe -n -v tipc"
expect : "install /bin/true"
system : "Linux"
type : CMD_EXEC
description : "3.4.4 Ensure TIPC is disabled - lsmod"
info : "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes.
Rationale:
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 a file in the /etc/modprobe.d/ directory ending in .conf
Example: vim /etc/modprobe.d/tpic.conf
and add the following line:
install tipc /bin/true"
reference : "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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/lsmod | /bin/grep tipc | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\"; else print \"fail\"}\'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "3.5.1.1 Ensure default deny firewall policy - Chain INPUT"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iptables --list | /bin/grep 'Chain INPUT'"
regex : "^Chain INPUT \\(policy DROP\\)"
expect : "^Chain INPUT \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.1.1 Ensure default deny firewall policy - Chain FORWARD"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iptables --list | /bin/grep 'Chain FORWARD'"
regex : "^Chain FORWARD \\(policy DROP\\)"
expect : "^Chain FORWARD \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.1.1 Ensure default deny firewall policy - Chain OUTPUT"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iptables --list | /bin/grep 'Chain OUTPUT'"
regex : "^Chain OUTPUT \\(policy DROP\\)"
expect : "^Chain OUTPUT \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.1.2 Ensure loopback traffic is configured"
info : "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8).
Rationale:
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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iptables -L INPUT -v -n; /sbin/iptables -L OUTPUT -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.1.3 Ensure outbound and established connections are configured"
info : "Configure the firewall rules for new outbound, and established connections.
Rationale:
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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1NS,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iptables -L -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.1.4 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
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well.
The remediation command opens up the port to traffic from all sources. Consult iptables documentation and set any restrictions in compliance with site policy."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.2,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/netstat -ln; /sbin/iptables -L INPUT -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.2.1 Ensure IPv6 default deny firewall policy - Chain INPUT"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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:
# ip6tables -P INPUT DROP
# ip6tables -P OUTPUT DROP
# ip6tables -P FORWARD DROP
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/ip6tables --list | /bin/grep 'Chain INPUT'"
regex : "^Chain INPUT \\(policy DROP\\)"
expect : "^Chain INPUT \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.2.1 Ensure IPv6 default deny firewall policy - Chain FORWARD"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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:
# ip6tables -P INPUT DROP
# ip6tables -P OUTPUT DROP
# ip6tables -P FORWARD DROP
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/ip6tables --list | /bin/grep 'Chain FORWARD'"
regex : "^Chain FORWARD \\(policy DROP\\)"
expect : "^Chain FORWARD \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.2.1 Ensure IPv6 default deny firewall policy - Chain OUTPUT"
info : "A default deny all policy on connections ensures that any unconfigured network usage will be rejected.
Rationale:
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:
# ip6tables -P INPUT DROP
# ip6tables -P OUTPUT DROP
# ip6tables -P FORWARD DROP
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/ip6tables --list | /bin/grep 'Chain OUTPUT'"
regex : "^Chain OUTPUT \\(policy DROP\\)"
expect : "^Chain OUTPUT \\(policy DROP\\)"
system : "Linux"
type : CMD_EXEC
description : "3.5.2.2 Ensure IPv6 loopback traffic is configured"
info : "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1).
Rationale:
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 (::1) 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:
# ip6tables -A INPUT -i lo -j ACCEPT
# ip6tables -A OUTPUT -o lo -j ACCEPT
# ip6tables -A INPUT -s ::1 -j DROP
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/ip6tables -L INPUT -v -n; /sbin/iptables -L OUTPUT -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.2.3 Ensure IPv6 outbound and established connections are configured"
info : "Configure the firewall rules for new outbound, and established IPv6 connections.
Rationale:
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:
# ip6tables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
# ip6tables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
# ip6tables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
# ip6tables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
# ip6tables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
# ip6tables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1NS,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/ip6tables -L -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.2.4 Ensure IPv6 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:
# ip6tables -A INPUT -p --dport -m state --state NEW -j ACCEPT
Notes:
Changing firewall settings while connected over network can result in being locked out of the system.
Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well.
The remediation command opens up the port to traffic from all sources. Consult iptables documentation and set any restrictions in compliance with site policy."
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1NS,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/netstat -ln; /sbin/ip6tables -L INPUT -v -n"
expect : ""
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "3.5.3 Ensure iptables is installed"
info : "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables.
Rationale:
iptables is required for firewall management and configuration."
solution : "Run the following command to install iptables:
# apt-get install iptables"
reference : "800-171|3.13.1,800-53|SC-7,CSCv7|9.4,ITSG-33|SC-7,LEVEL|1S,NIAv2|AM38,NIAv2|SS13d,NIAv2|SS26"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/dpkg -s iptables 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "3.6 Ensure wireless interfaces are disabled"
info : "Wireless networking is used when wired networks are unavailable. Debian contains a wireless tool kit to allow system administrators to configure and use wireless networks.
Rationale:
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,CSCv7|15.4,CSCv7|15.5,CSF|PR.PT-4,ITSG-33|AC-18,LEVEL|1NS,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/sbin/iwconfig | /usr/bin/awk \'{print} END {if (NR == 0) print \"none\"}\'"
expect : "none"
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "Check for rsyslog package"
cmd : "/usr/bin/dpkg -s rsyslog 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.1 Ensure rsyslog Service is enabled"
info : "Once the rsyslog package is installed it needs to be activated.
Rationale:
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,CSCv7|15.5,CSCv7|6.2,CSCv7|6.3,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/2242"
cmd : "/bin/systemctl is-enabled rsyslog | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'"
expect : "enabled"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - '*.emerg :omusrmsg:*'"
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."
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 : "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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*\\*\\.emerg' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\*\\.emerg\\s+:omusrmsg:\\*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'mail.* -/var/log/mail'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*mail\\.\\*' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "mail\\.\\*[\\s]+-/var/log/mail[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'mail.info -/var/log/mail.info'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*mail\\.info' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "mail\\.info[\\s]+-/var/log/mail\\.info[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'mail.warning -/var/log/mail.warn'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*mail\\.warning' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "mail\\.warning[\\s]+-/var/log/mail\\.warn[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'mail.err /var/log/mail.err'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*mail\\.err' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "mail\\.err[\\s]+/var/log/mail\\.err[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'news.crit -/var/log/news/news.crit'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*news\\.crit' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "news\\.crit[\\s]+-/var/log/news/news\\.crit[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'news.err -/var/log/news/news.err'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*news\\.err' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "news\\.err[\\s]+-/var/log/news/news\\.err[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'news.notice -/var/log/news/news.notice'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*news\\.notice' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "news\\.notice[\\s]+-/var/log/news/news\\.notice[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - '*.=warning;*.=err -/var/log/warn'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*\\*\\.=warning;\\*\\.=err' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\*\\.=warning;\\*\\.=err[\\s]+-/var/log/warn[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - '*.crit /var/log/warn'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*\\*\\.crit' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\*\\.crit[\\s]+/var/log/warn[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - '*.*;mail.none;news.none -/var/log/messages'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*\\*\\.\\*;mail\.none;news\\.none' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\*\\.\\*;mail\\.none;news\\.none[\\s]+-/var/log/messages[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'local0,local1.* -/var/log/localmessages'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*local0,local1' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "local0,local1\\.\\*[\\s]+-/var/log/localmessages[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'local2,local3.* -/var/log/localmessages'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*local2,local3' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "local2,local3\\.\\*[\\s]+-/var/log/localmessages[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'local4,local5.* -/var/log/localmessages'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*local4,local5' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "local4,local5\\.\\*[\\s]+-/var/log/localmessages[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.2 ensure logging is configured - 'local6,local7.* -/var/log/localmessages'"
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."
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 : "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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '^\s*local6,local7' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "local6,local7\\.\\*[\\s]+-/var/log/localmessages[\\s]*$"
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 $ob体育CreateMode to 0640 or more restrictive:
$ob体育CreateMode 0640"
reference : "800-171|3.3.8,800-53|AU-9,CN-L3|7.1.2.3(d),CN-L3|7.1.3.3(f),CSCv7|5.1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.2,ITSG-33|AU-9,LEVEL|1S,NESA|M5.2.3,NESA|M5.5.2,NESA|T3.6.4,NESA|T8.2.9,NIAv2|SM5,NIAv2|SM6"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep ^\\$ob体育CreateMode /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\$ob体育CreateMode 0[246][04]0"
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-171|3.3.8,800-53|AU-9,CSCv7|6.6,CSCv7|6.8,CSF|PR.PT-1,ITSG-33|AU-9,LEVEL|1S,NESA|M5.2.3,NESA|M5.5.2,NIAv2|SS13e"
see_also : "https://workbench.cisecurity.org/files/2242"
# Note: Variable @SYSLOG_SERVER@ replaced with "192.168.0.1" in field "cmd".
cmd : "/bin/grep \'^*.*[^I][^I]*@\\@192.168.0.1\' /etc/rsyslog.conf /etc/rsyslog.d/* | /usr/bin/awk '{print} END {if (NR != 0) print \"pass\" ; else print \"fail\"}'"
expect : "pass"
system : "Linux"
type : CMD_EXEC
description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - ModLoad 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-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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep '\\$ModLoad imtcp' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\$ModLoad[\\s]+imtcp[\\s]*$"
system : "Linux"
type : CMD_EXEC
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-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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep \'\\$InputTCPServerRun\' /etc/rsyslog.conf /etc/rsyslog.d/*.conf"
expect : "\\$InputTCPServerRun[\\s]+514[\\s]*$"
description : "4.2.1.1 Ensure rsyslog Service is enabled"
info : "Once the rsyslog package is installed it needs to be activated.
Rationale:
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,CSCv7|15.5,CSCv7|6.2,CSCv7|6.3,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/2242"
description : "4.2.1.2 ensure logging is configured - '*.emerg :omusrmsg:*'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'mail.* -/var/log/mail'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'mail.info -/var/log/mail.info'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'mail.warning -/var/log/mail.warn'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'mail.err /var/log/mail.err'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'news.crit -/var/log/news/news.crit'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'news.err -/var/log/news/news.err'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'news.notice -/var/log/news/news.notice'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - '*.=warning;*.=err -/var/log/warn'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - '*.crit /var/log/warn'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - '*.*;mail.none;news.none -/var/log/messages'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'local0,local1.* -/var/log/localmessages'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'local2,local3.* -/var/log/localmessages'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'local4,local5.* -/var/log/localmessages'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.2 ensure logging is configured - 'local6,local7.* -/var/log/localmessages'"
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.
NOTE: rsyslog was not identified as being used."
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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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 $ob体育CreateMode to 0640 or more restrictive:
$ob体育CreateMode 0640"
reference : "800-171|3.3.8,800-53|AU-9,CN-L3|7.1.2.3(d),CN-L3|7.1.3.3(f),CSCv7|5.1,CSF|PR.PT-1,ISO/IEC-27001|A.12.4.2,ITSG-33|AU-9,LEVEL|1S,NESA|M5.2.3,NESA|M5.5.2,NESA|T3.6.4,NESA|T8.2.9,NIAv2|SM5,NIAv2|SM6"
see_also : "https://workbench.cisecurity.org/files/2242"
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-171|3.3.8,800-53|AU-9,CSCv7|6.6,CSCv7|6.8,CSF|PR.PT-1,ITSG-33|AU-9,LEVEL|1S,NESA|M5.2.3,NESA|M5.5.2,NIAv2|SS13e"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.1.5 Ensure remote rsyslog messages are only accepted on designated log hosts. - ModLoad 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-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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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-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),CSCv7|9.2,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1NS,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "Check for syslog-ng package"
cmd : "/usr/bin/dpkg -s syslog-ng 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "4.2.2.1 Ensure syslog-ng service is enabled"
info : "Once the syslog-ng package is installed it needs to be activated.
Rationale:
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:
# update-rc.d syslog-ng enable"
reference : "CIP|007-6-R1,CSCv7|6.2,CSCv7|6.3,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/2242"
cmd : "/bin/systemctl is-enabled syslog-ng | /usr/bin/awk '{print} END {if(NR==0) print \"disabled\" }'"
expect : "enabled"
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 : "CSCv7|6.2,CSCv7|6.3,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "4.2.2.3 Ensure syslog-ng default file permissions configured"
info : "syslog-ng 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 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-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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/syslog-ng/syslog-ng.conf"
regex : "perm\\(0[246][04]0\\);"
expect : "perm\\(0[246][04]0\\);"
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-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),CSCv7|5.1,CSCv7|6.6,CSCv7|6.8,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/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-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),CSCv7|6.6,CSCv7|6.8,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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-171|3.3.8,800-53|AU-9,CSCv7|6.2,CSCv7|6.3,CSF|PR.PT-1,ITSG-33|AU-9,LEVEL|1NS,NESA|M5.2.3,NESA|M5.5.2,NIAv2|SS13e"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -E \'\^source net\' /etc/syslog-ng/syslog-ng.conf;/bin/grep -E \'\^destination remote\' /etc/syslog-ng/syslog-ng.conf;/bin/grep -E \'\^log\' /etc/syslog-ng/syslog-ng.conf"
expect : ""
severity : MEDIUM
description : "4.2.2.1 Ensure syslog-ng service is enabled"
info : "Once the syslog-ng package is installed it needs to be activated.
Rationale:
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:
# update-rc.d syslog-ng enable"
reference : "CIP|007-6-R1,CSCv7|6.2,CSCv7|6.3,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/2242"
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/2242"
description : "4.2.2.3 Ensure syslog-ng default file permissions configured"
info : "syslog-ng 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 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-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),CSCv7|5.1,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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-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),CSCv7|5.1,CSCv7|6.6,CSCv7|6.8,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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-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),CSCv7|6.6,CSCv7|6.8,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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."
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.3.8,800-53|AU-9,CSCv7|6.2,CSCv7|6.3,CSF|PR.PT-1,ITSG-33|AU-9,LEVEL|1NS,NESA|M5.2.3,NESA|M5.5.2,NIAv2|SS13e"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "Check rsyslog installed"
cmd : "/usr/bin/dpkg -s rsyslog 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
system : "Linux"
type : CMD_EXEC
description : "Check syslog-ng installed"
cmd : "/usr/bin/dpkg -s syslog-ng 2>&1"
expect : "install[\\s]+ok[\\s]+installed"
description : "4.2.3 Ensure rsyslog or syslog-ng is installed"
info : "The rsyslog and syslog-ng software are recommended replacements to the originalsyslogd daemon which provide improvements over syslogd, 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.
Rationale:
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:
# apt-get install rsyslog
# apt-get install syslog-ng"
reference : "LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
description : "4.2.3 Ensure rsyslog or syslog-ng is installed"
info : "The rsyslog and syslog-ng software are recommended replacements to the originalsyslogd daemon which provide improvements over syslogd, 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.
Rationale:
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:
# apt-get install rsyslog
# apt-get install syslog-ng"
reference : "LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : FILE_CHECK
description : "4.2.4 Ensure permissions on all logfiles are configured"
info : "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well.
Rationale:
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:
# chmod -R g-wx,o-rwx /var/log/*
Notes:
You may also need to change the configuration for your logging software or services for any logs that had incorrect permissions.
Some software or environments may re-set the permissions on these files. Site policy should dictate the appropriate setting for your implementation."
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
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.
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.
Notes:
If no maxage setting is set for logrotate a situation can occur where logrotate is interrupted and fails to delete rotated logfiles. It is recommended to set this to a value greater than the longest any log file should exist on your system to ensure that any such logfile is removed but standard rotation settings are not overridden."
reference : "CSCv7|6.3,CSCv7|6.4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
system : "Linux"
type : CMD_EXEC
description : "5.1.1 Ensure cron daemon is enabled"
info : "The cron daemon is used to execute batch jobs on the system.
Rationale:
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 cron"
reference : "CIP|007-6-R1,CSCv7|5.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"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/systemctl is-enabled cron | /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 : "The /etc/crontabfile is used by cronto control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/crontab"
mask : "177"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/cron.hourly"
mask : "077"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/cron.daily"
mask : "077"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/cron.weekly"
mask : "077"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/cron.monthly"
mask : "077"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/cron.d"
mask : "077"
system : "Linux"
type : FILE_CHECK
description : "5.1.8 Ensure at/cron is restricted to authorized users - at.allow"
info : "Configure /etc/cron.allowand /etc/at.allowto allow specific users to use these services. If /etc/cron.allowor /etc/at.allowdo not exist, then /etc/at.denyand /etc/cron.denyare checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allowand /etc/at.alloware allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allowfile only controls administrative access to the crontab command for scheduling and modifying cron jobs.
Rationale:
On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs 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-171|3.1.7,800-53|AC-6,CSCv6|3.1,CSCv7|16,CSF|PR.AC-4,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/at.allow"
owner : "root"
mask : "077"
group : "root"
system : "Linux"
type : FILE_CHECK
description : "5.1.8 Ensure at/cron is restricted to authorized users - cron.allow"
info : "Configure /etc/cron.allowand /etc/at.allowto allow specific users to use these services. If /etc/cron.allowor /etc/at.allowdo not exist, then /etc/at.denyand /etc/cron.denyare checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allowand /etc/at.alloware allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allowfile only controls administrative access to the crontab command for scheduling and modifying cron jobs.
Rationale:
On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs 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-171|3.1.7,800-53|AC-6,CSCv6|3.1,CSCv7|16,CSF|PR.AC-4,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "Configure /etc/cron.allowand /etc/at.allowto allow specific users to use these services. If /etc/cron.allowor /etc/at.allowdo not exist, then /etc/at.denyand /etc/cron.denyare checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allowand /etc/at.alloware allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allowfile only controls administrative access to the crontab command for scheduling and modifying cron jobs.
Rationale:
On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs 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-171|3.1.7,800-53|AC-6,CIP|007-6-R1,CSCv6|9.1,CSCv7|16,CSF|PR.AC-4,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/2242"
file : "/etc/cron.deny"
system : "Linux"
type : FILE_CHECK_NOT
description : "5.1.8 Ensure at/cron is restricted to authorized users - at.deny"
info : "Configure /etc/cron.allowand /etc/at.allowto allow specific users to use these services. If /etc/cron.allowor /etc/at.allowdo not exist, then /etc/at.denyand /etc/cron.denyare checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allowand /etc/at.alloware allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allowfile only controls administrative access to the crontab command for scheduling and modifying cron jobs.
Rationale:
On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs 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-171|3.1.7,800-53|AC-6,CIP|007-6-R1,CSCv6|9.1,CSCv7|16,CSF|PR.AC-4,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/2242"
file : "/etc/at.deny"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
owner : "root"
mask : "077"
group : "root"
system : "Linux"
type : FILE_CHECK
description : "5.2.2 Ensure permissions on SSH private host key files are configured"
info : "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed.
Rationale:
If an unauthorized user obtains the private SSH host key file, the host could be impersonated"
solution : "Run the following commands to set ownership and permissions on the private SSH host key files
# find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \;
# find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \;"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/*key"
mask : "177"
system : "Linux"
type : FILE_CHECK
description : "5.2.3 Ensure permissions on SSH public host key files are configured"
info : "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully.
Rationale:
If a public host key file is modified by an unauthorized user, the SSH service may be compromised."
solution : "Run the following commands to set permissions and ownership on the SSH host public key files
# find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \;
#find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \;"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/*key.pub"
mask : "133"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.4 Ensure SSH Protocol is set to 2"
info : "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure.
Rationale:
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
Default Value:
Protocol 2"
reference : "CIP|007-6-R1,CSCv7|4.5,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*Protocol[\\s]"
expect : "^[\\s]*Protocol[\\s]+2[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.5 Ensure SSH LogLevel is appropriate"
info : "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.
VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments.
Rationale:
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."
solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows:
LogLevel VERBOSE
OR
LogLevel INFO
Default Value:
LogLevel INFO"
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),CSCv7|6.2,CSCv7|6.3,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,NESA|T3.6.2,NESA|T3.6.5,NESA|T3.6.6,NIAv2|SM8,SWIFT-CSCv1|6.4,TBA-FIISB|45.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*LogLevel[\\s]"
expect : "^[\\s]*LogLevel[\\s]+(INFO|VERBOSE)[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.7 Ensure SSH MaxAuthTries is set to 4 or less"
info : "The MaxAuthTriesparameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure.
Rationale:
Setting the MaxAuthTriesparameter 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
Default Value:
MaxAuthTries 6"
reference : "800-171|3.1.8,800-53|AC-7,CSCv6|16.7,CSCv7|16,ITSG-33|AC-7,LEVEL|1S,NESA|T5.5.1,NIAv2|AM24,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
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.8 Ensure SSH IgnoreRhosts is enabled"
info : "The IgnoreRhostsparameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication.
Rationale:
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
Default Value:
IgnoreRhosts yes"
reference : "800-171|3.5.2,800-53|AC-14,800-53|IA-5,CSCv7|9.2,CSF|PR.AC-1,ITSG-33|AC-14,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NESA|T5.6.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*IgnoreRhosts[\\s]"
expect : "^[\\s]*IgnoreRhosts[\\s]+yes[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.9 Ensure SSH HostbasedAuthentication is disabled"
info : "The HostbasedAuthenticationparameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2.
Rationale:
Even though the .rhostsfiles are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhostsfiles in SSH provides an additional layer of protection ."
solution : "Edit the /etc/ssh/sshd_config file to set the parameter as follows:
HostbasedAuthentication no
Default Value:
HostbasedAuthentication no"
reference : "800-171|3.5.2,800-53|AC-14,800-53|IA-5,CSCv7|16.13,CSF|PR.AC-1,ITSG-33|AC-14,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NESA|T5.6.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*HostbasedAuthentication[\\s]"
expect : "^[\\s]*HostbasedAuthentication[\\s]+no[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.10 Ensure SSH root login is disabled"
info : "The PermitRootLoginparameter specifies if the root user can log in using ssh(1). The default is no.
Rationale:
Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudoor 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
Default Value:
PermitRootLogin without-password"
reference : "800-171|3.1.15,800-171|3.1.2,800-53|AC-17,CSCv7|4.3,CSF|PR.AC-3,CSF|PR.PT-4,ITSG-33|AC-17,LEVEL|1S,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*PermitRootLogin[\\s]"
expect : "^[\\s]*PermitRootLogin[\\s]+no[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.11 Ensure SSH PermitEmptyPasswords is disabled"
info : "The PermitEmptyPasswordsparameter specifies if the SSH server allows login to accounts with empty password strings.
Rationale:
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
Default Value:
PermitEmptyPasswords no"
reference : "800-171|3.5.2,800-53|IA-5,CSCv7|16.3,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*PermitEmptyPasswords[\\s]"
expect : "^[\\s]*PermitEmptyPasswords[\\s]+no[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.12 Ensure SSH PermitUserEnvironment is disabled"
info : "The PermitUserEnvironment option allows users to present environment options to the ssh daemon.
Rationale:
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
Default Value:
PermitUserEnvironment no"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/ssh/sshd_config"
regex : "^[\\s]*PermitUserEnvironment[\\s]"
expect : "^[\\s]*PermitUserEnvironment[\\s]+no[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "5.2.13 Ensure only strong ciphers are used"
info : "This variable limits the ciphers that SSH can use during communication.
Rationale:
Week ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised
The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a \"Sweet32\" attack
The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the \"Bar Mitzvah\" issue
The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session
Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors
The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address
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 add/modify the Ciphers line to contain a comma separated list of the site approved ciphers
Example:
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
Default Value:
Ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc"
reference : "800-171|3.13.11,800-53|SC-13,CSCv7|14.4,CSF|PR.DS-5,ITSG-33|SC-13,LEVEL|1S,NESA|M5.2.6,NESA|T7.4.1,NIAv2|CY3,NIAv2|CY4,NIAv2|CY5b,NIAv2|CY5c,NIAv2|CY5d,NIAv2|CY7,NIAv2|NS5e"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep ciphers"
not_expect : "^[\\s]*.*((3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbcz|rijndael-cbc@lysator.liu.se)[,]?)+[\\s]*$"
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "5.2.14 Ensure only strong 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 and add/modify the MACs line to contain a comma separated list of the site approved MACs
Example:
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256
Default Value:
macs hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac- ripemd160@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha 1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@ope nssh.com,hmac-md5-96-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-64-etm@openssh.com,umac- 128-etm@openssh.com"
reference : "800-171|3.1.8,800-53|AC-7,CSCv7|14.4,CSCv7|16.5,ITSG-33|AC-7,LEVEL|1S,NESA|T5.5.1,NIAv2|AM24,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep -i \"MACs\""
not_expect : "^[\\s]*.*((hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com)[,]?)+[\\s]*$"
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "5.2.15 Ensure only strong Key Exchange algorithms are used"
info : "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received
Rationale:
Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks
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 add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms
Example:
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
Default Value:
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
Notes:
Kex algorithms have a higher preference the earlier they appear in the list
Some organizations may have stricter requirements for approved Key exchange algorithms. Ensure that Key exchange algorithms used are in compliance with site policy.
The only Key Exchange Algorithms currently FIPS 140-2 approved are: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
The Key Exchange algorithms supported by OpenSSH 6.7 are:
curve25519-sha256@libssh.org
diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521"
reference : "800-171|3.5.2,800-53|IA-5,CSCv7|14.4,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep kexalgorithms"
not_expect : "^[\\s]*.*((diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1)[,]?)+[\\s]*$"
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "5.2.16 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 300 seconds (5 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 300
ClientAliveCountMax 0
Default Value:
ClientAliveInterval 0
ClientAliveCountMax 3"
reference : "800-171|3.1.11,800-53|AC-12,CN-L3|7.1.2.2(d),CN-L3|7.1.3.7(b),CSCv7|16.11,ITSG-33|AC-12,LEVEL|1S,NIAv2|NS49"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep clientaliveinterval"
expect : "^[\\s]*clientaliveinterval[\\s]+([1-9]|[1-8][0-9]|9[0-9]|[12][0-9]{2}|300)[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "5.2.16 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 300 seconds (5 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 300
ClientAliveCountMax 0
Default Value:
ClientAliveInterval 0
ClientAliveCountMax 3"
reference : "800-171|3.1.11,800-53|AC-12,CN-L3|7.1.2.2(d),CN-L3|7.1.3.7(b),CSCv7|16.11,ITSG-33|AC-12,LEVEL|1S,NIAv2|NS49"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep clientalivecountmax"
expect : "^[\\s]*clientalivecountmax[\\s]+[0-3][\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "5.2.17 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
Default Value:
LoginGraceTime 120"
reference : "CSCv7|5.1,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/sshd -T | /bin/grep logingracetime"
expect : "^[\\s]*logingracetime[\\s]+([1-9]|[1-5][0-9]|60)[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.2.18 Ensure SSH access is limited"
info : "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged:
AllowUsers
The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host.
AllowGroups
The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable.
DenyUsers
The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host.
DenyGroups
The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable.
Rationale:
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,CSCv7|4.3,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.5,LEVEL|1S,NESA|M1.1.3,NESA|T5.1.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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.19 Ensure SSH warning banner is configured"
info : "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed.
Rationale:
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-171|3.1.9,800-53|AC-8,CSCv7|5.1,ITSG-33|AC-8,LEVEL|1S,NESA|M1.3.6,NESA|M5.2.5,NESA|T5.5.1,NIAv2|AM10a,NIAv2|AM10b,NIAv2|AM10c,NIAv2|AM10d,NIAv2|AM10e"
see_also : "https://workbench.cisecurity.org/files/2242"
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 - 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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.1.8,800-53|AC-7,CSCv6|16.7,CSCv7|4.4,ITSG-33|AC-7,LEVEL|1S,NESA|T5.5.1,NIAv2|AM24,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/pam.d/common-password"
regex : "^[\\s]*password[\\s]+requisite[\\s]+pam_pwquality\\.so[\\s]"
# Note: Variable @PW_RETRY@ replaced with "[1-3]" in field "expect".
expect : "[\\s]+retry[\\s]*=[\\s]*[1-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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/security/pwquality.conf"
regex : "^[\\s]*minlen[\\s]*="
# Note: Variable @PW_MINLEN@ replaced with "(1[4-9]|[2-9][0-9])" in field "expect".
expect : "^[\\s]*minlen[\\s]*=[\\s]*(1[4-9]|[2-9][0-9])[\\s]*$"
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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/security/pwquality.conf"
regex : "^[\\s]*dcredit[\\s]*="
# Note: Variable @PW_DCREDIT@ replaced with "-1" in field "expect".
expect : "^[\\s]*dcredit[\\s]*=[\\s]*-1[\\s]*$"
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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/security/pwquality.conf"
regex : "^[\\s]*ucredit[\\s]*="
# Note: Variable @PW_UCREDIT@ replaced with "-1" in field "expect".
expect : "^[\\s]*ucredit[\\s]*=[\\s]*-1[\\s]*$"
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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/security/pwquality.conf"
regex : "^[\\s]*ocredit[\\s]*="
# Note: Variable @PW_OCREDIT@ replaced with "-1" in field "expect".
expect : "^[\\s]*ocredit[\\s]*=[\\s]*-1[\\s]*$"
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.
- retry=3 - Allow 3 tries before sending back a failure.
The following options are set in the /etc/security/pwquality.conf file:
- minlen = 14 - password must be 14 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 : "Run the following command to install the pam_pwquality module:
apt-get install libpam-pwquality
Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:
password requisite pam_pwquality.so retry=3
Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy:
minlen = 14
dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1
Notes:
Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more.
Settings in /etc/security/pwquality.conf must use spaces around the = symbol."
reference : "800-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/security/pwquality.conf"
regex : "^[\\s]*lcredit[\\s]*="
# Note: Variable @PW_LCREDIT@ replaced with "-1" in field "expect".
expect : "^[\\s]*lcredit[\\s]*=[\\s]*-1[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.3.2 Ensure for failed password attempts is configured"
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/common-auth file and add the auth line below:
auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900
Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user.
Notes:
Use of the \"audit\" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization."
reference : "800-171|3.1.8,800-53|AC-7,CSCv6|16.7,CSCv7|16.7,ITSG-33|AC-7,LEVEL|1S,NESA|T5.5.1,NIAv2|AM24,TBA-FIISB|45.1.2,TBA-FIISB|45.2.1,TBA-FIISB|45.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/pam.d/common-auth"
regex : "^[\\s]*auth[\\s]+required[\\s]+pam_tally2\\.so[\\s]*"
# Note: Variable @PAM_DENY_VALUE@ replaced with "5" in field "expect".
# Note: Variable @PAM_LOCKOUT_VALUE@ replaced with "900" in field "expect".
expect : "^[\\s]*auth[\\s]+required[\\s]+pam_tally2\\.so[\\s]+onerr=fail[\\s]+audit[\\s]+silent[\\s]+deny=3[\\s]+unlock_time=900[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.3.3 Ensure password reuse is limited"
info : "The /etc/security/opasswdfile 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/common-password file to include the remember option and conform to site policy as shown:
password required pam_pwhistory.so remember=5
Notes:
Additional module options may be set, recommendation only covers those listed here."
reference : "800-171|3.5.8,800-53|IA-5,CSCv7|16,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM22c,PCI-DSSv3.1|8.2.5,PCI-DSSv3.2|8.2.5,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/pam.d/common-password"
regex : "^[\\s]*password[\\s]*required[\\s]*pam_pwhistory\\.so"
expect : "remember[\\s]*=[\\s]*(2|[4-9][2-9][0-9]+)"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.3.4 Ensure password hashing algorithm is SHA-512"
info : "The commands below change password encryption from md5to 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/common-password file to include the sha512 option for pam_unix.so as shown:
password [success=1 default=ignore] pam_unix.so sha512
Notes:
Additional module options may be set, recommendation only covers those listed here.
If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login. To accomplish that, the following commands can be used. Any system accounts that need to be expired should be carefully done separately by the system administrator to prevent any potential problems.
# cat /etc/passwd | awk -F: '( $3 >= 1000 && $1 != \"nfsnobody\" ) { print $1 }' | xargs -n 1 chage -d 0"
reference : "800-171|3.13.11,800-53|SC-13,CSCv7|16.4,CSF|PR.DS-5,ITSG-33|SC-13,LEVEL|1S,NESA|M5.2.6,NESA|T7.4.1,NIAv2|CY3,NIAv2|CY4,NIAv2|CY5b,NIAv2|CY5c,NIAv2|CY5d,NIAv2|CY7,NIAv2|NS5e"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/pam.d/common-password"
regex : "^password.*pam_unix\.so.*sha512$"
expect : "^password.*pam_unix\.so.*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 90 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
Notes:
You can also check this setting in /etc/shadow directly. The 5th field should be 90 or less for all users with a password.
Note: A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password."
reference : "800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|16,CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM20,NIAv2|AM21,PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/login.defs"
regex : "^[\\s\\t]*PASS_MAX_DAYS\\s+"
# note - changed value
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
Notes:
You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password."
reference : "800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|16,CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM20,NIAv2|AM21,PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days.
Rationale:
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
Notes:
You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password."
reference : "800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|16,CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM20,NIAv2|AM21,PCI-DSSv3.1|8.2.4,PCI-DSSv3.2|8.2.4,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.2"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : CMD_EXEC
description : "5.4.1.4 Ensure inactive password lock is 30 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 30 days:
# useradd -D -f 30
Modify user parameters for all users with a password set to match:
# chage --inactive 30
Notes:
You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password.
Note: A value of -1 would disable this setting."
reference : "800-53|AC-2,CIP|004-6-R5,CN-L3|7.1.3.2(e),CSCv7|16,CSCv7|4.4,CSF|PR.AC-1,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.6,ITSG-33|AC-2,LEVEL|1S,NIAv2|AM26,PCI-DSSv3.1|8.1.4,PCI-DSSv3.2|8.1.4"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/sbin/useradd -D | /bin/grep INACTIVE"
expect : "^INACTIVE=(30|[1-2][0-9]|[1-9])$"
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."
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-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|16,CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "for user in $(cat /etc/shadow | cut -d: -f1); do expiry=$(date -d \"$(chage --list $user | grep -Poi \'Last password change\s*\:[\\s]*\K((Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[\\s]+[0-9]{1,2}, 2[0-9]{3})$\')\" +%s); today=$(date +%s); if [ $expiry -gt $today ]; then echo \"$user expiry date is in future\"; fi ; done | /usr/bin/awk \'{print} END {if (NR == 0) print \"pass\"; else print \"fail\"}\'"
expect : "^pass$"
system : "Linux"
type : GRAMMAR_CHECK
description : "5.4.2 Ensure system accounts are non-login"
info : "There are a number of accounts provided with Debian that are used to manage applications and are not intended to provide an interactive shell.
Rationale:
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, Debian sets the password field for these accounts to an invalid string, but it is also recommended that the shell field in the password file be set to /usr/sbin/nologin. This prevents the account from potentially being used to run any commands. Some built-in accounts may use /bin/false which is also acceptable. 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 /usr/sbin/nologin:
# usermod -s /usr/sbin/nologin
The following script will automatically set all user shells required to /usr/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 /usr/sbin/nologin $user
fi
fi
done"
reference : "800-171|3.1.5,800-53|AC-6,CN-L3|7.1.3.2(b),CN-L3|7.1.3.2(g),CSCv7|16,CSF|PR.AC-4,CSF|PR.DS-5,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.2.2,NESA|T5.4.1,NESA|T5.4.4,NESA|T5.4.5,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM1,NIAv2|AM23f,NIAv2|SS13c,NIAv2|SS15c,PCI-DSSv3.1|7.1.2,PCI-DSSv3.2|7.1.2,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
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_\/-]+:(\/usr)?\/sbin\/nologin"
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_\/,-]+:(\/usr)?\/bin\/false"
regex : "^root:x:0:0:root:\/root:\/bin\/bash"
regex : "^sync:x:[0-9]+:[0-9]+:sync:\/(s)?bin:\/bin\/sync"
regex : "^shutdown:x:[0-9]+:[0-9]+:shutdown:\/(s)?bin:\/sbin\/shutdown"
regex : "^halt:x:[0-9]+:[0-9]+:halt:\/(s)?bin:\/sbin\/halt"
regex : "^[A-Za-z0-9_-]+:x:[1-9][0-9]{3}"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.4.3 Ensure default group for the root account is GID 0"
info : "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user.
Rationale:
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-171|3.1.1,800-53|AC-2,CN-L3|7.1.3.2(d),CSCv7|5.1,CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S,NESA|T5.2.1,NESA|T5.2.2,NIAv2|AM28,NIAv2|NS5j,NIAv2|SS14e"
see_also : "https://workbench.cisecurity.org/files/2242"
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/bash.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/bash.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
Notes:
The audit and remediation in this recommendation apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked.
Other methods of setting a default user umask exist however the shell configuration files are the last run and will override other settings if they exist therefor our recommendation is to configure in the shell configuration files. If other methods are in use in your environment they should be audited and the shell configs should be verified to not override."
reference : "800-171|3.1.1,800-53|AC-3,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/bash.bashrc"
regex : "^[\\s]*umask[\\s]"
expect : "^[\\s]*umask[\\s]+\\b(0[0-2][0-7])\\b[\\s]*$"
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.4.4 Ensure default user umask is 027 or more restrictive - /etc/profile"
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/bash.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
Notes:
The audit and remediation in this recommendation apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked.
Other methods of setting a default user umask exist however the shell configuration files are the last run and will override other settings if they exist therefor our recommendation is to configure in the shell configuration files. If other methods are in use in your environment they should be audited and the shell configs should be verified to not override."
reference : "800-171|3.1.1,800-53|AC-3,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/profile"
regex : "^[\\s]*umask[\\s]"
expect : "^[\\s]*umask[\\s]+\\b(0[0-2][0-7])\\b[\\s]*$"
file_required : NO
system : "Linux"
type : FILE_CONTENT_CHECK
description : "5.4.4 Ensure default user umask is 027 or more restrictive - /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/bash.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
Notes:
The audit and remediation in this recommendation apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked.
Other methods of setting a default user umask exist however the shell configuration files are the last run and will override other settings if they exist therefor our recommendation is to configure in the shell configuration files. If other methods are in use in your environment they should be audited and the shell configs should be verified to not override."
reference : "800-171|3.1.1,800-53|AC-3,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.PT-3,ITSG-33|AC-3,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/profile.d/*.sh"
regex : "^[\\s]*umask[\\s]"
expect : "^[\\s]*umask[\\s]+0[0-2][0-7][\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "5.5 Ensure root login is restricted to system console"
info : "The file /etc/securettycontains a list of valid terminals that may be logged in directly as root.
Rationale:
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,CSCv7|5.1,CSF|PR.AC-4,ITSG-33|AC-6,LEVEL|1NS,NESA|T5.1.1,NESA|T5.5.4,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep -v \"console\" /etc/securetty | /usr/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 - /etc/pam.d/su"
info : "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su.
Rationale:
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
Create a comma separated list of users in the sudo statement in the /etc/group file:
sudo:x:10:root,
Notes:
The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default."
reference : "800-171|3.1.7,800-53|AC-6,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/pam.d/su"
regex : "^[\\s]*auth[\\s]+required[\\s]+pam_wheel\\.so[\\s]*$"
expect : "^[\\s]*auth[\\s]+required[\\s]+pam_wheel\\.so[\\s]*$"
system : "Linux"
type : CMD_EXEC
description : "5.6 Ensure access to the su command is restricted - /etc/group"
info : "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su.
Rationale:
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
Create a comma separated list of users in the sudo statement in the /etc/group file:
sudo:x:10:root,
Notes:
The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default."
reference : "800-171|3.1.1,800-53|AC-3,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.PT-3,ISO/IEC-27001|A.9.4.1,ITSG-33|AC-3,LEVEL|1S,NESA|T4.2.1,NESA|T5.4.4,NESA|T5.4.5,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.2,NESA|T7.5.3,NIAv2|AM3,NIAv2|SS29"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/grep sudo: /etc/group"
expect : "sudo:x:10:root(,|$)"
system : "Linux"
type : FILE_CHECK
description : "6.1.2 Ensure permissions on /etc/passwd are configured"
info : "The /etc/passwdfile contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate.
Rationale:
It is critical to ensure that the /etc/passwdfile 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,CSCv6|3.1,CSCv7|16.4,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|5.4,TBA-FIISB|26.1"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/passwd"
mask : "133"
system : "Linux"
type : FILE_CHECK
description : "6.1.3 Ensure permissions on /etc/shadow are configured"
info : "The /etc/shadowfile is used to store the information about user accounts 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/shadowfile, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadowfile (such as expiration) could also be useful to subvert the user accounts."
solution : "Run the one following commands to set permissions on /etc/shadow:
# chown root:shadow /etc/shadow
# chmod o-rwx,g-wx /etc/shadow"
reference : "800-53|IA-5,CSCv6|3.1,CSCv7|16.4,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|5.4,TBA-FIISB|26.1"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "shadow"
owner : "root"
file : "/etc/shadow"
mask : "137"
system : "Linux"
type : FILE_CHECK
description : "6.1.4 Ensure permissions on /etc/group are configured"
info : "The /etc/groupfile contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else.
Rationale:
The /etc/groupfile 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,CSCv6|3.1,CSCv7|16.4,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|5.4,TBA-FIISB|26.1"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/group"
mask : "133"
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 commands to set permissions on /etc/gshadow:
# chown root:shadow /etc/gshadow
# chmod o-rwx,g-rw /etc/gshadow"
reference : "800-53|IA-5,CSCv6|3.1,CSCv7|16.4,CSF|PR.AC-1,ITSG-33|IA-5,LEVEL|1S,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|5.4,TBA-FIISB|26.1"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "shadow"
owner : "root"
file : "/etc/gshadow"
mask : "137"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|16.4,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/passwd-"
mask : "133"
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 one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- :
# chown root:root /etc/shadow-
# chown root:shadow /etc/shadow-
# chmod o-rwx,g-rw /etc/shadow-"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|16.4,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "shadow"
owner : "root"
file : "/etc/shadow-"
mask : "137"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|16.4,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "root"
owner : "root"
file : "/etc/group-"
mask : "133"
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 one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- :
# chown root:root /etc/gshadow-
# chown root:shadow /etc/gshadow-
# chmod o-rwx,g-rw /etc/gshadow-"
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|16.4,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
group : "shadow"
owner : "root"
file : "/etc/gshadow-"
mask : "137"
system : "Linux"
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-171|3.1.5,800-53|AC-6,CN-L3|7.1.3.2(b),CN-L3|7.1.3.2(g),CSCv7|13,CSCv7|5.1,CSF|PR.AC-4,CSF|PR.DS-5,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.2.2,NESA|T5.4.1,NESA|T5.4.4,NESA|T5.4.5,NESA|T5.5.4,NESA|T5.6.1,NESA|T7.5.3,NIAv2|AM1,NIAv2|AM23f,NIAv2|SS13c,NIAv2|SS15c,PCI-DSSv3.1|7.1.2,PCI-DSSv3.2|7.1.2,SWIFT-CSCv1|5.1"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "find_world_writeable_files"
system : "Linux"
description : "6.1.11 Ensure no unowned files or directories exist"
info : "Sometimes when administrators delete users from the password 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,CSCv7|13.2,CSF|PR.AC-4,ITSG-33|AC-16,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "find_orphan_files"
system : "Linux"
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,CSCv7|13.2,CSF|PR.AC-4,ITSG-33|AC-16,LEVEL|1S"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "find_orphan_files"
system : "Linux"
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.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance."
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,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "find_suid_sgid_files"
severity : MEDIUM
system : "Linux"
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.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance."
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,CSCv7|5.1,CSF|PR.AC-4,LEVEL|1NS"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "find_suid_sgid_files"
severity : MEDIUM
system : "Linux"
type : CMD_EXEC
description : "6.2.1 Ensure password fields are not empty"
info : "An account with an empty password field means that anybody may log in as that user without providing a password.
Rationale:
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/shadowfile 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-171|3.5.7,800-53|IA-5,CIP|007-6-R5,CN-L3|7.1.2.7(e),CN-L3|7.1.3.1(b),CSCv7|4.4,CSF|PR.AC-1,HIPAA|164.308(a)(5)(ii)(D),ISO/IEC-27001|A.9.4.3,ITSG-33|IA-5,LEVEL|1S,NESA|T5.2.3,NIAv2|AM19a,NIAv2|AM19b,NIAv2|AM19c,NIAv2|AM19d,NIAv2|AM22a,PCI-DSSv3.1|8.2.3,PCI-DSSv3.2|8.2.3,SWIFT-CSCv1|4.1,TBA-FIISB|26.2.1,TBA-FIISB|26.2.4"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/cat /etc/shadow | /usr/bin/awk -F : \'($2 == \"\") { print $1 \" does not have a password.\"}\'| /usr/bin/awk \'{print} END {if (NR == 0) print \"none\"\'}"
expect : "none"
system : "Linux"
type : FILE_CONTENT_CHECK_NOT
description : "6.2.2 Ensure no legacy \"+\" entries exist in /etc/passwd"
info : "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.
Rationale:
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-171|3.5.1,800-53|IA-2,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSCv7|4.4,CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,NESA|T2.3.8,NESA|T5.3.1,NESA|T5.4.2,NESA|T5.5.1,NESA|T5.5.2,NESA|T5.5.3,NIAv2|AM14b,NIAv2|AM2,NIAv2|AM8"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.
Rationale:
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-171|3.5.1,800-53|IA-2,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSCv7|16.2,CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,NESA|T2.3.8,NESA|T5.3.1,NESA|T5.4.2,NESA|T5.5.1,NESA|T5.5.2,NESA|T5.5.3,NIAv2|AM14b,NIAv2|AM2,NIAv2|AM8"
see_also : "https://workbench.cisecurity.org/files/2242"
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 : "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.
Rationale:
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-171|3.5.1,800-53|IA-2,CN-L3|7.1.3.1(a),CN-L3|7.1.3.1(e),CSCv7|16.2,CSF|PR.AC-1,ITSG-33|IA-2,LEVEL|1S,NESA|T2.3.8,NESA|T5.3.1,NESA|T5.4.2,NESA|T5.5.1,NESA|T5.5.2,NESA|T5.5.3,NIAv2|AM14b,NIAv2|AM2,NIAv2|AM8"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "/etc/group"
regex : "^[\\s]*\\+:"
expect : "^[\\s]*\\+:"
system : "Linux"
description : "6.2.5 Ensure root is the only UID 0 account"
info : "Any account with UID 0 has superuser privileges on the system.
Rationale:
This access must be limited to only the default rootaccount 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-171|3.1.5,800-53|AC-6,CSCv6|5.1,CSCv7|5.1,CSF|PR.AC-4,ISO/IEC-27001|A.9.2.3,ITSG-33|AC-6,LEVEL|1S,NESA|T5.1.1,NESA|T5.2.2,NESA|T5.6.1,NIAv2|AM32,NIAv2|AM33,NIAv2|VL3a,SWIFT-CSCv1|1.2"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "passwd_zero_uid"
system : "Linux"
type : CMD_EXEC
description : "6.2.6 Ensure root PATH Integrity"
info : "The rootuser can execute any command on the system and could be fooled into executing programs unintentionally if the PATHis not set correctly.
Rationale:
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 rootto execute a Trojan horse program."
solution : "Correct or justify any items discovered in the Audit step."
reference : "800-171|3.4.7,800-53|CM-7,CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "su - -c env | grep \'^PATH\' | sed -e \'s/^.*=//\' -e \'s/:/ /g\' | xargs -n1 stat -c \'%a %n\' | awk \'$1 ~ /[7632]$/ { print $2\" is other writable (\"$1\")\"; f++ } END { if (!f) print \"No other writable paths for root interactive environment\" }\'"
expect : "^No other writable paths for root interactive environment$"
dont_echo_cmd : YES
system : "Linux"
type : CMD_EXEC
description : "6.2.7 Ensure all users' home directories exist"
info : "Users can be defined in /etc/passwd without a home directory or with a home directory that does not actually exist.
Rationale:
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-171|3.4.2,800-53|CM-6,CSCv7|5.1,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/bin/cat /etc/passwd | /bin/egrep -v '^(root|halt|sync|shutdown)' | /usr/bin/awk -F: '($7 != \"/usr/sbin/nologin\" && $7 != \"/bin/false\") { print $1 \" \" $6 }' | while read user dir; do if [ ! -d \"$dir\" ]; then /bin/echo \"The home directory ($dir) of user $user does not exist.\"; fi; done | /usr/bin/awk '{ print } END { if(NR==0) { print \"No results found\" } }'"
expect : "^No results found$"
system : "Linux"
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.
NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance."
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.
Notes:
On some distributions the /sbin/nologin should be replaced with /usr/sbin/nologin."
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|14.6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "accounts_bad_home_permissions"
mask : "7027"
severity : MEDIUM
system : "Linux"
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-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|14.6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "accounts_bad_home_permissions"
system : "Linux"
type : FILE_CHECK
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.
Notes:
On some distributions the /sbin/nologin should be replaced with /usr/sbin/nologin."
reference : "800-171|3.4.2,800-53|CM-6,CSCv6|3.1,CSCv7|14.6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,PCI-DSSv3.1|2.2.4,PCI-DSSv3.2|2.2.4,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "~/.*"
mask : "022"
system : "Linux"
type : FILE_CHECK_NOT
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-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,CSCv7|5.1,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,PCI-DSSv3.1|2.2.2,PCI-DSSv3.1|2.2.3,PCI-DSSv3.2|2.2.2,PCI-DSSv3.2|2.2.3,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "~/.forward"
system : "Linux"
type : FILE_CHECK_NOT
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|IA-5,CIP|007-6-R1,CSCv6|9.1,CSCv7|16.4,CSF|PR.AC-1,ITSG-33|IA-5,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,SWIFT-CSCv1|2.3,TBA-FIISB|26.1"
see_also : "https://workbench.cisecurity.org/files/2242"
file : "~/.netrc"
system : "Linux"
type : CMD_EXEC
description : "6.2.13 Ensure users' .netrc ob体育s 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:
.netrcfiles 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.
Notes:
While the complete removal of .netrc files is recommended if any are required on the system secure permissions must be applied.
On some distributions the /sbin/nologin should be replaced with /usr/sbin/nologin."
reference : "800-171|3.4.2,800-53|CM-6,CSCv7|14.6,CSF|PR.IP-1,ITSG-33|CM-6,LEVEL|1S,NESA|T3.2.1,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "for dir in $(/usr/bin/cat /etc/passwd | /usr/bin/egrep -v \'(root|halt|sync|shutdown)\' | /usr/bin/awk -F: \'($7 != \"/sbin/nologin\") { print $6 }\'); do if [ -f \"$dir/.netrc\" ]; then fileperm=$(ls -ld $dir/.netrc | cut -f1 -d\" \"); if [ $(/usr/bin/echo $fileperm | cut -c5) != \"-\" ]; then /usr/bin/echo \"Group Read set on $dir/.netrc\"; fi; if [ $(/usr/bin/echo $fileperm | cut -c6) != \"-\" ]; then /usr/bin/echo \"Group Write set on $dir/.netrc\"; fi; if [ $(/usr/bin/echo $fileperm | cut -c7) != \"-\" ]; then /usr/bin/echo \"Group Execute set on $dir/.netrc\"; fi; if [ $(/usr/bin/echo $fileperm | cut -c8) != \"-\" ]; then /usr/bin/echo \"Other Read set on $dir/.netrc\"; fi; if [ $(/usr/bin/echo $fileperm | cut -c9) != \"-\" ]; then /usr/bin/echo \"Other Write set on $dir/.netrc\"; fi; if [ $(/usr/bin/echo $fileperm | cut -c10) != \"-\" ]; then /usr/bin/echo \"Other Execute set on $dir/.netrc\"; fi; fi; done | /usr/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.
Notes:
On some distributions the /sbin/nologin should be replaced with /usr/sbin/nologin."
reference : "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),CSCv7|16.4,CSF|PR.IP-1,CSF|PR.PT-3,ITSG-33|CM-7,LEVEL|1S,NIAv2|SS13b,NIAv2|SS14a,NIAv2|SS14c,NIAv2|SS15a,SWIFT-CSCv1|2.3"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/cat /etc/passwd | /usr/bin/egrep -v \'^(root|halt|sync|shutdown)\' | /usr/bin/awk -F: \'($7 != \"/sbin/nologin\") { print $1 \" \" $3 \" \" $6 }\' | while read user uid dir; do if [ -f \"$dir/.rhosts\" ]; then /usr/bin/echo \".rhosts file $dir/.rhosts exists\"; fi; done | /usr/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 : "Over time, system administration errors and changes can lead to groups being defined in /etc/passwdbut not in /etc/group.
Rationale:
Groups defined in the /etc/passwdfile but not in the /etc/groupfile 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-171|3.1.1,800-53|AC-2,CN-L3|7.1.3.2(d),CSCv7|16,CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S,NESA|T5.2.1,NESA|T5.2.2,NIAv2|AM28,NIAv2|NS5j,NIAv2|SS14e"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "passwd_invalid_gid"
system : "Linux"
description : "6.2.16 Ensure no duplicate UIDs exist"
info : "Although the useraddprogram will not let you create a duplicate User ID (UID), it is possible for an administrator to manually edit the /etc/passwdfile and change the UID field.
Rationale:
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-171|3.5.5,800-171|3.5.6,800-53|IA-4,CN-L3|7.1.2.7(b),CSCv7|16,CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,NESA|T5.5.2,NIAv2|AM14a,SWIFT-CSCv1|5"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "passwd_duplicate_uid"
system : "Linux"
description : "6.2.17 Ensure no duplicate GIDs exist"
info : "Although the groupaddprogram will not let you create a duplicate Group ID (GID), it is possible for an administrator to manually edit the /etc/groupfile and change the GID field.
Rationale:
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.
Notes:
You can also use the grpck command to check for other inconsistencies in the /etc/group file."
reference : "800-171|3.5.5,800-171|3.5.6,800-53|IA-4,CN-L3|7.1.2.7(b),CSCv7|16,CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,NESA|T5.5.2,NIAv2|AM14a,SWIFT-CSCv1|5"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "group_duplicate_gid"
system : "Linux"
description : "6.2.18 Ensure no duplicate user names exist"
info : "Although the useraddprogram will not let you create a duplicate user name, it is possible for an administrator to manually edit the /etc/passwdfile and change the user name.
Rationale:
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. ob体育 ownerships will automatically reflect the change as long as the users have unique UIDs."
reference : "800-171|3.5.5,800-171|3.5.6,800-53|IA-4,CN-L3|7.1.2.7(b),CSCv7|16,CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,NESA|T5.5.2,NIAv2|AM14a,SWIFT-CSCv1|5"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "passwd_duplicate_username"
system : "Linux"
description : "6.2.19 Ensure no duplicate group names exist"
info : "Although the groupaddprogram will not let you create a duplicate group name, it is possible for an administrator to manually edit the /etc/groupfile and change the group name.
Rationale:
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. ob体育 group ownerships will automatically reflect the change as long as the groups have unique GIDs."
reference : "800-171|3.5.5,800-171|3.5.6,800-53|IA-4,CN-L3|7.1.2.7(b),CSCv7|16,CSF|PR.AC-1,ITSG-33|IA-4,LEVEL|1S,NESA|T5.5.2,NIAv2|AM14a,SWIFT-CSCv1|5"
see_also : "https://workbench.cisecurity.org/files/2242"
name : "group_duplicate_name"
system : "Linux"
type : CMD_EXEC
description : "6.2.20 Ensure shadow group is empty"
info : "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group.
Rationale:
Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadowfile, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadowfile (such as expiration) could also be useful to subvert additional user accounts."
solution : "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group."
reference : "800-171|3.1.1,800-53|AC-2,CN-L3|7.1.3.2(d),CSCv7|16,CSF|DE.CM-1,CSF|DE.CM-3,CSF|PR.AC-1,CSF|PR.AC-4,ITSG-33|AC-2,LEVEL|1S,NESA|M4.4.3,NESA|T5.2.1,NIAv2|AM28,NIAv2|NS5j,NIAv2|SS14d,NIAv2|SS14e"
see_also : "https://workbench.cisecurity.org/files/2242"
cmd : "/usr/bin/awk -F: \'FILENAME == \"/etc/group\" && $1 == \"shadow\" { gid=$3; if ($4!=\"\") { print \"secondary \"$4; f=1 } } FILENAME == \"/etc/passwd\" && $4 == gid { print \"primary \"$1; f=1 } END { if (!f) print \"shadow group empty\" }\' /etc/group /etc/passwd"
expect : "^shadow group empty$"
description : "CIS_Debian_Linux_9_Server_v1.0.0_L1.audit Level 1"
info : "NOTE: Nessus has not identified that the chosen audit applies to the target device."
see_also : "https://workbench.cisecurity.org/files/2242"