blob: c8fb51b49747149f7dee53d2e9347957020b5dec [file] [edit]
# Checks that are reused in the benchmark documents of several Linux
# distributions (e.g. COS, Debian).
benchmark_configs: {
id: "cramfs-mounting-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure mounting of cramfs filesystems is disabled"
description:
"The cramfs filesystem type is a compressed read-only Linux filesystem "
"embedded in small footprint systems. A cramfs image can be used "
"without having to first decompress the image."
rationale:
"Removing support for unneeded filesystem types reduces the local attack "
"surface of the server. If this filesystem type is not needed, disable "
"it."
remediation:
"Edit or create a file in the /etc/modprobe.d/ directory ending in .conf\n"
"Example: vim /etc/modprobe.d/cramfs.conf\n"
"and add the following line:\n"
"```\n"
"install cramfs /bin/true\n"
"```\n"
"Run the following command to unload the cramfs module:\n"
"```\n"
"# rmmod cramfs\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/modules\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"cramfs .*\""
" expected_regex: \"cramfs .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install cramfs .*\""
" expected_regex: \"install cramfs /bin/true\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install cramfs .*\""
" expected_regex: \"install cramfs /bin/true\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "squashfs-mounting-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure mounting of squashfs filesystems is disabled"
description:
"The squashfs filesystem type is a compressed read-only Linux "
"filesystem embedded in small footprint systems. A squashfs image can "
"be used without having to first decompress the image."
rationale:
"Removing support for unneeded filesystem types reduces the local attack "
"surface of the system. If this filesystem type is not needed, disable "
"it.\n\n"
"Impact:\n"
"As Snap packages utilizes squashfs as a compressed filesystem, "
"disabling squashfs will cause Snap packages to fail.\n"
"Snap application packages of software are self-contained and work "
"across a range of Linux distributions. This is unlike traditional Linux "
"package management approaches, like APT or RPM, which require "
"specifically adapted packages per Linux distribution on an application "
"update and delay therefore application deployment from developers to "
"their software's end-user. Snaps themselves have no dependency on any "
"external store (\"App store\"), can be obtained from any source and can "
"be therefore used for upstream software deployment."
remediation:
"Edit or create a file in the /etc/modprobe.d/ directory ending in .conf\n"
"Example: vim /etc/modprobe.d/squashfs.conf\n"
"and add the following line:\n"
"```\n"
"install squashfs /bin/true\n"
"```\n"
"Run the following command to unload the squashfs module:\n"
"```\n"
"# rmmod squashfs\n"
"```\n"
cis_benchmark: {
profile_level: 2
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/modules\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"squashfs .*\""
" expected_regex: \"squashfs .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install squashfs .*\""
" expected_regex: \"install squashfs /bin/true\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install squashfs .*\""
" expected_regex: \"install squashfs /bin/true\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "udf-mounting-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure mounting of udf filesystems is disabled"
description:
"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."
remediation:
"Edit or create a file in the /etc/modprobe.d/ directory ending in .conf\n"
"Example: vim /etc/modprobe.d/udf.conf\n"
"and add the following line:\n"
"```\n"
"install udf /bin/true\n"
"```\n"
"Run the following command to unload the udf module:\n"
"```\n"
"# rmmod udf\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/modules\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"udf .*\""
" expected_regex: \"udf .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install udf .*\""
" expected_regex: \"install udf /bin/true\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/modprobe.d\""
" filename_regex: \".*\\\\.conf\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"install udf .*\""
" expected_regex: \"install udf /bin/true\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "tmp-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure /tmp is configured"
description:
"The /tmp directory is a world-writable directory used for temporary "
"storage by all users and some applications."
rationale:
"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."
remediation:
"Configure /etc/fstab as appropriate.\n"
"example:\n"
"```\n"
"tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0\n"
"```\n"
"OR\n"
"Run the following commands to enable systemd /tmp mounting:\n"
"```\n"
"systemctl unmask tmp.mount\n"
"systemctl enable tmp.mount\n"
"```\n"
"Edit /usr/lib/systemd/system/tmp.mount to configure \n"
"the /tmp mount:\n"
"```\n"
"[Mount]\n"
"What=tmpfs\n"
"Where=/tmp\n"
"Type=tmpfs\n"
"Options=mode=1777,strictatime,noexec,nodev,nosuid\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /tmp .*- .*\""
" expected_regex: \".* /tmp .*- tmpfs tmpfs.*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/lib/systemd/system/tmp.mount\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Type=.*\""
" expected_regex: \"Type=tmpfs\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/lib/systemd/system/tmp.mount\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Type=.*\""
" expected_regex: \"Type=tmpfs\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "tmp-nodev"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nodev option set on /tmp partition"
description:
"The nodev mount option specifies that the filesystem cannot contain "
"special devices."
rationale:
"Since the /tmp filesystem is not intended to support devices, set "
"this option to ensure that users cannot attempt to create block or "
"character special devices in /tmp ."
remediation:
"Edit the /etc/fstab file and add nodev to the fourth field (mounting "
"options) for the /tmp partition. See the fstab(5) manual page for "
"more information.\n"
"Run the following command to remount /tmp:\n"
"```\n"
"# mount -o remount,nodev /tmp\n"
"```\n"
"or\n"
"Edit the config file in /usr/lib/systemd/system/tmp.mount.d to add "
"nodev to the /tmp mount options:\n"
"```\n"
"[Mount]\n"
"Options=mode=1777,strictatime,noexec,nodev,nosuid\n"
"Run the following command to remount /tmp:\n"
"# mount -o remount,nodev /tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .*nodev.* - .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*nodev.*\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .* - .*\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*nodev.*\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "tmp-nosuid"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nosuid option set on /tmp partition"
description:
"The nosuid mount option specifies that the filesystem cannot contain "
"setuid files."
rationale:
"Since the /tmp filesystem is only intended for temporary file "
"storage, set this option to ensure that users cannot create setuid "
"files in /tmp ."
remediation:
"Edit the /etc/fstab file and add nosuid to 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:\n"
"```\n"
"# mount -o remount,nosuid /tmp\n"
"```\n"
"or\n"
"Edit the config file in /usr/lib/systemd/system/tmp.mount.d to add "
"nosuid to the /tmp mount options:\n"
"```\n"
"[Mount]\n"
"Options=mode=1777,strictatime,noexec,nodev,nosuid\n"
"Run the following command to remount /tmp:\n"
"# mount -o remount,nosuid /tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .*nosuid.* - .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*nosuid.*\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .* - .*\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*nosuid.*\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "tmp-noexec"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure noexec option set on /tmp partition"
description:
"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 ."
remediation:
"Edit the /etc/fstab file and add noexec to the fourth field (mounting "
"options) for the /tmp partition. See the fstab(5) manual page for "
"more information.\n"
"Run the following command to remount /tmp:\n"
"```\n"
"# mount -o remount,noexec /tmp\n"
"```\n"
"or\n"
"Edit the config file in /usr/lib/systemd/system/tmp.mount.d to add "
"noexec to the /tmp mount options:\n"
"```\n"
"[Mount]\n"
"Options=mode=1777,strictatime,noexec,nodev,nosuid\n"
"Run the following command to remount /tmp:\n"
"# mount -o remount,noexec /tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .*noexec.* - .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*noexec.*\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /tmp .* - .*\""
" expected_regex: \".* /tmp .* - .*\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/usr/lib/systemd/system/tmp.mount.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Options=.*\""
" expected_regex: \"Options=.*noexec.*\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "home-nodev"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nodev option set on /home partition"
description:
"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."
remediation:
"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.\n"
"# mount -o remount,nodev /home"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /home .* - .*\""
" expected_regex: \".* /home .*nodev.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /home .* - .*\""
" expected_regex: \".* /home .* - .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "shm-nodev"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nodev option set on /dev/shm partition"
description:
"The nodev mount option specifies that the filesystem cannot contain "
"special devices."
rationale:
"Since the /dev/shm filesystem is not intended to support devices, set "
"this option to ensure that users cannot attempt to create special "
"devices in /dev/shm partitions."
remediation:
"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.\n"
"Run the following command to remount /dev/shm:\n"
"```\n"
"# mount -o remount,nodev /dev/shm\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .*nodev.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .* - .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "shm-nosuid"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nosuid option set on /dev/shm partition"
description:
"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."
remediation:
"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.\n"
"Run the following command to remount /dev/shm:\n"
"```\n"
"# mount -o remount,nosuid /dev/shm\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .*nosuid.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .* - .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "shm-noexec"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure noexec option set on /dev/shm partition"
description:
"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."
remediation:
"Make sure the /usr/lib/systemd/system/dev-shm-remount.service file "
"remounts the /dev/shm partition with noexec:\n"
"```\n"
"ExecStart=/bin/mount -o remount,noexec /dev/shm\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .*noexec.* - .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/lib/systemd/system/dev-shm-remount.service\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"ExecStart=.*\""
" expected_regex: \"ExecStart=/bin/mount -o remount.*noexec.* /dev/shm\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /dev/shm .* - .*\""
" expected_regex: \".* /dev/shm .* - .*\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/lib/systemd/system/dev-shm-remount.service\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"ExecStart=.*\""
" expected_regex: \"ExecStart=/bin/mount -o remount.*noexec.* /dev/shm\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "var-tmp-nodev"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nodev option set on /var/tmp partition"
description:
"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."
remediation:
"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.\n"
"Run the following command to remount /var/tmp:\n"
"```\n"
"# mount -o remount,nodev /var/tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .*nodev.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .* - .*\""
" }"
" }"
" }"
"}"
"}}"
}
}
benchmark_configs: {
id: "var-tmp-nosuid"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nosuid option set on /var/tmp partition"
description:
"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."
remediation:
"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.\n"
"Run the following command to remount /var/tmp:\n"
"```\n"
"# mount -o remount,nosuid /var/tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .*nosuid.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .* - .*\""
" }"
" }"
" }"
"}"
"}}"
}
}
benchmark_configs: {
id: "var-tmp-noexec"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure noexec option set on /var/tmp partition"
description:
"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."
remediation:
"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.\n"
"Run the following command to remount /var/tmp:\n"
"```\n"
"# mount -o remount,noexec /var/tmp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .*noexec.* - .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/mountinfo\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".* /var/tmp .* - .*\""
" expected_regex: \".* /var/tmp .* - .*\""
" }"
" }"
" }"
"}"
"}}"
}
}
benchmark_configs: {
id: "automounting-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Disable Automounting"
description:
"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."
remediation:
"Run one of the following commands to disable autofs:\n"
"```\n"
"# dnf remove autofs\n"
"# chkconfig autofs off\n"
"# systemctl disable autofs\n"
"# update-rc.d autofs disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"autofs.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables autofs\""
" file_display_command: \"find /etc/systemd/system -name 'autofs.service'\""
" }"
"}}"
}
}
benchmark_configs: {
id: "nx-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure XD/NX support is enabled"
description:
"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."
remediation:
"On 32 bit systems install a kernel with PAE support, no installation "
"is required on 64 bit systems:\n"
"If necessary configure your bootloader to load the new kernel and "
"reboot the system.\n"
"You may need to enable NX or XD support in your bios.\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/cmdline\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*noexec=.*\""
" expected_regex: \".*noexec=off.*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/cpuinfo\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"flags\\\\s*: .*\""
" expected_regex: \"flags\\\\s*: .* nx .*\""
" }"
" match_criteria: {"
" filter_regex: \"flags\\\\s*: .*\""
" expected_regex: \"flags\\\\s*: .* pae .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/efi/boot/grub.cfg\"}}"
" files_to_check:{single_file:{path:\"/boot/grub/grub.cfg\"}}"
" files_to_check:{single_file:{path:\"/boot/grub2/user.cfg\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*noexec=.*\""
" expected_regex: \".*noexec=off.*\""
" }"
" }"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/efi/boot/grub.cfg\"}}"
" files_to_check:{single_file:{path:\"/boot/grub/grub.cfg\"}}"
" files_to_check:{single_file:{path:\"/boot/grub2/user.cfg\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*noexec=.*\""
" expected_regex: \".*noexec=off.*\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "aslr-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure address space layout randomization (ASLR) is enabled"
description:
"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."
remediation:
"Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* "
"file:\n"
"```\n"
"kernel.randomize_va_space = 2\n"
"```\n"
"Run the following command to set the active kernel parameter:\n"
"```\n"
"# sysctl -w kernel.randomize_va_space=2\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/kernel/randomize_va_space\"}}"
" content:{content:\"2\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"kernel.randomize_va_space *=.*\""
" expected_regex: \"kernel.randomize_va_space *= *2\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ disabled ASLR\""
" file_display_command: \"grep -l 'kernel.randomize_va_space' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"kernel.randomize_va_space *=.*\""
" expected_regex: \"kernel.randomize_va_space *= *2\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "apparmor-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure SELinux or AppArmor are installed"
description: "SELinux and AppArmor provide Mandatory Access Controls."
rationale:
"Without a Mandatory Access Control system installed only the default "
"Discretionary Access Control system will be available."
remediation:
"Install SELinux or apparmor using the appropriate package manager or "
"manual installation."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cos-package-info.json\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*\\\"name\\\": \\\"apparmor\\\".*\""
" expected_regex: \".*\\\"name\\\": \\\"apparmor\\\".*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "local-login-warning-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure local login warning banner is configured properly"
description:
"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 - or "
"the operating system's name"
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."
remediation:
"Make sure the /etc/issue file is empty. Alternatively, edit the /etc/issue "
"file with the appropriate contents according to your site policy, remove "
"any instances of \\m , \\r , \\s , \\v or references to the OS platform, "
"and (when applicable) opt the file out from scanning to prevent further "
"compliance reports."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue\"}}"
" content:{content:\"\"}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue\"}}"
" existence:{should_exist:false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "remote-login-warning-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure remote login warning banner is configured properly"
description:
"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."
remediation:
"Make sure the /etc/issue.net file is empty or deleted. Alternatively, "
"edit the /etc/issue.net file with the appropriate contents according "
"to your site policy, remove any instances of \\m , \\r , \\s , \\v "
"or references to the OS platform and (when applicable) opt the file "
"out from scanning to prevent further compliance reports."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue.net\"}}"
" content:{content:\"\"}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue.net\"}}"
" existence:{should_exist:false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-issue-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/issue are configured"
description:
"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."
remediation:
"Run the following commands to set permissions on /etc/issue:\n"
"```\n"
"# chown root:root /etc/issue\n"
"# chmod 644 /etc/issue\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue\"}}"
" permission:{"
" set_bits: 0444"
" clear_bits: 0133"
" bits_should_match: BOTH_SET_AND_CLEAR"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue\"}}"
" existence:{should_exist:false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "nfs-rpc-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure NFS and RPC are not enabled"
description:
"The Network File System (NFS) is one of the first and most widely distributed\n"
"file systems in the UNIX environment. It provides the ability for systems to\n"
"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\n"
"recommended that these services be disabled to reduce the remote attack\n"
"surface."
remediation:
"Run one of the following commands to disable nfs and rpcbind:\n"
"```\n"
"# chkconfig nfs off\n"
"# chkconfig rpcbind off\n"
"# systemctl disable nfs\n"
"# systemctl disable rpcbind\n"
"# update-rc.d nfs disable\n"
"# update-rc.d rpcbind disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{"
" files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"nfs.service\""
" }"
" }"
" files_to_check:{"
" files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"rpcbind.service\""
" }"
" }"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables nfs or rpcbind\""
" file_display_command: \"find /etc/systemd/system -name 'nfs.service'; find /etc/systemd/system -name 'rpcbind.service'\""
" }"
"}}"
}
}
benchmark_configs: {
id: "packet-redirect-sending-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure packet redirect sending is disabled"
description:
"ICMP Redirects are used to send routing information to other hosts. As a host\n"
"itself does not act as a router (in a host only configuration), there is no\n"
"need to send redirects."
rationale:
"An attacker could use a compromised host to send invalid ICMP redirects to\n"
"other router devices in an attempt to corrupt routing and have users access a\n"
"system set up by the attacker as opposed to a valid system."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.send_redirects = 0\n"
"net.ipv4.conf.default.send_redirects = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.send_redirects=0\n"
"# sysctl -w net.ipv4.conf.default.send_redirects=0\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/all/send_redirects\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/default/send_redirects\"}}"
" content:{content:\"0\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.send_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.send_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.send_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.send_redirects *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables send_redirects\""
" file_display_command: \"grep -l 'send_redirects' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.send_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.send_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.send_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.send_redirects *= *0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "source-routed-packets-not-accepted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure source routed packets are not accepted"
description:
"In networking, source routing allows a sender to partially or fully specify\n"
"the route packets take through a network. In contrast, non-source routed\n"
"packets travel a path determined by routers in the network. In some cases,\n"
"systems may not be routable or reachable from some locations (e.g. private\n"
"addresses vs. Internet routable), and so source routed packets would need to\n"
"be used."
rationale:
"Setting net.ipv4.conf.all.accept_source_route, and \n"
"net.ipv4.conf.default.accept_source_route to 0 disables the system from \n"
"accepting source routed packets. Assume this system was capable of routing \n"
"packets to Internet routable addresses on one interface and private addresses \n"
"on another interface. Assume that the private addresses were not routable to \n"
"the Internet routable addresses and vice versa. Under normal routing \n"
"circumstances, an attacker from the Internet routable addresses could not use \n"
"the system as a way to reach the private address systems. If, however, source \n"
"routed packets were allowed, they could be used to gain access to the private \n"
"address systems as the route could be specified, rather than rely on routing \n"
"protocols that did not allow this routing."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.accept_source_route = 0\n"
"net.ipv4.conf.default.accept_source_route = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.accept_source_route=0\n"
"# sysctl -w net.ipv4.conf.default.accept_source_route=0\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.accept_source_route *=.*\""
" expected_regex: \"net.ipv4.conf.all.accept_source_route *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.accept_source_route *=.*\""
" expected_regex: \"net.ipv4.conf.default.accept_source_route *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables accept_source_route\""
" file_display_command: \"grep -l 'accept_source_route' /etc/sysctl.d/*\""
" }"
"}}"
}
}
benchmark_configs: {
id: "broadcast-icmp-requests-ignored"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure broadcast ICMP requests are ignored"
description:
"Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to\n"
"ignore all ICMP echo and timestamp requests to broadcast and multicast\n"
"addresses."
rationale:
"Accepting ICMP echo and timestamp requests with broadcast or multicast\n"
"destinations for your network could be used to trick your host into starting\n"
"or participating) in a Smurf attack. A Smurf attack relies on an attacker\n"
"sending large amounts of ICMP broadcast messages with a spoofed source\n"
"address. All hosts receiving this message and responding would send echo-reply\n"
"messages back to the spoofed address, which is probably not routable. If many\n"
"hosts respond to the packets, the amount of traffic on the network could be\n"
"significantly multiplied."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.icmp_echo_ignore_broadcasts = 1\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts\"}}"
" content:{content:\"1\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.icmp_echo_ignore_broadcasts *=.*\""
" expected_regex: \"net.ipv4.icmp_echo_ignore_broadcasts *= *1\""
" }"
" }"
" non_compliance_msg: \"config files in /etc/sysctl.d/ do not enable echo_ignore_broadcasts\""
" file_display_command: \"grep -l 'echo_ignore_broadcasts' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.icmp_echo_ignore_broadcasts *=.*\""
" expected_regex: \"net.ipv4.icmp_echo_ignore_broadcasts *= *1\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "bogus-icmp-responses-ignored"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure bogus ICMP responses are ignored"
description:
"Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from\n"
"logging bogus responses (RFC-1122 non-compliant) from broadcast reframes,\n"
"keeping file systems from filling up with useless log messages."
rationale:
"Some routers (and some attackers) will send responses that violate RFC-1122\n"
"and attempt to fill up a log file system with many useless error messages."
remediation:
"Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.icmp_ignore_bogus_error_responses = 1\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses\"}}"
" content:{content:\"1\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.icmp_ignore_bogus_error_responses *=.*\""
" expected_regex: \"net.ipv4.icmp_ignore_bogus_error_responses *= *1\""
" }"
" }"
" non_compliance_msg: \"config files in /etc/sysctl.d/ do not enable icmp_ignore_bogus_error_responses\""
" file_display_command: \"grep -l 'icmp_ignore_bogus_error_responses' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.icmp_ignore_bogus_error_responses *=.*\""
" expected_regex: \"net.ipv4.icmp_ignore_bogus_error_responses *= *1\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "reverse-path-filtering-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure Reverse Path Filtering is enabled"
description:
"Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1\n"
"forces the Linux kernel to utilize reverse path filtering on a received packet\n"
"to determine if the packet was valid. Essentially, with reverse path\n"
"filtering, if the return packet does not go out the same interface that the\n"
"corresponding source packet came from, the packet is dropped (and logged if\n"
"log_martians is set)."
rationale:
"Setting these flags is a good way to deter attackers from sending your system\n"
"bogus packets that cannot be responded to. One instance where this feature\n"
"breaks down is if asymmetrical routing is employed. This would occur when\n"
"using dynamic routing protocols (bgp, ospf, etc) on your system. If you are\n"
"using asymmetrical routing on your system, you will not be able to enable this\n"
"feature without breaking the routing."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.rp_filter = 1\n"
"net.ipv4.conf.default.rp_filter = 1\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.rp_filter=1\n"
"# sysctl -w net.ipv4.conf.default.rp_filter=1\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/all/rp_filter\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/default/rp_filter\"}}"
" content:{content:\"1\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.rp_filter *=.*\""
" expected_regex: \"net.ipv4.conf.all.rp_filter *= *1\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.rp_filter *=.*\""
" expected_regex: \"net.ipv4.conf.default.rp_filter *= *1\""
" }"
" }"
" non_compliance_msg: \"config files in /etc/sysctl.d/ do not enable rp_filter\""
" file_display_command: \"grep -l 'rp_filter' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.rp_filter *=.*\""
" expected_regex: \"net.ipv4.conf.all.rp_filter *= *1\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.rp_filter *=.*\""
" expected_regex: \"net.ipv4.conf.default.rp_filter *= *1\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "tcp-syn-cookies-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure TCP SYN Cookies is enabled"
description:
"When tcp_syncookies is set, the kernel will handle TCP SYN packets normally\n"
"until the half-open connection queue is full, at which time, the SYN cookie\n"
"functionality kicks in. SYN cookies work by not using the SYN queue at all.\n"
"Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include\n"
"a specially crafted TCP sequence number that encodes the source and\n"
"destination IP address and port number and the time the packet was sent. A\n"
"legitimate connection would send the ACK packet of the three way handshake\n"
"with the specially crafted sequence number. This allows the system to verify\n"
"that it has received a valid response to a SYN cookie and allow the\n"
"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\n"
"system by sending many SYN packets without completing the three way handshake.\n"
"This will quickly use up slots in the kernel's half-open connection queue and\n"
"prevent legitimate connections from succeeding. SYN cookies allow the system\n"
"to keep accepting valid connections, even if under a denial of service attack."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.tcp_syncookies = 1\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.tcp_syncookies=1\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/tcp_syncookies\"}}"
" content:{content:\"1\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.tcp_syncookies *=.*\""
" expected_regex: \"net.ipv4.tcp_syncookies *= *1\""
" }"
" }"
" non_compliance_msg: \"config files in /etc/sysctl.d/ do not enable tcp_syncookies\""
" file_display_command: \"grep -l 'tcp_syncookies' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.tcp_syncookies *=.*\""
" expected_regex: \"net.ipv4.tcp_syncookies *= *1\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "journald-write-to-persistent-disk"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure journald is configured to write logfiles to persistent disk"
description:
"Data from journald may be stored in volatile memory or persisted locally on\n"
"the server. Logs in memory will be lost upon a system reboot. By persisting\n"
"logs to local disk on the server they are protected from loss."
rationale:
"Writing log data to disk will provide the ability to forensically reconstruct\n"
"events which may have impacted the operations or security of a system even\n"
"after a system crash or reboot."
remediation:
"Edit the /etc/systemd/journald.conf file and add the following line:\n"
"```\n"
"Storage=persistent\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/systemd/journald.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Storage=.*\""
" expected_regex: \"Storage=persistent\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "sshd-config-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/ssh/sshd_config are configured"
description:
"The /etc/ssh/sshd_config file contains configuration specifications for sshd.\n"
"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\n"
"by nonprivileged users."
remediation:
"Run the following commands to set ownership and permissions on /etc/ssh/sshd_config:\n"
"```\n"
"# chown root:root /etc/ssh/sshd_config\n"
"# chmod og-rwx /etc/ssh/sshd_config\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "sshd-private-host-key-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on SSH private host key files are configured"
description:
"An SSH private key is one of two files used in SSH public key authentication.\n"
"In this authentication method, The possession of the private key is proof of\n"
"identity. Only a private key that corresponds to a public key will be able to\n"
"authenticate successfully. The private keys need to be stored and handled\n"
"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\n"
"be impersonated"
remediation:
"Run the following commands to set ownership and permissions on the private SSH\n"
"host key files\n"
"# find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\;\n"
"# find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/ssh\""
" recursive: true"
" filename_regex: \"ssh_host_.*_key\""
" skip_symlinks: true"
" }}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" non_compliance_msg: \"the permissions of a key in /etc/ssh are too broad \""
" file_display_command: \"find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec stat {} \\\\;\""
" }"
"}}"
}
}
benchmark_configs: {
id: "sshd-public-host-key-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on SSH public host key files are configured"
description:
"An SSH public key is one of two files used in SSH public key authentication.\n"
"In this authentication method, a public key is a key that can be used for\n"
"verifying digital signatures generated using a corresponding private key. Only\n"
"a public key that corresponds to a private key will be able to authenticate\n"
"successfully."
rationale:
"If a public host key file is modified by an unauthorized user, the SSH service\n"
"may be compromised."
remediation:
"Run the following commands to set permissions and ownership on the SSH host\n"
"public key files\n"
"# find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\;\n"
"#find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/ssh\""
" recursive: true"
" filename_regex: \"ssh_host_.*_key.pub\""
" skip_symlinks: true"
" }}"
" permission:{clear_bits: 0033}"
" non_compliance_msg: \"the permissions of a key in /etc/ssh are too broad \""
" file_display_command: \"find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec stat {} \\\\;\""
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-protocol-set-to-2"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure SSH Protocol is set to 2"
description:
"Older versions of SSH support two different and incompatible protocols: SSH1\n"
"and SSH2. SSH1 was the original protocol and was subject to security issues.\n"
"SSH2 is more advanced and secure."
rationale: "SSH v1 suffers from insecurities that do not affect SSH v2."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"Protocol 2\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Protocol .*\""
" expected_regex: \"Protocol *2\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-loglevel-appropriate"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH LogLevel is appropriate"
description:
"INFO level is the basic level that only records login activity of SSH users.\n"
"In many situations, such as Incident Response, it is important to determine\n"
"when a particular user was active on a system. The logout record can eliminate\n"
"those users who disconnected, which helps narrow the field.\n"
"VERBOSE level\n"
"specifies that login and logout activity as well as the key fingerprint for\n"
"any SSH key used for login will be logged. This information is important for\n"
"SSH key management, especially in legacy environments."
rationale:
"SSH provides several logging levels with varying amounts of verbosity. DEBUG\n"
"is specifically not recommended other than strictly for debugging SSH\n"
"communications since it provides so much data that it is difficult to identify\n"
"important security information."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"LogLevel VERBOSE\n"
"```\n"
"OR\n"
"```\n"
"LogLevel INFO\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"LogLevel .*\""
" expected_regex: \"LogLevel .*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"LogLevel .*\""
" expected_regex: \"LogLevel (INFO|VERBOSE)\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-x11-forwarding-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH X11 forwarding is disabled"
description:
"The X11Forwarding parameter provides the ability to tunnel X11 traffic through\n"
"the connection to enable remote graphic connections."
rationale:
"Disable X11 forwarding unless there is an operational requirement to use X11\n"
"applications directly. There is a small risk that the remote X11 servers of\n"
"users who are logged in via SSH with X11 forwarding could be compromised by\n"
"other users on the X11 server. Note that even if X11 forwarding is disabled,\n"
"users can always install their own forwarders."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"X11Forwarding no\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"X11Forwarding .*\""
" expected_regex: \"X11Forwarding no\""
" }"
" }"
" }"
"}"
# Default value is "no" if nothing is specified.
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"X11Forwarding .*\""
" expected_regex: \"X11Forwarding .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-maxauthtries-4-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH MaxAuthTries is set to 4 or less"
description:
"The MaxAuthTries parameter 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 journald logs detailing the login failure."
rationale:
"Setting the MaxAuthTries parameter to a low number will minimize the "
"risk of successful brute force attacks to the SSH server. While the "
"recommended setting is 4, set the number based on site policy."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"MaxAuthTries 4\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"MaxAuthTries .*\""
" expected_regex: \"MaxAuthTries (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: LESS_THAN"
" const: 5"
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-ignorerhosts-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH IgnoreRhosts is enabled"
description:
"The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not\n"
"be used in RhostsRSAAuthentication or HostbasedAuthentication."
rationale:
"Setting this parameter forces users to enter a password when authenticating\n"
"with ssh."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"IgnoreRhosts yes\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"IgnoreRhosts .*\""
" expected_regex: \"IgnoreRhosts yes\""
" }"
" }"
" }"
"}"
# Default value is "yes" if nothing is specified.
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"IgnoreRhosts .*\""
" expected_regex: \"IgnoreRhosts .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-hostbasedauthentication-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH HostbasedAuthentication is disabled"
description:
"The HostbasedAuthentication parameter specifies if authentication is allowed\n"
"through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with\n"
"successful public key client host authentication. This option only applies to\n"
"SSH Protocol Version 2."
rationale:
"Even though the .rhosts files are ineffective if support is disabled in /etc\n"
"pam.conf, disabling the ability to use .rhosts files in SSH provides an\n"
"additional layer of protection."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"HostbasedAuthentication no\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"HostbasedAuthentication .*\""
" expected_regex: \"HostbasedAuthentication no\""
" }"
" }"
" }"
"}"
# Default value is "no" if nothing is specified.
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"HostbasedAuthentication .*\""
" expected_regex: \"HostbasedAuthentication .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-root-login-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH root login is disabled"
description:
"The PermitRootLogin parameter specifies if the root user can log in using ssh.\n"
"The default is no."
rationale:
"Disallowing root logins over SSH requires system admins to authenticate using\n"
"their own individual account, then escalating to root via sudo or su. This in\n"
"turn limits opportunity for non-repudiation and provides a clear audit trail\n"
"in the event of a security incident"
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"PermitRootLogin no\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PermitRootLogin .*\""
" expected_regex: \"PermitRootLogin no\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-permitemptypasswords-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH PermitEmptyPasswords is disabled"
description:
"The PermitEmptyPasswords parameter specifies if the SSH server allows login to\n"
"accounts with empty password strings."
rationale:
"Disallowing remote shell access to accounts that have an empty password\n"
"reduces the probability of unauthorized access to the system"
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"PermitEmptyPasswords no\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PermitEmptyPasswords .*\""
" expected_regex: \"PermitEmptyPasswords no\""
" }"
" }"
" }"
"}"
# Default value is "no" if nothing is specified.
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"PermitEmptyPasswords .*\""
" expected_regex: \"PermitEmptyPasswords .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-permituserenvironments-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH PermitUserEnvironment is disabled"
description:
"The PermitUserEnvironment option allows users to present environment options\n"
"to the ssh daemon."
rationale:
"Permitting users the ability to set environment variables through the SSH\n"
"daemon could potentially allow users to bypass security controls (e.g. setting\n"
"an execution path that has ssh executing trojan'd programs)"
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"PermitUserEnvironment no\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PermitUserEnvironment .*\""
" expected_regex: \"PermitUserEnvironment no\""
" }"
" }"
" }"
"}"
# Default value is "no" if nothing is specified.
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"PermitUserEnvironment .*\""
" expected_regex: \"PermitUserEnvironment .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "strong-ciphers-used"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure only strong Ciphers are used"
description: "This variable limits the ciphers that SSH can use during communication."
rationale:
"Weak ciphers that are used for authentication to the cryptographic module\n"
"cannot be relied upon to provide confidentiality or integrity, and system data\n"
"may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH,\n"
"have a birthday bound of approximately four billion blocks, which makes it\n"
"easier for remote attackers to obtain cleartext data via a birthday attack\n"
"against a long-duration encrypted session, aka a \"Sweet32\" attackThe RC4\n"
"algorithm as used in the TLS protocol and SSL protocol does not properly\n"
"combine state data with key data during the initialization phase, which makes\n"
"it easier for remote attackers to conduct plaintext-recovery attacks against\n"
"the initial bytes of a stream by sniffing network traffic that occasionally\n"
"relies on keys affected by the Invariance Weakness, and then using a brute\n"
"force approach involving LSB values, aka the \"Bar Mitzvah\" issue.\n"
"The passwords used during an SSH session encrypted with RC4 can be recovered\n"
"by an attacker who is able to capture and replay the session Error handling in\n"
"the SSH protocol; Client and Server, when using a block cipher algorithm in\n"
"Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to\n"
"recover certain plaintext data from an arbitrary block of ciphertext in an SSH\n"
"session via unknown vectors.\n"
"The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is\n"
"used, does not properly initialize memory for a MAC context data structure,\n"
"which allows remote authenticated users to bypass intended ForceCommand and\n"
"login-shell restrictions via packet data that provides a crafted callback\n"
"address."
remediation:
"Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a\n"
"comma separated list of the site approved ciphers\n"
"Example:\n"
"```\n"
"Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*3des-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*aes128-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*aes192-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*aes256-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*arcfour(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*arcfour128(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*arcfour256(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*blowfish-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*cast128-cbc(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*rijndael-cbc@lysator.liu.se(,|$).*\""
" }"
" }"
" }"
# The default values are also insecure so check that they're overridden.
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Ciphers .*\""
" expected_regex: \"Ciphers .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "strong-mac-algorithms-used"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure only strong MAC algorithms are used"
description: "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"
remediation:
"Edit the /etc/ssh/sshd_config file and add/modify the MACs line to "
"contain a comma separated list of the site approved MACs\n"
"Example:\n"
"```\n"
"MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-md5(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-md5-96(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-ripemd160(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-sha1(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-sha1-96(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*umac-64@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*umac-128@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-md5-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-md5-96-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-ripemd160-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-sha1-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*hmac-sha1-96-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*umac-64-etm@openssh.com(,|$).*\""
" }"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*umac-128-etm@openssh.com(,|$).*\""
" }"
" }"
" }"
# The default values are also insecure so check that they're overridden.
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"MACs .*\""
" expected_regex: \"MACs .*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "strong-key-exchange-algos-used"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure only strong Key Exchange algorithms are used"
description:
"Key exchange is any method in cryptography by which cryptographic keys are\n"
"exchanged between two parties, allowing use of a cryptographic algorithm. If\n"
"the sender and receiver wish to exchange encrypted messages, each must be\n"
"equipped to encrypt messages to be sent and decrypt messages received"
rationale:
"Key exchange methods that are considered weak should be removed. A key\n"
"exchange method may be weak because too few bits are used, or the hashing\n"
"algorithm is considered too weak. Using weak algorithms could expose\n"
"connections to man-in-the-middle attacks"
remediation:
"Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to\n"
"contain a comma separated list of the site approved key exchange algorithms\n"
"Example:\n"
"```\n"
"KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellmangroup14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffiehellman-group-exchange-sha256\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"KexAlgorithms .*\""
" expected_regex: \"KexAlgorithms .*diffie-hellman-group1-sha1.*\""
" }"
" match_criteria: {"
" filter_regex: \"KexAlgorithms .*\""
" expected_regex: \"KexAlgorithms .*diffie-hellman-group14-sha1.*\""
" }"
" match_criteria: {"
" filter_regex: \"KexAlgorithms .*\""
" expected_regex: \"KexAlgorithms .*diffie-hellman-group-exchange-sha1.*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-idle-timeout-interval-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH Idle Timeout Interval is configured"
description:
"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.\n"
"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."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameters according to "
"site policy:\n"
"```\n"
"ClientAliveInterval 300\n"
"ClientAliveCountMax 0\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"ClientAliveInterval .*\""
" expected_regex: \"ClientAliveInterval (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: LESS_THAN"
" const: 301"
" }"
" }"
" match_criteria: {"
" filter_regex: \"ClientAliveInterval .*\""
" expected_regex: \"ClientAliveInterval (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: GREATER_THAN"
" const: 0"
" }"
" }"
" match_criteria: {"
" filter_regex: \"ClientAliveCountMax .*\""
" expected_regex: \"ClientAliveCountMax (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: LESS_THAN"
" const: 4"
" }"
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ssh-logingrace-one-minute-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH LoginGraceTime is set to one minute or less"
description:
"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."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"LoginGraceTime 60\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"LoginGraceTime .*\""
" expected_regex: \"LoginGraceTime (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: LESS_THAN"
" const: 61"
" }"
" }"
" match_criteria: {"
" filter_regex: \"LoginGraceTime .*\""
" expected_regex: \"LoginGraceTime (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: GREATER_THAN"
" const: 0"
" }"
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ssh-warning-banner-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH warning banner is configured"
description:
"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."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"Banner /etc/issue.net\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"Banner .*\""
" expected_regex: \"Banner /etc/issue.net\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ssh-pam-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH PAM is enabled"
description:
"UsePAM Enables the Pluggable Authentication Module interface. If set to “yes”\n"
"this will enable PAM authentication using ChallengeResponseAuthentication and\n"
"PasswordAuthentication in addition to PAM account and session module\n"
"processing for all authentication types"
rationale:
"When usePAM is set to yes, PAM runs through account and session types\n"
"properly. This is important if you want to restrict access to services based\n"
"off of IP, time or other factors of the account. Additionally, you can make\n"
"sure users inherit certain environment variables on login or disallow access\n"
"to the server"
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"UsePAM yes\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"UsePAM .*\""
" expected_regex: \"UsePAM yes\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-maxstartups-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH MaxStartups is configured"
description:
"The MaxStartups parameter specifies the maximum number of concurrent "
"unauthenticated connections to the SSH daemon."
rationale:
"To protect a system from denial of service due to a large number of "
"pending authentication connection attempts, use the rate limiting "
"function of MaxStartups to protect availability of sshd logins and "
"prevent overwhelming the daemon."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"maxstartups 10:30:60\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"maxstartups .*\""
" expected_regex: \"maxstartups 10:30:60\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ssh-maxsessions-4-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH MaxSessions is set to 4 or less"
description:
"The MaxSessions parameter specifies the maximum number of open "
"sessions permitted from a given connection."
rationale:
"To protect a system from denial of service due to a large number of "
"concurrent sessions, use the rate limiting function of MaxSessions to "
"protect availability of sshd logins and prevent overwhelming the daemon."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"MaxSessions 4\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"MaxSessions .*\""
" expected_regex: \"MaxSessions (\\\\d+)\""
" group_criteria:{"
" group_index: 1"
" type: LESS_THAN"
" const: 5"
" }"
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "password-reuse-limited"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password reuse is limited"
description:
"The /etc/security/opasswd file stores the users' old passwords and can "
"be checked to ensure that users are not recycling recent passwords."
rationale:
"Forcing users not to reuse their past 5 passwords make it less likely "
"that an attacker will be able to guess the password.\n"
"Note that these change only apply to accounts configured on the local "
"system."
remediation:
"Set remembered password history to conform to site policy. Many "
"distributions provide tools for updating PAM configuration, consult "
"your documentation for details. If no tooling is provided edit the "
"appropriate /etc/pam.d/ configuration file and add or modify the "
"pam_pwhistory.so or pam_unix.so lines to include the remember option:\n"
"```\n"
"password required pam_pwhistory.so remember=5\n"
"password sufficient pam_unix.so remember=5\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/pam.d\""
" filename_regex: \"(system-auth)|(common-password)\""
" recursive: false"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"password.*pam_pwhistory.so.*\""
" expected_regex: \"password\\\\s+.*pam_pwhistory.so\\\\s+remember=5\""
" }"
" match_criteria: {"
" filter_regex: \"password.*pam_unix.so.*\""
" expected_regex: \"password\\\\s+.*pam_unix.so\\\\s+.*remember=5.*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "password-hashing-algorithm-sha-512"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password hashing algorithm is SHA-512"
description:
"The commands below change password encryption from md5 to sha512 (a "
"much stronger hashing algorithm). All existing accounts will need to "
"perform a password change to upgrade the stored hashes to the new "
"algorithm."
rationale:
"The SHA-512 algorithm provides much stronger hashing than MD5, thus "
"providing additional protection to the system by increasing the level "
"of effort for an attacker to successfully determine passwords.\n"
"Note that these change only apply to accounts configured on the local "
"system."
remediation:
"Set password hashing algorithm to sha512. Many distributions provide "
"tools for updating PAM configuration, consult your documentation for "
"details. If no tooling is provided edit the appropriate /etc/pam.d/ "
"configuration file and add or modify the pam_unix.so lines to include "
"the sha512 option:\n"
"```\n"
"password sufficient pam_unix.so sha512\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/pam.d\""
" filename_regex: \"(system-auth)|(common-password)\""
" recursive: false"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"password.*pam_unix.so.*\""
" expected_regex: \"password\\\\s+.*pam_unix.so\\\\s+.*sha512.*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "password-expiration-365-days-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password expiration is 365 days or less"
description:
"The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator "
"to force passwords to expire once they reach a defined age. It is "
"recommended that the PASS_MAX_DAYS parameter be set to less than or "
"equal to 365 days."
rationale:
"The window of opportunity for an attacker to leverage compromised "
"credentials or successfully compromise credentials via an online "
"brute force attack is limited by the age of the password. Therefore, "
"reducing the maximum age of a password also reduces an attacker's "
"window of opportunity."
remediation:
"Set the PASS_MAX_DAYS parameter to conform to site policy in "
"/etc/login.defs:\n"
"```\n"
"PASS_MAX_DAYS 365\n"
"```\n"
"Modify user parameters for all users with a password set to match:\n"
"```\n"
"# chage --maxdays 365 <user>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/login.defs\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PASS_MAX_DAYS.*\""
" expected_regex: \"PASS_MAX_DAYS\\\\s+(\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 366"
" }"
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".+:[^!*]+:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:.*:.*:.*:(\\\\d+):.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 366"
" }"
" }"
" }"
" non_compliance_msg: \"there are users whose PASS_MAX_DAYS is more than 365 days\""
" file_display_command: \"grep -E '^[^:]+:[^!*]' /etc/shadow | cut -d: -f1,5\""
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "minimum-days-between-password-changes-7-or-more"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure minimum days between password changes is 7 or more"
description:
"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."
remediation:
"Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs:\n"
"```\n"
"PASS_MIN_DAYS 7\n"
"```\n"
"Modify user parameters for all users with a password set to match:\n"
"```\n"
"# chage --mindays 7 <user>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/login.defs\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PASS_MIN_DAYS.*\""
" expected_regex: \"PASS_MIN_DAYS\\\\s+(\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: GREATER_THAN"
" const: 6"
" }"
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".+:[^!*]+:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:.*:.*:(\\\\d+):.*:.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: GREATER_THAN"
" const: 6"
" }"
" }"
" }"
" non_compliance_msg: \"there are users whose PASS_MIN_DAYS is less than 6 days\""
" file_display_command: \"grep -E '^[^:]+:[^!*]' /etc/shadow | cut -d: -f1,4\""
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "password-expiration-warning-days-7-or-more"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password expiration warning days is 7 or more"
description:
"The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to\n"
"notify users that their password will expire in a defined number of days. It\n"
"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\n"
"to think of a secure password. Users caught unaware may choose a simple\n"
"password or write it down where it may be discovered."
remediation:
"Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs:\n"
"```\n"
"PASS_WARN_AGE 7\n"
"```\n"
"Modify user parameters for all users with a password set to match:\n"
"```\n"
"# chage --warndays 7 <user>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/login.defs\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"PASS_WARN_AGE.*\""
" expected_regex: \"PASS_WARN_AGE\\\\s+(\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: GREATER_THAN"
" const: 6"
" }"
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".+:[^!*]+:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:.*:.*:.*:(\\\\d+):.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 7"
" }"
" }"
" }"
" non_compliance_msg: \"there are users whose password expiration warning is less than 7 days\""
" file_display_command: \"grep -E ^[^:]+:[^\\\\!*] /etc/shadow | cut -d: -f1,6\""
" }"
"}}"
}
}
benchmark_configs: {
id: "inactive-password-lock-30-days-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure inactive password lock is 30 days or less"
description:
"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."
remediation:
"Run the following command to set the default password inactivity "
"period to 30 days:\n"
"```\n"
"# useradd -D -f 30\n"
"```\n"
"Modify user parameters for all users with a password set to match:\n"
"```\n"
"# chage --inactive 30 <user>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/default/useradd\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"INACTIVE.*\""
" expected_regex: \"INACTIVE=(\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 31"
" }"
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".+:[^!*]+:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:.*:.*:.*:.*:.*:(\\\\d+):.*\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 31"
" }"
" }"
" }"
" non_compliance_msg: \"there are users whose password inactive password lock is more than 30 days\""
" file_display_command: \"grep -E ^[^:]+:[^\\\\!*] /etc/shadow | cut -d: -f1,6\""
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "last-password-change-date-in-past"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure all users last password change date is in the past"
description: "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\n"
"bypass any set password expiration."
remediation:
"Investigate any users with a password change date in the future and correct\n"
"them. Locking the account, expiring the password, or resetting the password\n"
"manually may be appropriate."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:(\\\\d+):.*:.*:.*:.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: GREATER_THAN"
" today: {}"
" }"
" }"
" }"
" non_compliance_msg: \"there are users whose last password change is in the future\""
" file_display_command: \"for usr in $(cut -d: -f1 /etc/shadow); do [[ $(chage --list $usr | grep '^Last password change' | cut -d: -f2) > $(date) ]] && echo \\\"$usr :$(chage --list $usr | grep '^Last password change' | cut -d: -f2)\\\"; done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "system-accounts-secured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure system accounts are secured"
description:
"There are a number of accounts provided with most distributions 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, most distributions "
"set 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 the nologin shell. This prevents the "
"account from potentially being used to run any commands."
remediation:
"Run the commands appropriate for your distribution:\n"
"Set the shell for any accounts returned by the audit to nologin:\n"
"```\n"
"# usermod -s $(which nologin) <user>\n"
"```\n"
"Lock any non root accounts returned by the audit:\n"
"```\n"
"# usermod -L <user>\n"
"```\n"
"The following command will set all system accounts to a non login shell:\n"
"```\n"
"awk -F: '($1!=\"root\" && $1!=\"sync\" && $1!=\"shutdown\" && $1!=\"halt\" && $1!~/^\\+/ && $3<'\"$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs)\"' && $7!=\"'\"$(which nologin)\"'\" && $7!=\"/bin/false\") {print $1}' /etc/passwd | while read user do usermod -s $(which nologin) $user done\n"
"```\n"
"The following command will automatically lock not root system accounts:\n"
"```\n"
"awk -F: '($1!=\"root\" && $1!~/^\\+/ && $3<'\"$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs)\"') {print $1}' /etc/passwd | xargs -I '{}' passwd -S '{}' | awk '($2!=\"L\" && $2!=\"LK\") {print $1}' | while read user do usermod -L $user done\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" repeat_config:{type: FOR_EACH_SYSTEM_USER_WITH_LOGIN}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"$user:.*:.*:.*:.*:.*:.*\""
# Only the root, sync, shutdown and halt system users are allowed to have a login shell.
" expected_regex: \"(root|sync|shutdown|halt):.*:.*:.*:.*:.*:.*\""
" }"
" }"
" non_compliance_msg: \"there are system users with a login shell\""
" file_display_command: \"awk -F: '($1!=\\\"root\\\" && $1!=\\\"sync\\\" && $1!=\\\"shutdown\\\" && $1!=\\\"halt\\\" && $1!~/^\\\\+/ && $3<'\\\"$(awk '/^\\\\s*UID_MIN/{print $2}' /etc/login.defs)\\\"' && $7!=\\\"'\\\"$(which nologin)\\\"'\\\" && $7!=\\\"/bin/false\\\") {print}' /etc/passwd\""
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" repeat_config:{type: FOR_EACH_SYSTEM_USER_WITH_LOGIN}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"$user:.*:.*:.*:.*:.*:.*:.*:.*\""
# Only the root system user is allowed to have a non-locked account.
" expected_regex: \"(.*:.*[*!].*:.*:.*:.*:.*:.*:.*:.*)|(root:.*:.*:.*:.*:.*:.*:.*:.*)\""
" }"
" }"
" non_compliance_msg: \"there are non-locked system user accounts\""
" file_display_command: \"awk -F: '($1!=\\\"root\\\" && $1!~/^\\\\+/ && $3<'\\\"$(awk '/^\\\\s*UID_MIN/{print $2}' /etc/login.defs)\\\"') {print $1}' /etc/passwd | xargs -I '{}' passwd -S '{}' | awk '($2!=\\\"L\\\" && $2!=\\\"LK\\\") {print $1}'\""
" }"
"}}"
}
}
benchmark_configs: {
id: "default-group-for-root-account-is-gid-0"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure default group for the root account is GID 0"
description:
"The usermod command can be used to specify which group the root user belongs\n"
"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\n"
"accidentally becoming accessible to non-privileged users."
remediation:
"Run the following command to set the root user default group to GID 0:\n"
"```\n"
"# usermod -g 0 root\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"root:.*:.*:.*:.*:.*:.*\""
" expected_regex: \"root:.*:.*:0:.*:.*:.*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "root-login-restricted-to-system-console"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
title: "Ensure root login is restricted to system console"
description:
"The file /etc/securetty contains a list of valid terminals that may be logged\n"
"in directly as root."
rationale:
"Since the system console has special properties to handle emergency\n"
"situations, it is important to ensure that the console is in a physically\n"
"secure location and that unauthorized consoles have not been defined."
remediation:
"Make sure /etc/securetty is empty or doesn't exist. If /etc/securetty is not empty, make "
"sure there are no entries for any consoles that are not in a physically secure location, "
"then request to be excluded from this scan if applicable."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/securetty\"}}"
" content:{content:\"\"}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/securetty\"}}"
" existence:{should_exist:false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "access-to-su-restricted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure access to the su command is restricted"
description:
"The su command allows a user to run a command or shell as another user. The\n"
"program has been superseded by sudo , which allows for more granular control\n"
"over privileged access. Normally, the su command can be executed by any user.\n"
"By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command\n"
"will only allow users in the wheel group to execute su."
rationale:
"Restricting the use of su , and using sudo in its place, provides system\n"
"administrators better control of the escalation of user privileges to execute\n"
"privileged commands. The sudo utility also provides a better logging and audit\n"
"mechanism, as it can log each command executed via sudo, whereas su can only\n"
"record that a user executed the su program."
remediation:
"Add the following line to the /etc/pam.d/su file:\n"
"```\n"
"auth required pam_wheel.so use_uid\n"
"```\n"
"Create a comma separated list of users in the wheel statement in the "
"/etc/group file:\n"
"```\n"
"wheel:!:10:root,<user list>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/pam.d/su\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"auth.*\\\\spam_wheel.so\\\\s.*\""
" expected_regex: \"auth\\\\s*required\\\\s*pam_wheel.so\\\\s*use_uid\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"wheel:.*\""
" expected_regex: \"wheel:.*:.*:(.*,)?root(,|$).*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-passwd-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/passwd are configured"
description:
"The /etc/passwd file contains user account information that is used by many\n"
"system utilities and therefore must be readable for these utilities to\n"
"operate."
rationale:
"It is critical to ensure that the /etc/passwd file is protected from\n"
"unauthorized write access. Although it is protected by default, the file\n"
"permissions could be changed either inadvertently or through malicious\n"
"actions."
remediation:
"Run the following command to set permissions on /etc/passwd:\n"
"```\n"
"# chown root:root /etc/passwd\n"
"# chmod 644 /etc/passwd\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" permission:{"
" set_bits: 0444"
" clear_bits: 0133"
" bits_should_match: BOTH_SET_AND_CLEAR"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-shadow-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/shadow are configured"
description:
"The /etc/shadow file is used to store the information about user accounts that\n"
"is critical to the security of those accounts, such as the hashed password and\n"
"other security information."
rationale:
"If attackers can gain read access to the /etc/shadow file, they can easily run\n"
"a password cracking program against the hashed password to break it. Other\n"
"security information that is stored in the /etc/shadow file (such as\n"
"expiration) could also be useful to subvert the user accounts."
remediation:
"Run the one of the following chown commands as appropriate and the chmod to\n"
"set permissions on /etc/shadow:\n"
"```\n"
"# chown root:root /etc/shadow\n"
"# chmod o-rwx,g-wx /etc/shadow\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"shadow\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-group-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/group are configured"
description:
"The /etc/group file contains a list of all the valid groups defined in the\n"
"system. The command below allows read/write access for root and read access\n"
"for everyone else."
rationale:
"The /etc/group file needs to be protected from unauthorized changes by non\n"
"privileged users, but needs to be readable as this information is used with\n"
"many non-privileged programs."
remediation:
"Run the following command to set permissions on /etc/group:\n"
"```\n"
"# chown root:root /etc/group\n"
"# chmod 644 /etc/group\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" permission:{"
" set_bits: 0444"
" clear_bits: 0133"
" bits_should_match: BOTH_SET_AND_CLEAR"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-gshadow-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/gshadow are configured"
description:
"The /etc/gshadow file is used to store the information about groups that is\n"
"critical to the security of those accounts, such as the hashed password and\n"
"other security information."
rationale:
"If attackers can gain read access to the /etc/gshadow file, they can easily\n"
"run a password cracking program against the hashed password to break it. Other\n"
"security information that is stored in the /etc/gshadow file (such as group\n"
"administrators) could also be useful to subvert the group."
remediation:
"Run the one of the following chown commands as appropriate and the chmod to\n"
"set permissions on /etc/gshadow:\n"
"```\n"
"# chown root:root /etc/gshadow\n"
"# chown root:shadow /etc/gshadow\n"
"# chmod o-rwx,g-rw /etc/gshadow\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow\"}}"
" existence:{should_exist:false}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"shadow\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-group-dash-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/group- are configured"
description:
"The /etc/group- file contains a backup list of all the valid groups defined in\n"
"the system."
rationale:
"It is critical to ensure that the /etc/group- file is protected from\n"
"unauthorized access. Although it is protected by default, the file permissions\n"
"could be changed either inadvertently or through malicious actions."
remediation:
"Run the following command to set permissions on /etc/group-:\n"
"```\n"
"# chown root:root /etc/group-\n"
"# chmod u-x,go-wx /etc/group-\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group-\"}}"
" existence:{should_exist: false}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group-\"}}"
" permission:{"
" clear_bits: 0133"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-shadow-dash-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/shadow- are configured"
description:
"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."
remediation:
"Run the one of the following chown commands as appropriate and the "
"chmod to set permissions on /etc/shadow- :\n"
"```\n"
"# chown root:root /etc/shadow-\n"
"# chown root:shadow /etc/shadow-\n"
"# chmod o-rwx,g-rw /etc/shadow-\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow-\"}}"
" existence:{should_exist:false}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow-\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow-\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"shadow\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-gshadow-dash-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/gshadow- are configured"
description:
"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."
remediation:
"Run the one of the following chown commands as appropriate and the "
"chmod to set permissions on /etc/gshadow-:\n"
"```\n"
"# chown root:root /etc/gshadow-\n"
"# chown root:shadow /etc/gshadow-\n"
"# chmod o-rwx,g-rw /etc/gshadow-\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow-\"}}"
" existence:{should_exist:false}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow-\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gshadow-\"}}"
" permission:{"
" clear_bits: 0137"
" user: {name: \"root\" should_own: true}"
" group: {name: \"shadow\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "password-fields-not-empty"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password fields are not empty"
description:
"An account with an empty password field means that anybody may log in as that\n"
"user without providing a password."
rationale:
"All accounts must have passwords or be locked to prevent the account from\n"
"being used by an unauthorized user."
remediation:
"If any accounts in the /etc/shadow file do not have a password, run the\n"
"following command to lock the account until it can be determined why it does\n"
"not have a password:\n"
"```\n"
"# passwd -l <username>\n"
"```\n"
"Also, check to see if the account is logged in and investigate what it is\n"
"being used for to determine if it needs to be forced off."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.+:.*:.*:.*:.*:.*:.*:.*\""
" }"
" }"
" non_compliance_msg: \"there are empty password fields in /etc/shadow\""
" file_display_command: \"awk -F: '($2 == \\\"\\\" ) { print $1 \\\" does not have a password \\\"}' /etc/shadow\""
" }"
"}}"
}
}
benchmark_configs: {
id: "passwd-no-legacy-plus-entries"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
title: "Ensure no legacy \"+\" entries exist in /etc/passwd"
description:
"The character + in various files used to be markers for systems to insert data\n"
"from NIS maps at a certain point in a system configuration file. These entries\n"
"are no longer required on most systems, but may exist in files that have been\n"
"imported from other platforms."
rationale:
"These entries may provide an avenue for attackers to gain privileged access on\n"
"the system."
remediation: "Remove any legacy '+' entries from /etc/passwd if they exist."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"\\\\+:.*\""
" expected_regex: \"\\\\+:.*\""
" }"
" }"
" non_compliance_msg: \"there are legacy '+' entries in /etc/passwd\""
" file_display_command: \"grep '^\\\\+:' /etc/passwd\""
" }"
"}}"
}
}
benchmark_configs: {
id: "shadow-no-legacy-plus-entries"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
title: "Ensure no legacy \"+\" entries exist in /etc/shadow"
description:
"The character + in various files used to be markers for systems to insert data\n"
"from NIS maps at a certain point in a system configuration file. These entries\n"
"are no longer required on most systems, but may exist in files that have been\n"
"imported from other platforms."
rationale: "These entries may provide an avenue for attackers to gain privileged access on the system."
remediation: "Remove any legacy '+' entries from /etc/shadow if they exist."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"\\\\+:.*\""
" expected_regex: \"\\\\+:.*\""
" }"
" }"
" non_compliance_msg: \"there are legacy '+' entries in /etc/shadow\""
" file_display_command: \"grep '^\\\\+:' /etc/shadow\""
" }"
"}}"
}
}
benchmark_configs: {
id: "group-no-legacy-plus-entries"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
title: "Ensure no legacy \"+\" entries exist in /etc/group"
description:
"The character + in various files used to be markers for systems to insert data\n"
"from NIS maps at a certain point in a system configuration file. These entries\n"
"are no longer required on most systems, but may exist in files that have been\n"
"imported from other platforms."
rationale:
"These entries may provide an avenue for attackers to gain privileged access on\n"
"the system."
remediation: "Remove any legacy '+' entries from /etc/group if they exist."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"\\\\+:.*\""
" expected_regex: \"\\\\+:.*\""
" }"
" }"
" non_compliance_msg: \"there are legacy '+' entries in /etc/group\""
" file_display_command: \"grep '^\\\\+:' /etc/group\""
" }"
"}}"
}
}
benchmark_configs: {
id: "root-is-only-uid-0-account"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure root is the only UID 0 account"
description: "Any account with UID 0 has superuser privileges on the system."
rationale:
"This access must be limited to only the default root account and only from the\n"
"system console. Administrative access must be through an unprivileged account\n"
"using an approved mechanism as noted in Item 5.6 Ensure access to the su\n"
"command is restricted."
remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:0:.*:.*:.*:.*\""
" expected_regex: \"root:.*:0:.*:.*:.*:.*\""
" }"
" }"
" non_compliance_msg: \"there's a non-root user with uid 0 in /etc/passwd\""
" file_display_command: \"awk -F: '($3 == 0) { print $1 }' /etc/passwd\""
" }"
"}}"
}
}
benchmark_configs: {
id: "home-dirs-exist"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure all users' home directories exist"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home\"}}"
" existence:{should_exist: true}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user doesn't own a home directory\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "home-dirs-750-or-more-restrictive"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure users' home directories permissions are 750 or more restrictive"
description:
"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."
remediation:
"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"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home\"}}"
" permission:{clear_bits: 0027}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user whose home directory is more permissive than 750\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" dirperm=$(ls -ld $dir | cut -f1 -d\\\" \\\")\\n\""
" \" if [ $(echo $dirperm | cut -c6) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Group Write permission set on the home directory ($dir) of user $user\\\"\\n\""
" \" fi\\n\""
" \" if [ $(echo $dirperm | cut -c8) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Other Read permission set on the home directory ($dir) of user $user\\\"\\n\""
" \" fi\\n\""
" \" if [ $(echo $dirperm | cut -c9) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Other Write permission set on the home directory ($dir) of user $user\\\"\\n\""
" \" fi\\n\""
" \" if [ $(echo $dirperm | cut -c10) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Other Execute permission set on the home directory ($dir) of user $user\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "users-own-home-dirs"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure users own their home directories"
description:
"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"
remediation:
"Change the ownership of any home directories that are not owned by the "
"defined user to the correct user."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home\"}}"
" permission:{user: {name: \"$user\" should_own: true}}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user is not the owner of their own home directory\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" owner=$(stat -L -c \\\"%U\\\" \\\"$dir\\\")\\n\""
" \" if [ \\\"$owner\\\" != \\\"$user\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user is owned by $owner.\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \"done\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home\"}}"
" permission:{user: {name: \"$user\" should_own: true}}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "dot-files-not-group-world-writable"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure users' dot files are not group or world writable"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"$home\""
" filename_regex: \"\\\\.[A-Za-z0-]*\""
" recursive: false"
" files_only: true"
" }}"
" permission:{clear_bits: 0022}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user's dot file has group or other write premissions set\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" for file in $dir/.[A-Za-z0-9]*; do\\n\""
" \" if [ ! -h \\\"$file\\\" -a -f \\\"$file\\\" ]; then\\n\""
" \" fileperm=$(ls -ld $file | cut -f1 -d\\\" \\\")\\n\""
" \" if [ $(echo $fileperm | cut -c6) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Group Write permission set on file $file\\\"\\n\""
" \" fi\\n\""
" \" if [ $(echo $fileperm | cut -c9) != \\\"-\\\" ]; then\\n\""
" \" echo \\\"Other Write permission set on file $file\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \" done\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-forward-files"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no users have .forward files"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home/.forward\"}}"
" existence:{should_exist: false}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"root\"}"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user has a .forward file\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" if [ ! -h \\\"$dir/.forward\\\" -a -f \\\"$dir/.forward\\\" ]; then\\n\""
" \" echo \\\".forward file $dir/.forward exists\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-netrc-files"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no users have .netrc files"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home/.netrc\"}}"
" existence:{should_exist: false}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"root\"}"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user has a .netrc file\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" if [ ! -h \\\"$dir/.netrc\\\" -a -f \\\"$dir/.netrc\\\" ]; then\\n\""
" \" echo \\\".netrc file $dir/.netrc exists\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "netrc-files-not-group-world-accessible"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure users' .netrc Files are not group or world accessible"
description:
"While the system administrator can establish secure permissions for "
"users' .netrc files, the users can easily override these."
rationale:
".netrc files may contain unencrypted passwords that may be used to "
"attack other systems."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
# Using files_in_dir makes the check succeed if the file doesn't exist.
" files_to_check:{files_in_dir:{"
" dir_path:\"$home\""
" filename_regex: \"\\\\.netrc\""
" recursive: false"
" }}"
" permission:{clear_bits: 0077}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"root\"}"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user has a .netrc file that's group- or world-accessible\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-rhost-files"
compliance_note: {
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no users have .rhost files"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"$home/.rhost\"}}"
" existence:{should_exist: false}"
" repeat_config:{"
" type: FOR_EACH_USER_WITH_LOGIN"
" opt_out: {wildcard: \"$user\", value: \"root\"}"
" opt_out: {wildcard: \"$user\", value: \"halt\"}"
" opt_out: {wildcard: \"$user\", value: \"sync\"}"
" opt_out: {wildcard: \"$user\", value: \"shutdown\"}"
" }"
" non_compliance_msg: \"a user has a .rhost file\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"grep -E -v '^(halt|sync|shutdown)' /etc/passwd | awk -F: '($7 != \\\"'\\\"$(which nologin)\\\"'\\\" && $7 != \\\"/bin/false\\\") { print $1 \\\" \\\" $6 }' | while read -r user dir; do\\n\""
" \" if [ ! -d \\\"$dir\\\" ]; then\\n\""
" \" echo \\\"The home directory ($dir) of user $user does not exist.\\\"\\n\""
" \" else\\n\""
" \" if [ ! -h \\\"$dir/.rhost\\\" -a -f \\\"$dir/.rhost\\\" ]; then\\n\""
" \" echo \\\".rhost file $dir/.rhost exists\\\"\\n\""
" \" fi\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "groups-from-etc-passwd-in-etc-group"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure all groups in /etc/passwd exist in /etc/group"
description:
"Over time, system administration errors and changes can lead to groups "
"being defined in /etc/passwd but not in /etc/group."
rationale:
"Groups defined in the /etc/passwd file but not in the /etc/group file "
"pose a threat to system security since group permissions are not "
"properly managed."
remediation:
"Make sure that all groups defined in the /etc/passwd file are also "
"present in the /etc/group file."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:$gid:.*\""
" expected_regex: \".*:.*:$gid:.*\""
" }"
" }"
" repeat_config:{type: FOR_EACH_USER_WITH_LOGIN}"
" non_compliance_msg: \"a GID from /etc/passwd isn't present in /etc/group\""
" file_display_command:"
" \"#!/bin/bash\\n\""
" \"for i in $(cut -s -d: -f4 /etc/passwd | sort -u ); do\\n\""
" \" grep -q -P \\\"^.*?:[^:]*:$i:\\\" /etc/group\\n\""
" \" if [ $? -ne 0 ]; then\\n\""
" \" echo \\\"Group $i is referenced by /etc/passwd but does not exist in /etc/group\\\"\\n\""
" \" fi\\n\""
" \"done\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-duplicate-uids"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no duplicate UIDs exist"
description:
"Although the useradd program will not let you create a duplicate User ID\n"
"UID), it is possible for an administrator to manually edit the /etc/passwd\n"
"file and change the UID field."
rationale:
"Users must be assigned unique UIDs for accountability and to ensure\n"
"appropriate access protections."
remediation:
"Based on the results of the audit script, establish unique UIDs and review all\n"
"files owned by the shared UIDs to determine which UID they are supposed to\n"
"belong to."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \".*:.*:(\\\\d+):.*:.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: UNIQUE"
" }"
" }"
" }"
" non_compliance_msg: \"there are duplicate UIDs\""
" file_display_command: \"#!/bin/bash\\ncut -f3 -d\\\":\\\" /etc/passwd | sort -n | uniq -c | while read x ; do\\n [ -z \\\"$x\\\" ] && break\\n set - $x\\n if [ $1 -gt 1 ]; then\\n users=$(awk -F: '($3 == n) { print $1 }' n=$2 /etc/passwd | xargs)\\n echo \\\"Duplicate UID ($2): $users\\\"\\n fi\\ndone\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-duplicate-gids"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no duplicate GIDs exist"
description:
"Although the groupadd program will not let you create a duplicate Group ID\n"
"GID), it is possible for an administrator to manually edit the /etc/group file\n"
"and change the GID field."
rationale: "User groups must be assigned unique GIDs for accountability and to ensure appropriate access protections."
remediation:
"Based on the results of the audit script, establish unique GIDs and review all\n"
"files owned by the shared GID to determine which group they are supposed to\n"
"belong to."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*\""
" expected_regex: \".*:.*:(\\\\d+):.*\""
" group_criteria: {"
" group_index: 1"
" type: UNIQUE"
" }"
" }"
" }"
" non_compliance_msg: \"there are duplicate GIDs\""
" file_display_command: \"#!/bin/bash\\ncut -f3 -d\\\":\\\" /etc/group | sort -n | uniq -c | while read x ; do\\n [ -z \\\"$x\\\" ] && break\\n set - $x\\n if [ $1 -gt 1 ]; then\\n groups=$(awk -F: '($3 == n) { print $1 }' n=$2 /etc/group | xargs)\\n echo \\\"Duplicate GID ($2): $groups\\\"\\n fi\\ndone\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-duplicate-user-names"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no duplicate user names exist"
description:
"Although the useradd program will not let you create a duplicate user name, it\n"
"is possible for an administrator to manually edit the /etc/passwd file and\n"
"change the user name."
rationale:
"If a user is assigned a duplicate user name, it will create and have access to\n"
"files with the first UID for that username in /etc/passwd . For example, if\n"
"\"test4\" has a UID of 1000 and a subsequent \"test4\" entry has a UID of 2000\n"
"logging in as \"test4\" will use UID 1000. Effectively the UID is shared which\n"
"is a security problem."
remediation:
"Based on the results of the audit script, establish unique user names for the\n"
"users. File ownerships will automatically reflect the change as long as the\n"
"users have unique UIDs."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*:.*:.*:.*\""
" expected_regex: \"(.*):.*:.*:.*:.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: UNIQUE"
" }"
" }"
" }"
" non_compliance_msg: \"there are duplicate user names\""
" file_display_command: \"#!/bin/bash\\ncut -f1 -d\\\":\\\" /etc/passwd | sort -n | uniq -c | while read x ; do\\n [ -z \\\"$x\\\" ] && break\\n set - $x\\n if [ $1 -gt 1 ]; then\\n uids=$(awk -F: '($1 == n) { print $3 }' n=$2 /etc/passwd | xargs)\\n echo \\\"Duplicate User Name ($2): $uids\\\"\\n fi\\ndone\""
" }"
"}}"
}
}
benchmark_configs: {
id: "no-duplicate-group-names"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no duplicate group names exist"
description:
"Although the groupadd program will not let you create a duplicate group name,\n"
"it is possible for an administrator to manually edit the /etc/group file and\n"
"change the group name."
rationale:
"If a group is assigned a duplicate group name, it will create and have access\n"
"to files with the first GID for that group in /etc/group . Effectively, the\n"
"GID is shared, which is a security problem."
remediation:
"Based on the results of the audit script, establish unique names for the user\n"
"groups. File group ownerships will automatically reflect the change as long as\n"
"the groups have unique GIDs."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*:.*:.*:.*\""
" expected_regex: \"(.*):.*:.*:.*\""
" group_criteria: {"
" group_index: 1"
" type: UNIQUE"
" }"
" }"
" }"
" non_compliance_msg: \"there are duplicate group names\""
" file_display_command: \"#!/bin/bash\\ncut -f1 -d\\\":\\\" /etc/group | sort -n | uniq -c | while read x ; do\\n [ -z \\\"$x\\\" ] && break\\n set - $x\\n if [ $1 -gt 1 ]; then\\n gids=$(gawk -F: '($1 == n) { print $3 }' n=$2 /etc/group | xargs)\\n echo \\\"Duplicate Group Name ($2): $gids\\\"\\n fi\\ndone\""
" }"
"}}"
}
}
benchmark_configs: {
id: "shadow-group-empty"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:89" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:9" version: "1.0.0" benchmark_document: "CIS Debian Linux 9" }
version: { cpe_uri: "cpe:/o:debian:debian_linux:10" version: "1.0.0" benchmark_document: "CIS Debian Linux 10" }
title: "Ensure shadow group is empty"
description:
"The shadow group allows system programs which require access the ability to\n"
"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\n"
"etc/shadow file. If attackers can gain read access to the /etc/shadow file,\n"
"they can easily run a password cracking program against the hashed passwords\n"
"to break them. Other security information that is stored in the /etc/shadow\n"
"file (such as expiration) could also be useful to subvert additional user\n"
"accounts."
remediation:
"Remove all users from the shadow group, and change the primary group of any\n"
"users with shadow as their primary group."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/group\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"shadow:[^:]*:[^:]*:[^:]+\""
" expected_regex: \"shadow:[^:]*:[^:]*:[^:]+\""
" }"
" }"
" non_compliance_msg: \"a shadow group exists in /etc/group\""
" file_display_command: \"grep ^shadow:[^:]*:[^:]*:[^:]+ /etc/group\""
" }"
"}}"
}
}
benchmark_configs: {
id: "default-user-shell-timeout-900-or-less"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:93" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:cos:cos_linux:97" version: "1.0.0" benchmark_document: "CIS Container-Optimized OS" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure default user shell timeout is 900 seconds or less"
description:
"The default TMOUT determines the shell timeout for users. The TMOUT "
"value is measured in seconds."
rationale:
"Having no timeout value associated with a shell could allow an "
"unauthorized user access to another user's shell 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."
remediation:
"Edit the /etc/bash/bashrc and /etc/profile files (and the appropriate "
"files for any other shell supported on your system) and add or edit any "
"umask parameters as follows:\n"
"```\n"
"TMOUT=900\n"
"```\n"
cis_benchmark: {
profile_level: 2
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/bash/bashrc\"}}"
" files_to_check:{single_file:{path:\"/etc/profile\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"TMOUT=.*\""
" expected_regex: \"TMOUT=(\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: LESS_THAN"
" const: 901"
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "world-writable-dirs-sticky"
compliance_note {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure sticky bit is set on all world-writable directories"
description:
"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."
remediation:
"Set the sticky bit on all world-writable directories, for example by "
"running the following command:\n"
"```\n"
"# df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' "
"-xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null | xargs -I "
"'{}' chmod a+t '{}'\n"
"```\n"
"Then verify that no world-writable non-sticky directories remain by "
"re-running the file display command.\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" dirs_only: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{set_bits: 01000 clear_bits: 0002 bits_should_match: EITHER_SET_OR_CLEAR}"
" non_compliance_msg: \"there are non-sticky world-writable directories on the filesystem\""
" file_display_command: \"df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type d \\\\( -perm -0002 -a ! -perm -1000 \\\\) 2>/dev/null\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" dirs_only: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{set_bits: 01000 clear_bits: 0002 bits_should_match: EITHER_SET_OR_CLEAR}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "aide-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure AIDE is installed"
description:
"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."
remediation:
"install AIDE using the appropriate package manager or manual "
"installation:\n"
"```\n"
"# yum install aide\n"
"# dnf install aide\n"
"# apt-get install aide\n"
"# zypper install aide\n"
"# emerge aide\n"
"```\n"
"Configure AIDE as appropriate for your environment. Consult the AIDE "
"documentation for options.\n"
"Initialize AIDE:\n"
"```\n"
"# aide --init\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/aide\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/sbin/aide\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/bin/aide\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/sbin/aide\"}}"
" existence:{should_exist: true}"
" }"
"}}"
}
}
benchmark_configs: {
id: "filesystem-integrity-checked"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure filesystem integrity is regularly checked"
description:
"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."
remediation:
"Run the following commands:\n"
"```\n"
"# cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service\n"
"# cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer\n"
"# chmod 0644 /etc/systemd/system/aidecheck.*\n"
"# systemctl reenable aidecheck.timer\n"
"# systemctl restart aidecheck.timer\n"
"# systemctl daemon-reload\n"
"```\n"
"or\n"
"Run the following command:\n"
"```\n"
"# crontab -u root -e\n"
"```\n"
"Add the following line to the crontab:\n"
"0 5 * * * /usr/sbin/aide --check\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"aidcheck.service\""
" }}"
" existence:{should_exist: true}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"aidcheck.timer\""
" }}"
" existence:{should_exist: true}"
" }"
"}}"
}
}
benchmark_configs: {
id: "bootloader-password-set"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure bootloader password is set"
description:
"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)."
remediation:
"For grub based systems create an encrypted password with grub-md5-crypt:\n"
"```\n"
"# grub-crypt\n"
"Password: <password>\n"
"Retype Password: <password>\n"
"<encrypted-password>\n"
"```\n"
"Copy and paste the <encrypted-password> into the global section of "
"/boot/grub/menu.lst:\n"
"```\n"
"password <encrypted-password>\n"
"```\n"
"For grub2 based systems\n"
"Create an encrypted password with grub2-setpassword:\n"
"```\n"
"# grub2-setpassword\n"
"Enter password: <password>\n"
"Confirm password: <password>\n"
"```\n"
"OR\n"
"create an encrypted password with grub-mkpasswd-pbkdf2:\n"
"```\n"
"# grub-mkpasswd-pbkdf2\n"
"Enter password: <password>\n"
"Reenter password: <password>\n"
"Your PBKDF2 is <encrypted-password>\n"
"```\n"
"Add the following into /etc/grub.d/00_header or a custom /etc/grub.d "
"configuration file:\n"
"```\n"
"cat <<EOF\n"
"set superusers=\"<username>\"\n"
"password_pbkdf2 <username> <encrypted-password>\n"
"EOF\n"
"```\n"
"Run the following command to update the grub2 configuration:\n"
"```\n"
"# grub2-mkconfig -o /boot/grub2/grub.cfg\n"
"```\n"
"OR\n"
"```\n"
"# update-grub\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub/menu.lst\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*password.*\""
" expected_regex: \"^\\\\s*password.*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub2/user.cfg\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*GRUB2_PASSWORD.*\""
" expected_regex: \"^\\\\s*GRUB2_PASSWORD=.*\""
" }"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub/grub.cfg\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*password.*\""
" expected_regex: \"^\\\\s*password_pbkdf2.*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "bootloader-config-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on bootloader config are configured"
description:
"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/grub2/ or /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."
remediation:
"Run the following commands to set permissions on your grub "
"configuration:\n"
"```\n"
"# chown root:root /boot/grub2/grub.cfg\n"
"# chmod og-rwx /boot/grub2/grub.cfg\n"
"```\n"
"OR\n"
"```\n"
"# chown root:root /boot/grub/grub.cfg\n"
"# chmod og-rwx /boot/grub/grub.cfg\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub/grub.cfg\"}}"
" permission:{"
" clear_bits: 077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub2/grub.cfg\"}}"
" permission:{"
" clear_bits: 077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/boot/grub/grub.cfg\"}}"
" files_to_check:{single_file:{path:\"/boot/grub2/grub.cfg\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "auth-for-single-user-required"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure authentication required for single user mode"
description:
"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."
remediation:
"Run the following command and follow the prompts to set a password for "
"the root user:\n"
"```\n"
"# passwd root\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/shadow\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"root:[*\\\\!]:.*\""
" expected_regex: \"root:[*\\\\!]:.*\""
" }"
" }"
" non_compliance_msg: \"the root user has a password set\""
" file_display_command: \"grep ^root:[*\\\\!]: /etc/shadow\""
" }"
"}}"
}
}
benchmark_configs: {
id: "core-dumps-restricted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure core dumps are restricted"
description:
"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."
remediation:
"Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file:\n"
"```\n"
"* hard core 0\n"
"```\n"
"Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"fs.suid_dumpable = 0\n"
"```\n"
"Run the following command to set the active kernel parameter:\n"
"```\n"
"# sysctl -w fs.suid_dumpable=0\n"
"```\n"
"If systemd-coredump is installed:\n"
"edit /etc/systemd/coredump.conf and add/modify the following lines:\n"
"```\n"
"Storage=none\n"
"ProcessSizeMax=0\n"
"```\n"
"Run the command:\n"
"```\n"
"systemctl daemon-reload\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/security/limits.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*hard core.*\""
" expected_regex: \"\\\\* hard core 0\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"fs.suid_dumpable = .*\""
" expected_regex: \"fs.suid_dumpable = 0\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/fs/suid_dumpable\"}}"
" content:{content:\"0\\n\"}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/security/limits.conf\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/security/limits.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*hard core.*\""
" expected_regex: \"\\\\* hard core 0\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"fs.suid_dumpable = .*\""
" expected_regex: \"fs.suid_dumpable = 0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "prelink-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure prelink is disabled"
description:
"prelink is 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."
remediation:
"Run the following command to restore binaries to normal:\n"
"```\n"
"# prelink -ua\n"
"```\n"
"Uninstall prelink using the appropriate package manager or manual "
"installation:\n"
"```\n"
"# yum remove prelink\n"
"# apt-get remove prelink\n"
"# zypper remove prelink\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/prelink\"}}"
" files_to_check:{single_file:{path:\"/usr/sbin/prelink\"}}"
" files_to_check:{single_file:{path:\"/bin/prelink\"}}"
" files_to_check:{single_file:{path:\"/sbin/prelink\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "motd-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure message of the day is configured properly"
description:
"The contents of the /etc/motd file are displayed to users after login "
"and function as a message of the day for authenticated users.\n"
"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."
remediation:
"Make sure the /etc/motd file is empty or deleted. Alternatively, "
"edit the /etc/motd file with the appropriate contents according "
"to your site policy, remove any instances of \\m , \\r , \\s , \\v "
"or references to the OS platform and (when applicable) opt the file out "
"from scanning to prevent further compliance reports."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/motd\"}}"
" content:{content:\"\"}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/motd\"}}"
" existence:{should_exist:false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "motd-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure permissions on /etc/motd are configured"
description:
"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."
remediation:
"Run the following commands to set permissions on /etc/motd:\n"
"```\n"
"# chown root:root /etc/motd\n"
"# chmod 644 /etc/motd\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/motd\"}}"
" permission:{"
" set_bits: 0444"
" clear_bits: 0133"
" bits_should_match: BOTH_SET_AND_CLEAR"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "etc-issue-net-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/issue.net are configured"
description:
"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."
remediation:
"Run the following commands to set permissions on /etc/issue.net:\n"
"```\n"
"# chown root:root /etc/issue.net\n"
"# chmod 644 /etc/issue.net\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/issue.net\"}}"
" permission:{"
" set_bits: 0444"
" clear_bits: 0133"
" bits_should_match: BOTH_SET_AND_CLEAR"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "time-synchronization-in-use"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure time synchronization is in use"
description:
"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."
remediation:
"On physical systems or virtual systems where host based time "
"synchronization is not available install NTP or chrony using the "
"appropriate package manager or manual installation:\n"
"```\n"
"# yum install ntp\n"
"# dnf install ntp\n"
"# apt-get install ntp\n"
"# zypper install ntp\n"
"# emerge ntp\n"
"```\n"
"The previous commands install NTP, use the appropriate package if "
"chrony is desired. On virtual systems where host based time "
"synchronization is available consult your virtualization software "
"documentation and setup host based synchronization."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/chronyd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/sbin/chronyd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/bin/chronyd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/sbin/chronyd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/ntpd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/sbin/ntpd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/bin/ntpd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/sbin/ntpd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/timesyncd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/sbin/timesyncd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/bin/timesyncd\"}}"
" existence:{should_exist: true}"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/sbin/timesyncd\"}}"
" existence:{should_exist: true}"
" }"
"}}"
}
}
benchmark_configs: {
id: "chrony-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure chrony is configured"
description:
"chrony is a daemon which implements the Network Time Protocol (NTP) is\n"
"designed to synchronize system clocks across a variety of systems and use a\n"
"source that is highly accurate. More information on chrony can be found at\n"
"http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a\n"
"server."
rationale:
"If chrony is in use on the system proper configuration is vital to ensuring\n"
"time synchronization is working properly. This recommendation only applies if\n"
"chrony is in use on the system."
remediation:
"Add or edit server or pool lines to /etc/chrony.conf as appropriate:\n"
"```\n"
"server <remote-server>\n"
"```\n"
"Configure chrony to run as the chrony user by configuring the appropriate\n"
"startup script for your distribution. Startup scripts are typically stored in\n"
"etc/init.d or /etc/systemd"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"server|pool .*\""
" expected_regex: \"server|pool .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{process_path:{proc_name:\"chronyd\"}}"
" permission:{user: {name: \"chrony\" should_own: true}}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"server|pool .*\""
" expected_regex: \"server|pool .*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{process_path:{proc_name:\"chronyd\"}}"
" permission:{user: {name: \"_chrony\" should_own: true}}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"server|pool .*\""
" expected_regex: \"server|pool .*\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"server|pool .*\""
" expected_regex: \"server|pool .*\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/chrony/chrony.conf\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ntp-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
title: "Ensure ntp is configured"
description:
"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.\n"
"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."
remediation:
"Add or edit restrict lines in /etc/ntp.conf to match the following:\n"
"```\n"
"restrict -4 default kod nomodify notrap nopeer noquery\n"
"restrict -6 default kod nomodify notrap nopeer noquery\n"
"```\n"
"Add or edit server or pool lines to /etc/ntp.conf as appropriate:\n"
"```\n"
"server <remote-server>\n"
"```\n"
"Configure ntp to run as the ntp user by adding or editing one of the following files as\n"
"appropriate for your distribution:\n"
"```\n"
"/etc/sysconfig/ntpd :\n"
"OPTIONS=\"-u ntp:ntp\"\n"
"/etc/sysconfig/ntp :\n"
"NTPD_OPTIONS=\"-u ntp:ntp\"\n"
"/etc/init.d/ntp:\n"
"RUNASUSER=ntp\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ntp.conf\"}}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"restrict (-4 )?default kod nomodify notrap nopeer noquery\""
" expected_regex: \"restrict (-4 )?default kod nomodify notrap nopeer noquery\""
" }"
" match_criteria: {"
" filter_regex: \"restrict -6 default kod nomodify notrap nopeer noquery\""
" expected_regex: \"restrict -6 default kod nomodify notrap nopeer noquery\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/init.d/ntp\"}}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"RUNASUSER=ntp\""
" expected_regex: \"RUNASUSER=ntp\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cups-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure CUPS is not enabled"
description:
"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."
remediation:
"Run one of the following commands to disable cups:\n"
"```\n"
"# chkconfig cups off\n"
"# systemctl disable cups\n"
"# update-rc.d cups disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"cups.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables cups\""
" file_display_command: \"find /etc/systemd/system -name cups.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "dhcp-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure DHCP Server is not enabled"
description:
"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 deleted to reduce the potential "
"attack surface."
remediation:
"Run one of the following commands to disable dhcpd:\n"
"```\n"
"# chkconfig dhcpd off\n"
"# systemctl disable dhcpd\n"
"# update-rc.d dhcpd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"dhcpd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables dhcpd\""
" file_display_command: \"find /etc/systemd/system -name dhcpd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "ldap-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure LDAP Server is not enabled"
description:
"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."
remediation:
"Run one of the following commands to disable slapd:\n"
"```\n"
"# chkconfig slapd off\n"
"# systemctl disable slapd\n"
"# update-rc.d slapd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"slapd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables slapd\""
" file_display_command: \"find /etc/systemd/system -name slapd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "dns-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure DNS Server is not enabled"
description:
"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."
remediation:
"Run one of the following commands to disable named:\n"
"```\n"
"# chkconfig named off\n"
"# systemctl disable named\n"
"# update-rc.d named disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"named.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables named\""
" file_display_command: \"find /etc/systemd/system -name named.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "ftp-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure FTP Server is not enabled"
description:
"The File 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."
remediation:
"Run one of the following commands to disable vsftpd:\n"
"```\n"
"# chkconfig vsftpd off\n"
"# systemctl disable vsftpd\n"
"# update-rc.d vsftpd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"vsftpd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables vsftpd\""
" file_display_command: \"find /etc/systemd/system -name vsftpd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "http-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure HTTP Server is not enabled"
description: "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."
remediation:
"Run one of the following commands to disable httpd:\n"
"```\n"
"# chkconfig httpd off\n"
"# systemctl disable httpd\n"
"# update-rc.d httpd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"httpd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables httpd\""
" file_display_command: \"find /etc/systemd/system -name httpd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "imap-pop3-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure IMAP and POP3 Server is not enabled"
description: "dovecot 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 service be deleted to reduce the potential "
"attack surface."
remediation:
"Run one of the following commands to disable dovecot:\n"
"```\n"
"# chkconfig dovecot off\n"
"# systemctl disable dovecot\n"
"# update-rc.d dovecot disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"dovecot.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables dovecot\""
" file_display_command: \"find /etc/systemd/system -name dovecot.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "samba-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure Samba Server is not enabled"
description:
"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 Server "
"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."
remediation:
"Run one of the following commands to disable smb:\n"
"```\n"
"# chkconfig smb off\n"
"# systemctl disable smb\n"
"# update-rc.d smb disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"smb.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables smb\""
" file_display_command: \"find /etc/systemd/system -name smb.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "http-proxy-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure HTTP Proxy Server is not enabled"
description:
"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."
remediation:
"Run one of the following commands to disable squid:\n"
"```\n"
"# chkconfig squid off\n"
"# systemctl disable squid\n"
"# update-rc.d squid disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"squid.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables squid\""
" file_display_command: \"find /etc/systemd/system -name squid.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "snmp-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SNMP Server is not enabled"
description:
"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."
remediation:
"Run one of the following commands to disable snmpd:\n"
"```\n"
"# chkconfig snmpd off\n"
"# systemctl disable snmpd\n"
"# update-rc.d snmpd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"snmpd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables snmpd\""
" file_display_command: \"find /etc/systemd/system -name snmpd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "nis-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure NIS Server is not enabled"
description:
"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 has 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"
remediation:
"Run one of the following commands to disable ypserv:\n"
"```\n"
"# chkconfig ypserv off\n"
"# systemctl disable ypserv\n"
"# update-rc.d ypserv disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"ypserv.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables ypserv\""
" file_display_command: \"find /etc/systemd/system -name ypserv.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "telnet-server-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure telnet server is not enabled"
description:
"The telnet-server package contains the telnet daemon, which accepts "
"connections from users from other systems via the telnet protocol."
rationale:
"The telnet protocol is insecure and unencrypted. The use of an "
"unencrypted transmission medium could allow a user with access to "
"sniff network traffic the ability to steal credentials. The ssh "
"package provides an encrypted session and stronger security."
remediation:
"Comment out or remove any lines starting with telnet from "
"/etc/inetd.conf and /etc/inetd.d/*.\n"
"Set disable = yes on all telnet services in /etc/xinetd.conf and "
"/etc/xinetd.d/*."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc\""
" filename_regex: \"inetd\\\\..*\""
" recursive: false"
" }}"
" content_entry: {"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"telnet.*\""
" expected_regex: \"telnet.*\""
" }"
" }"
" non_compliance_msg: \"a config file enables telnet\""
" file_display_command: \"grep -R '^telnet' /etc/inetd.*\""
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/xinetd.conf\"}}"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/xinetd.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: NONE_MATCH"
" delimiter: \"}\"" # Each service config is contained within a "{}".
" match_criteria: {"
" filter_regex: \".*service telnet.*disable\\\\s+=\\\\sno.*\""
" expected_regex: \".*service telnet.*disable\\\\s+=\\\\sno.*\""
" }"
" }"
" non_compliance_msg: \"a config file in enables telnet\""
" file_display_command: \"grep -l 'telnet' /etc/xinetd.conf /etc/xinetd.d/*\""
" }"
"}}"
}
}
benchmark_configs: {
id: "rsync-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure rsync service is not enabled"
description:
"The rsyncd service can be used to synchronize files between systems over\n"
"network links."
rationale:
"The rsyncd service presents a security risk as it uses unencrypted protocols\n"
"for communication."
remediation:
"Run one of the following commands to disable rsyncd:\n"
"```\n"
"# chkconfig rsyncd off\n"
"# systemctl disable rsyncd\n"
"# update-rc.d rsyncd disable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"rsyncd.service\""
" }}"
" existence:{should_exist: false}"
" non_compliance_msg: \"a config file in /etc/systemd/system enables rsyncd\""
" file_display_command: \"find /etc/systemd/system -name rsyncd.service\""
" }"
"}}"
}
}
benchmark_configs: {
id: "rsh-client-not-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure rsh client is not installed"
description: "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 rsh "
"package removes the clients for rsh , rcp and rlogin ."
remediation:
"Uninstall rsh using the appropriate package manager or manual "
"installation:\n"
"```\n"
"yum remove rsh\n"
"apt-get remove rsh\n"
"zypper remove rsh\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/rsh\"}}"
" files_to_check:{single_file:{path:\"/usr/sbin/rsh\"}}"
" files_to_check:{single_file:{path:\"/bin/rsh\"}}"
" files_to_check:{single_file:{path:\"/sbin/rsh\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "talk-client-not-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure talk client is not installed"
description:
"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."
remediation:
"Uninstall talk using the appropriate package manager or manual "
"installation:\n"
"```\n"
"yum remove talk\n"
"apt-get remove talk\n"
"zypper remove talk\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/talk\"}}"
" files_to_check:{single_file:{path:\"/usr/sbin/talk\"}}"
" files_to_check:{single_file:{path:\"/bin/talk\"}}"
" files_to_check:{single_file:{path:\"/sbin/talk\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "telnet-client-not-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure telnet client is not installed"
description:
"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 ssh package provides an encrypted session and "
"stronger security and is included in most Linux distributions."
remediation:
"Uninstall telnet using the appropriate package manager or manual "
"installation:\n"
"```\n"
"# yum remove telnet\n"
"# apt-get remove telnet\n"
"# zypper remove telnet\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/telnet\"}}"
" files_to_check:{single_file:{path:\"/usr/sbin/telnet\"}}"
" files_to_check:{single_file:{path:\"/bin/telnet\"}}"
" files_to_check:{single_file:{path:\"/sbin/telnet\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "ldap-client-not-installed"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure LDAP client is not installed"
description:
"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."
remediation:
"Uninstall openldap-clients using the appropriate package manager or "
"manual installation:"
"# yum remove openldap-clients\n"
"# apt-get remove openldap-clients\n"
"# zypper remove openldap-clients"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/usr/bin/ldapadd\"}}"
" files_to_check:{single_file:{path:\"/usr/sbin/ldapadd\"}}"
" files_to_check:{single_file:{path:\"/bin/ldapadd\"}}"
" files_to_check:{single_file:{path:\"/sbin/ldapadd\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "ip-forwarding-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure IP forwarding is disabled"
description:
"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."
remediation:
"Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.ip_forward = 0\n"
"net.ipv6.conf.all.forwarding = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.ip_forward=0\n"
"# sysctl -w net.ipv6.conf.all.forwarding=0\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"# sysctl -w net.ipv6.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/ip_forward\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv6/conf/all/forwarding\"}}"
" content:{content:\"0\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.ip_forward *=.*\""
" expected_regex: \"net.ipv4.ip_forward *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.forwarding *=.*\""
" expected_regex: \"net.ipv6.conf.all.forwarding *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables IP forwarding\""
" file_display_command: \"grep -l 'ip_forward\\\\|forwarding' /etc/sysctl.d/*\""
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/sysctl.d\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.ip_forward *=.*\""
" expected_regex: \"net.ipv4.ip_forward *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.forwarding *=.*\""
" expected_regex: \"net.ipv6.conf.all.forwarding *= *0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "icmp-redirects-not-accepted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure ICMP redirects are not accepted"
description:
"ICMP redirect messages are packets that convey routing information and tell\n"
"your host (acting as a router) to send packets via an alternate path. It is a\n"
"way of allowing an outside routing device to update your system routing\n"
"tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all\n"
"accept_redirects to 0, the system will not accept any ICMP redirect messages,\n"
"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\n"
"system routing tables and get them to send packets to incorrect networks and\n"
"allow your system packets to be captured."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.accept_redirects = 0\n"
"net.ipv4.conf.default.accept_redirects = 0\n"
"net.ipv6.conf.all.accept_redirects = 0\n"
"net.ipv6.conf.default.accept_redirects = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.accept_redirects=0\n"
"# sysctl -w net.ipv4.conf.default.accept_redirects=0\n"
"# sysctl -w net.ipv6.conf.all.accept_redirects=0\n"
"# sysctl -w net.ipv6.conf.default.accept_redirects=0\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"# sysctl -w net.ipv6.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/all/accept_redirects\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/default/accept_redirects\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv6/conf/all/accept_redirects\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv6/conf/default/accept_redirects\"}}"
" content:{content:\"0\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.accept_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.accept_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.accept_redirects *=.*\""
" expected_regex: \"net.ipv6.conf.all.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.default.accept_redirects *=.*\""
" expected_regex: \"net.ipv6.conf.default.accept_redirects *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables accept_redirects\""
" file_display_command: \"grep -l 'accept_redirects' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.accept_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.accept_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.accept_redirects *=.*\""
" expected_regex: \"net.ipv6.conf.all.accept_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.default.accept_redirects *=.*\""
" expected_regex: \"net.ipv6.conf.default.accept_redirects *= *0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "secure-icmp-redirects-not-accepted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure secure ICMP redirects are not accepted"
description:
"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."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.secure_redirects = 0\n"
"net.ipv4.conf.default.secure_redirects = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.secure_redirects=0\n"
"# sysctl -w net.ipv4.conf.default.secure_redirects=0\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/all/secure_redirects\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/default/secure_redirects\"}}"
" content:{content:\"0\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.secure_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.secure_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.secure_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.secure_redirects *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables secure ICMP redirects\""
" file_display_command: \"grep -l 'secure_redirects' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.secure_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.all.secure_redirects *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.secure_redirects *=.*\""
" expected_regex: \"net.ipv4.conf.default.secure_redirects *= *0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "suspicious-packets-logged"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure suspicious packets are logged"
description:
"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."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv4.conf.all.log_martians = 1\n"
"net.ipv4.conf.default.log_martians = 1\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv4.conf.all.log_martians=1\n"
"# sysctl -w net.ipv4.conf.default.log_martians=1\n"
"# sysctl -w net.ipv4.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/all/log_martians\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv4/conf/default/log_martians\"}}"
" content:{content:\"1\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.log_martians *=.*\""
" expected_regex: \"net.ipv4.conf.all.log_martians *= *1\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.log_martians *=.*\""
" expected_regex: \"net.ipv4.conf.default.log_martians *= *1\""
" }"
" }"
" non_compliance_msg: \"no config file in /etc/sysctl.d/ enables logging suspicious packets\""
" file_display_command: \"grep -l 'log_martians' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.all.log_martians *=.*\""
" expected_regex: \"net.ipv4.conf.all.log_martians *= *1\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv4.conf.default.log_martians *=.*\""
" expected_regex: \"net.ipv4.conf.default.log_martians *= *1\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "ipv6-router-advertisements-not-accepted"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure IPv6 router advertisements are not accepted"
description:
"This setting disables the system's ability to accept IPv6 router "
"advertisements."
rationale:
"It is recommended that systems do 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."
remediation:
"Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:\n"
"```\n"
"net.ipv6.conf.all.accept_ra = 0\n"
"net.ipv6.conf.default.accept_ra = 0\n"
"```\n"
"Run the following commands to set the active kernel parameters:\n"
"```\n"
"# sysctl -w net.ipv6.conf.all.accept_ra=0\n"
"# sysctl -w net.ipv6.conf.default.accept_ra=0\n"
"# sysctl -w net.ipv6.route.flush=1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv6/conf/all/accept_ra\"}}"
" files_to_check:{single_file:{path:\"/proc/sys/net/ipv6/conf/default/accept_ra\"}}"
" content:{content:\"0\\n\"}"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.accept_ra *=.*\""
" expected_regex: \"net.ipv6.conf.all.accept_ra *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.default.accept_ra *=.*\""
" expected_regex: \"net.ipv6.conf.default.accept_ra *= *0\""
" }"
" }"
" non_compliance_msg: \"a config file in /etc/sysctl.d/ enables IPv6 router advertisements\""
" file_display_command: \"grep -l 'accept_ra' /etc/sysctl.d/*\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sysctl.d/\""
" recursive: true"
" }}"
" content_entry: {"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.all.accept_ra *=.*\""
" expected_regex: \"net.ipv6.conf.all.accept_ra *= *0\""
" }"
" match_criteria: {"
" filter_regex: \"net.ipv6.conf.default.accept_ra *=.*\""
" expected_regex: \"net.ipv6.conf.default.accept_ra *= *0\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "logfile-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on all logfiles are configured"
description:
"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."
remediation:
"Run the following commands to set permissions on all existing log files:\n"
"```\n"
"find /var/log -type f -exec chmod g-wx,o-rwx \"{}\" + -o -type d -exec chmod gw,o-rwx \"{}\" +\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/var/log\""
" files_only: true"
" recursive: true"
" skip_symlinks: true"
" }}"
" permission:{clear_bits: 0037}"
" non_compliance_msg: \"there are files under /var/log with g+wx or o+rwx permissions\""
" file_display_command: \"find /var/log -type f -ls\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/var/log\""
" files_only: true"
" recursive: true"
" skip_symlinks: true"
" }}"
" permission:{clear_bits: 0037}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "logrotate-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure logrotate is configured"
description:
"The system includes the capability of rotating log files regularly to "
"avoid filling up the system with logs or making the logs unmanageably "
"large. The file /etc/logrotate.d/syslog is the configuration file used "
"to rotate log files created by syslog or rsyslog."
rationale:
"By keeping the log files smaller and more manageable, a system "
"administrator can easily archive these files to another system and "
"spend less time looking through inordinately large log files."
remediation:
"Edit /etc/logrotate.conf and /etc/logrotate.d/* to ensure logs are "
"rotated according to site policy."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/logrotate.conf\"}}"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/logrotate.d\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
# Expect some kind of policy in the file (i.e. not just comments).
" filter_regex: \"[^#].*\""
" expected_regex: \"[^#].*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-daemon-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure cron daemon is enabled"
description: "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."
remediation:
"Based on your system configuration, run the appropriate one of the "
"following commands to enable cron:\n"
"```\n"
"# chkconfig crond on\n"
"# systemctl enable crond\n"
"# update-rc.d crond enable\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"cron(d)?.service\""
" }}"
" existence:{should_exist: true}"
" }"
"}}"
}
}
benchmark_configs: {
id: "crontab-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/crontab are configured"
description:
"The /etc/crontab file is used by cron to 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."
remediation:
"Run the following commands to set ownership and permissions on /etc/crontab:\n"
"```\n"
"# chown root:root /etc/crontab\n"
"# chmod og-rwx /etc/crontab\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/crontab\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-hourly-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/cron.hourly are configured"
description:
"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."
remediation:
"Run the following commands to set ownership and permissions on /etc/cron.hourly:\n"
"```\n"
"# chown root:root /etc/cron.hourly\n"
"# chmod og-rwx /etc/cron.hourly\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.hourly\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-daily-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/cron.daily are configured"
description:
"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."
remediation:
"Run the following commands to set ownership and permissions on /etc/cron.daily:\n"
"```\n"
"# chown root:root /etc/cron.daily\n"
"# chmod og-rwx /etc/cron.daily\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.daily\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-weekly-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/cron.weekly are configured"
description:
"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."
remediation:
"Run the following commands to set ownership and permissions on /etc/cron.weekly:\n"
"```\n"
"# chown root:root /etc/cron.weekly\n"
"# chmod og-rwx /etc/cron.weekly\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.weekly\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-monthly-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/cron.monthly are configured"
description:
"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."
remediation:
"Run the following commands to set ownership and permissions on /etc/cron.monthly:\n"
"```\n"
"# chown root:root /etc/cron.monthly\n"
"# chmod og-rwx /etc/cron.monthly\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.monthly\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "cron-d-permissions"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure permissions on /etc/cron.d are configured"
description:
"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."
remediation:
"Run the following commands to set ownership and permissions on /etc/cron.d:\n"
"```\n"
"# chown root:root /etc/cron.d\n"
"# chmod og-rwx /etc/cron.d\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.d\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "at-cron-restricted-to-authorized-users"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure at/cron is restricted to authorized users"
description:
"Configure /etc/cron.allow and /etc/at.allow to allow specific users to "
"use these services. If /etc/cron.allow or /etc/at.allow do not exist, "
"then /etc/at.deny and /etc/cron.deny are 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.allow and /etc/at.allow "
"are 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.allow file 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 cron jobs. Using the cron.allow file to control who can run "
"cron jobs enforces this policy. It is easier to manage an allow list "
"than a deny list. In a deny list, you could potentially add a user ID "
"to the system and forget to add it to the deny files."
remediation:
"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:\n"
"```\n"
"# rm /etc/cron.deny\n"
"# rm /etc/at.deny\n"
"# touch /etc/cron.allow\n"
"# touch /etc/at.allow\n"
"# chmod og-rwx /etc/cron.allow\n"
"# chmod og-rwx /etc/at.allow\n"
"# chown root:root /etc/cron.allow\n"
"# chown root:root /etc/at.allow\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.deny\"}}"
" files_to_check:{single_file:{path:\"/etc/at.deny\"}}"
" existence:{should_exist: false}"
" }"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.allow\"}}"
" files_to_check:{single_file:{path:\"/etc/at.allow\"}}"
" permission:{"
" clear_bits: 0077"
" user: {name: \"root\" should_own: true}"
" group: {name: \"root\" should_own: true}"
" }"
" }"
"}"
"check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/cron.deny\"}}"
" files_to_check:{single_file:{path:\"/etc/at.deny\"}}"
" files_to_check:{single_file:{path:\"/etc/cron.allow\"}}"
" files_to_check:{single_file:{path:\"/etc/at.allow\"}}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "ssh-access-limited"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH access is limited"
description:
"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:\n"
"AllowUsers\n"
"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.\n"
"AllowGroups\n"
"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.\n"
"DenyUsers\n"
"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.\n"
"DenyGroups\n"
"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."
remediation:
"Edit the /etc/ssh/sshd_config file to set one or more of the parameter "
"as follows:\n"
"```\n"
"AllowUsers <userlist>\n"
"AllowGroups <grouplist>\n"
"DenyUsers <userlist>\n"
"DenyGroups <grouplist>\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"AllowUsers|AllowGroups|DenyUsers|DenyGroups .*\""
" expected_regex: \"AllowUsers|AllowGroups|DenyUsers|DenyGroups .*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "password-creation-reqs-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure password creation requirements are configured"
description:
"The pam_cracklib.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_cracklib.so options.\n"
"* try_first_pass - retrieve the password from a previous stacked PAM module. "
"If not available, then prompt the user for a password.\n"
"* retry=3 - Allow 3 tries before sending back a failure.\n"
"* minlen=14 - password must be 14 characters or more\n"
"* dcredit=-1 - provide at least one digit\n"
"* ucredit=-1 - provide at least one uppercase character\n"
"* ocredit=-1 - provide at least one special character\n"
"* lcredit=-1 - provide at least one lowercase character\n"
"The pam_pwquality.so module functions similarly but the minlen, dcredit, "
"ucredit, ocredit, and lcredit parameters are stored in the "
"/etc/security/pwquality.conf file. 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."
remediation:
"Set password creation requirements to conform to site policy. Many "
"distributions provide tools for updating PAM configuration, consult "
"your documentation for details. If no tooling is provided edit the "
"appropriate /etc/pam.d/ configuration file and add or modify the "
"pam_cracklib.so or pam_pwquality.so lines to include the required "
"options:\n"
"```\n"
"password required pam_cracklib.so try_first_pass retry=3 minlen=14 dcredit=-1\n"
"ucredit=-1 ocredit=-1 lcredit=-1\n"
"password requisite pam_pwquality.so try_first_pass retry=3\n"
"```\n"
"If pam_pwquality.so is in use also configure settings in "
"/etc/security/pwquality.conf:\n"
"```\n"
"minlen = 14\n"
"dcredit = -1\n"
"ucredit = -1\n"
"ocredit = -1\n"
"lcredit = -1\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/pam.d\""
" filename_regex: \"(system-auth)|(common-password)\""
" recursive: false"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"password.*pam_(cracklib|pwquality).so.*\""
" expected_regex: \"password.*required.*pam_(cracklib|pwquality).so.*minlen=(\\\\d+).*\""
" group_criteria: {"
" group_index: 2"
" type: GREATER_THAN"
" const: 13"
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "failed-password-lockout-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure lockout for failed password attempts is configured"
description:
"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."
remediation:
"Set password lockouts to conform to site policy. Many distributions "
"provide tools for updating PAM configuration, consult your "
"documentation for details. If no tooling is provided edit the "
"appropriate /etc/pam.d/ configuration file and add or modify the "
"pam_tally2.so or pam_faillock.so lines as appropriate:\n"
"```\n"
"auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900\n"
"auth required pam_faillock.so preauth audit silent deny=5 unlock_time=900\n"
"auth sufficient pam_unix.so\n"
"auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900\n"
"auth sufficient pam_faillock.so authsucc audit deny=5 unlock_time=900\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/pam.d\""
" filename_regex: \"(system-auth)|(common-password)\""
" recursive: false"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"auth.*unlock_time=.*\""
" expected_regex: \"auth.*unlock_time=.*\""
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "default-user-umask-027-or-more-restrictive"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure default user umask is 027 or more restrictive"
description:
"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."
remediation:
"Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and "
"the appropriate files for any other shell supported on your system) and "
"add or edit any umask parameters as follows:\n"
"```\n"
"umask 027\n"
"```\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/bash/bashrc\"}}"
" files_to_check:{single_file:{path:\"/etc/profile\"}}"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/profile.d\""
" filename_regex: \".*\\\\.sh\""
" recursive: true"
" }}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"umask .*\""
" expected_regex: \"umask (\\\\d+)\""
" group_criteria: {"
" group_index: 1"
" type: NO_LESS_RESTRICTIVE_UMASK"
" const: 027"
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "no-world-writable-files"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no world writable files exist"
description:
"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."
remediation:
"Removing write access for the \"other\" category (chmod o-w <filename>)"
" is advisable, but always consult relevant vendor documentation to "
"avoid breaking any application dependencies on a given file. If the "
"permissions of a file can't be restricted, add it to the CIS scanner's "
"exclusion list."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{clear_bits: 0002}"
" non_compliance_msg: \"there are world-writable files on the filesystem\""
" file_display_command: \"df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type f -perm -0002\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{clear_bits: 0002}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "no-unowned-files-or-dirs"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no unowned files or directories exist"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{user:{name: \"\" should_own: false}}"
" non_compliance_msg: \"there are unowned files or directories on the filesystem\""
" file_display_command: \"df --local -P | awk {'if (NR!=1) print $6'} | xargs -I '{}' find '{}' -xdev -nouser\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{user:{name: \"\" should_own: false}}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "no-ungrouped-files-or-dirs"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no ungrouped files or directories exist"
description:
"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."
remediation:
"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."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{group:{name: \"\" should_own: false}}"
" non_compliance_msg: \"there are ungrouped files or directories on the filesystem\""
" file_display_command: \"df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -nogroup\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{group:{name: \"\" should_own: false}}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/passwd\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "audit-suid-execs"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Audit SUID executables"
description:
"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."
remediation:
"Ensure that no rogue SUID programs have been introduced into the "
"system. Review the files returned by the display_command "
"confirm the integrity of these binaries. If they have a valid reason to "
"be SUID, add them to the CIS scanner's exclusion list by editing the "
"scanner invocation script and adding the appropriate "
"`--filename-opt-out-regexes` argument. If a binary doesn't have a "
"valid reason to be SUID, remove the SUID flag from it."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{ clear_bits: 04000 }"
" non_compliance_msg: \"some files on the filesystem have the SUID bit set\""
" file_display_command: \"df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type f -perm -4000\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{ clear_bits: 04000 }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "audit-sgid-execs"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Audit SGID executables"
description:
"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."
remediation:
"Ensure that no rogue SGID programs have been introduced into the "
"system. Review the files returned by the display_command "
"confirm the integrity of these binaries. If they have a valid reason to "
"be SGID, add them to the CIS scanner's exclusion list by editing the "
"scanner invocation script and adding the appropriate "
"`--filename-opt-out-regexes` argument. If a binary doesn't have a "
"valid reason to be SGID, remove the SGID flag from it."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{instance_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{ clear_bits: 02000 }"
" non_compliance_msg: \"some files on the filesystem have the SGID bit set\""
" file_display_command: \"df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type f -perm -2000\""
" }"
" }"
"}"
"image_scanning:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/\""
" recursive: true"
" files_only: true"
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc\""
" opt_out_path_regexes: \"/sys\""
" opt_out_path_regexes: \"/dev\""
" }}"
" permission:{ clear_bits: 02000 }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "root-path-integrity"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure root PATH Integrity"
description:
"The root user can execute any command on the system and could be fooled "
"into executing programs unintentionally if the PATH is 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 root to execute "
"a Trojan horse program."
remediation: "Correct or justify any items discovered by the CIS document's Audit step."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
#Check the env vars of the scanner process's user. This assumes that the
# scanner is running as root.
"generic:{check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/environ\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" delimiter: \"\\0\""
# No empty dirs.
" match_criteria: {"
" filter_regex: \"PATH=.*\""
" expected_regex: \"PATH=.*::\""
" }"
# No trailing ':'.
" match_criteria: {"
" filter_regex: \"PATH=.*\""
" expected_regex: \"PATH=.*:$\""
" }"
" }"
" }"
# Directories have restricted permissions.
" file_checks:{"
" files_to_check:{unix_env_var_paths:{"
" var_name: \"PATH\""
" dirs_only: true"
" }}"
" permission:{"
" clear_bits: 0022"
" user: {name: \"root\" should_own: true}"
" }"
" }"
# No files among paths.
" file_checks:{"
" files_to_check:{unix_env_var_paths:{"
" var_name: \"PATH\""
" files_only: true"
" }}"
" existence:{should_exist: false}"
" }"
"}}"
}
}
benchmark_configs: {
id: "selinux-not-disabled-in-bootloader"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SELinux is not disabled in bootloader configuration"
description:
"Configure SELINUX to be enabled at boot time and verify that it has not been overwritten "
"by the grub boot parameters.\n"
"Note: This recommendation is designed around the grub 2 bootloader, if LILO or another "
"bootloader is in use in your environment enact equivalent settings."
rationale:
"SELinux must be enabled at boot time in your grub configuration to ensure that the "
"controls it provides are not overridden."
remediation:
"Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all\n"
"CMDLINE_LINUX parameters:\n"
"GRUB_CMDLINE_LINUX=\n"
"GRUB_CMDLINE_LINUX DEFAULT=\"quiet\"\n"
"Run the following command to update the grub2 configuration:\n"
"# grub2-mkconfig -o /boot/grub2/grub.cfg"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/default/grub\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*selinux=[0-9]+.*\""
" expected_regex: \".*selinux=0.*\""
" }"
" match_criteria: {"
" filter_regex: \".*enforcing=[0-9]+.*\""
" expected_regex: \".*enforcing=0.*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "selinux-policy-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SELinux policy is configured"
description:
"Configure SELinux to meet or exceed the default targeted policy, which constrains daemons "
"and system software only.\n"
"Note: If your organization requires stricter policies, ensure that they are set in the "
"/etc/selinux/config file."
rationale:
"Security configuration requirements vary from site to site. Some sites may mandate a "
"policy that is stricter than the default policy, which is perfectly acceptable. This item is "
"intended to ensure that at least the default recommendations are met."
remediation:
"Edit the /etc/selinux/config file to set the SELINUXTYPE parameter:\n"
"SELINUXTYPE=targeted"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/selinux/config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*SELINUXTYPE=[0-9a-zA-Z]+.*\""
" expected_regex: \".*SELINUXTYPE=(targeted|mls).*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "selinux-mode-enforcing-or-permissive"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure the SELinux mode is enforcing or permissive"
description:
"SELinux can run in one of three modes: disabled, permissive, or enforcing:\n"
"Enforcing - Is the default, and recommended, mode of operation; in enforcing mode "
"SELinux operates normally, enforcing the loaded security policy on the entire "
"system.\n"
"Permissive - The system acts as if SELinux is enforcing the loaded security policy, "
"including labeling objects and emitting access denial entries in the logs, but it does "
"not actually deny any operations. While not recommended for production systems ,"
"permissive mode can be helpful for SELinux policy development.\n"
"Disabled - Is strongly discouraged; not only does the system avoid enforcing the "
"SELinux policy, it also avoids labeling any persistent objects such as files, making it "
"difficult to enable SELinux in the future\n"
"Note: you can set individual domains to permissive mode while the system runs in enforcing "
"mode. For example, to make the httpd_t domain permissive:\n"
"# semanage permissive -a httpd_t"
rationale:
"Running SELinux in disabled mode is strongly discouraged; not only does the system avoid "
"enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, "
"making it difficult to enable SELinux in the future."
remediation:
"Run one of the following commands to set SELinux's running mode:\n"
"To set SELinux mode to Enforcing:\n"
"# setenforce 1\n"
"To set SELinux mode to Permissive:\n"
"# setenforce 0\n"
"Edit the /etc/selinux/config file to set the SELINUX parameter:\n"
"For Enforcing mode:\n"
"SELINUX=enforcing\n"
"For Permissive mode:\n"
"SELINUX=permissive\n"
"References:\n"
"https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/selinux/config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*SELINUX=[a-zA-Z0-9]+.*\""
" expected_regex: \".*SELINUX=(enforcing|permissive).*\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "no-unconfined-services"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure no unconfined services exist"
description:
"Unconfined processes run in unconfined domains"
"Note: Occasionally certain daemons such as backup or centralized management software may "
"require running unconfined. Any such software should be carefully analyzed and documented "
"before such an exception is made."
rationale:
"For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow "
"processes running in unconfined domains almost all access. Processes running in "
"unconfined domains fall back to using DAC rules exclusively. If an unconfined process is "
"compromised, SELinux does not prevent an attacker from gaining access to system "
"resources and data, but of course, DAC rules are still used. SELinux is a security "
"enhancement on top of DAC rules - it does not replace them"
remediation:
"Investigate any unconfined processes found during the audit action. They may need to have "
"an existing security context assigned to them or a policy built for them."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{"
" instance_scanning: {"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{"
" files_in_dir:{"
" dir_path:\"/proc\""
" recursive: true"
" filename_regex: \"current\""
" skip_symlinks: true"
" opt_out_path_regexes: \"/proc/[a-z].*\""
" }}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*unconfined_service_t.*\""
" expected_regex: \".*unconfined_service_t.*\""
" }"
" }"
" }"
" }"
"}}"
}
}
benchmark_configs: {
id: "gdm-login-banner-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure GDM login banner is configured"
description:
"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.\n"
"Note: If a graphical login is not required, it should be removed to reduce the attack surface "
"of the system."
remediation:
"Edit or create the file /etc/dconf/profile/gdmand add the following:\n"
"user-db:user\n"
"system-db:gdm\n"
"file-db:/usr/share/gdm/greeter-dconf-defaults\n"
"Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically\n"
"/etc/dconf/db/gdm.d/01-banner-message)\n"
"[org/gnome/login-screen]\n"
"banner-message-enable=true\n"
"banner-message-text=\"'<banner message>'\n"
"Example Banner Text: 'Authorized users only. All activity may be monitored and reported.'\n"
"Run the following command to update the system databases:\n"
"# dconf update"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/dconf/profile/gdm\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*user-db:user.*\""
" expected_regex: \"\\\\s*user-db:user.*\""
" }"
" match_criteria: {"
" filter_regex: \"\\\\s*system-db:gdm.*\""
" expected_regex: \"\\\\s*system-db:gdm.*\""
" }"
" match_criteria: {"
" filter_regex: \"\\\\s*file-db:/usr/share/gdm/greeter-dconf-defaults.*\""
" expected_regex: \"\\\\s*file-db:/usr/share/gdm/greeter-dconf-defaults.*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{dir_path:\"/etc/dconf/db/gdm.d/\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*banner-message-enable=[a-z]+\""
" expected_regex: \"\\\\s*banner-message-enable=true\""
" }"
" match_criteria: {"
" filter_regex: \"\\\\s*banner-message-text=.+\""
" expected_regex: \"\\\\s*banner-message-text=.+\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/dconf/profile/gdm\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "last-logged-user-display-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure last logged in user display is disabled"
description:
"GDM is the GNOME Display Manager which handles graphical login for GNOME based "
"systems."
rationale:
"Displaying the last logged in user eliminates half of the Userid/Password equation that an "
"unauthorized person would need to log on.\n"
"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.\n"
"Notes:"
"If a graphical login is not required, it should be removed to reduce the attack surface "
"of the system.\n"
"If a different GUI login service is in use and required on the system, consult your "
"documentation to disable displaying the last logged on user."
remediation:
"Edit or create the file /etc/dconf/profile/gdmand add the following:\n"
"user-db:user\n"
"system-db:gdm\n"
"file-db:/usr/share/gdm/greeter-dconf-defaults\n"
"Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically\n"
"/etc/dconf/db/gdm.d/00-1ogin-screen)\n"
"[org/gnome/login-screen]\n"
"# Do not show the user list\n"
"disable-user-list=true\n"
"Run the following command to update the system databases:\n"
"# dconf update"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/dconf/profile/gdm\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*user-db:user.*\""
" expected_regex: \"\\\\s*user-db:user.*\""
" }"
" match_criteria: {"
" filter_regex: \"\\\\s*system-db:gdm.*\""
" expected_regex: \"\\\\s*system-db:gdm.*\""
" }"
" match_criteria: {"
" filter_regex: \"\\\\s*file-db:/usr/share/gdm/greeter-dconf-defaults.*\""
" expected_regex: \"\\\\s*file-db:/usr/share/gdm/greeter-dconf-defaults.*\""
" }"
" }"
" }"
" file_checks:{"
" files_to_check:{files_in_dir:{dir_path:\"/etc/dconf/db/gdm.d/\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*disable-user-list=[a-z]+\""
" expected_regex: \"\\\\s*disable-user-list=true\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/dconf/profile/gdm\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "xdcmp-not-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure XDCMP is not enabled"
description:
"X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access "
"to display management services for remote displays"
rationale:
"XDMCP is inherently insecure.\n"
"XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes "
"entered by a user.\n"
"XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to "
"steal the credentials of legitimate users by impersonating the XDMCP server."
remediation:
"Edit the file /etc/gdm/custom.conf and remove the line\n"
"Enable=true\n"
"Default Value:\n"
"false \n"
"# This is denoted by no Enabled= entry in the file /etc/gdm/custom.conf in the\n"
"# [xdmcp] section\n"
"# References:\n"
"# 1. https://help.gnome.org/admin/gdm/2.32/configuration.html.en\n"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gdm/custom.conf\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \"\\\\s*Enable\\\\s*=\\\\s*[0-9a-zA-Z]+\""
" expected_regex: \"\\\\s*Enable\\\\s*=\\\\s*true\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/gdm/custom.conf\"}}"
" existence:{should_exist: false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "mail-transfer-agent-is-configured-for-localonly-mode"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure mail transfer agent is configured for local-only mode"
description:
"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.\n"
"Notes:\n"
"This recommendation is designed around the postfix mail server.\n"
"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."
remediation:
"Edit /etc/postfix/main.ct and add the following line to the RECEIVING MAIL section. If\n"
"the line already exists, change it to look like the line below:\n"
"inet_interfaces = loopback-only\n"
"Run the following command to restart postfix:\n"
"# systemctl restart postfix"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"scan_type_specific:{"
" instance_scanning: {"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/net/tcp\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*0100007F:0019.*\""
" expected_regex: \".*0100007F:0019.*\""
" }"
" }}"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/proc/self/net/tcp6\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \".*00000000000000000000000001000000:0019.*\""
" expected_regex: \".*00000000000000000000000001000000:0019.*\""
" }"
" }}"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{"
" single_file:{path:\"/proc/self/net/tcp6\"}"
" }"
" files_to_check:{"
" single_file:{path:\"/proc/self/net/tcp\"}"
" }"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria: {"
" filter_regex: \".*[0-9A-F]+:0019.*\""
" }"
" }}"
" }"
"}}"
}
}
benchmark_configs: {
id: "nftables-rules-are-permanent"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure nftables rules are permanent"
description:
"nftables is a subsystem of the Linux kernel providing filtering and classification of network "
"packets/datagrams/frames."
"The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or "
"files to include in the nftables ruleset."
"A nftables ruleset containing the input, forward, and output base chains allow network "
"traffic to be filtered."
rationale:
"Changes made to nftables ruleset only affect the live system, you will also need to configure "
"the nftables ruleset to apply on boot"
remediation:
"Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include\n"
"Absolute path to nftables rules file>for each nftables file you want included in the\n"
"nftables ruleset on boot:\n"
"Example:\n"
"include \"/etc/nftables/nftables.rules\""
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system/\""
" recursive: true"
" filename_regex: \"nftables.service\""
" }"
" }"
" files_to_check:{single_file:{"
" path:\"/etc/sysconfig/nftables.conf\""
" }"
" }"
" existence:{should_exist:true}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system/\""
" recursive: true"
" filename_regex: \"nftables.service\""
" }"
" }"
" existence:{should_exist:false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "iptables-rules-are-saved"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure iptables rules are saved"
description:
"The iptables-services package includes the /etc/sysconfig/iptables file. The "
"iptables rules in this file will be loaded by the iptables.service during boot, or when it "
"is started or re-loaded."
rationale:
"If the iptables rules are not saved and a system re-boot occurs, the iptables rules will be "
"lost."
remediation:
"Run the following command to save any configuration to file:\n"
"# service iptables save"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/sysconfig/iptables\""
" }"
" }"
" existence:{should_exist:true}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"iptables.service\""
" }}"
" existence:{should_exist: false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ip6tables-rules-are-saved"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure ip6tables rules are saved"
description:
"The iptables-services package includes the /etc/sysconfig/ip6tables file. The "
"ip6tables rules in this file will be loaded by the ip6tables.service during boot, or when "
"it is started or re-loaded."
rationale:
"If the ip6tables rules are notsaved and a system re-boot occurs, the ip6tables rules will "
"be lost."
remediation:
"Run the following command to save any configuration to file:\n"
"# service ip6tables save"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/sysconfig/ip6tables\""
" }"
" }"
" existence:{should_exist:true}"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system\""
" recursive: true"
" filename_regex: \"ip6tables.service\""
" }}"
" existence:{should_exist: false}"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "rsyslog-service-enabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure rsyslog Service is enabled and running"
description: "rsyslog needs to be enabled and running to perform logging"
rationale:
"If the rsyslog service is not activated the system may default to the sys1ogd service or lack "
"logging instead."
remediation:
"Run the following command to enable and start rsysiog:\n"
"# systemctl --now enable rsyslog"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/systemd/system/\""
" recursive: true"
" filename_regex: \"rsyslog.service\""
" }"
" }"
" existence:{should_exist:true}"
" }"
" }}"
}
}
benchmark_configs: {
id: "rsyslog-default-file-permissions-configured"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure rsyslog default file permissions configured"
description:
"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.\n"
"The $FilecreateMode parameter specifies the file creation mode with which rsyslogd "
"creates new files. If not specified, the value 0644 is used.\n"
"Notes\n:"
"The value given must always be a 4-digit octal number, with the initial digit being "
"zero.\n"
"This setting can be overridden by a less restrictive setting in any file ending in .conf in "
"the /etc/rsyslog.d/ directory"
rationale:
"It is important to ensure that log files have the correct permissions to ensure that sensitive "
"data is archived and protected."
remediation:
"Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FilecreateMode to "
"0640 or more restrictive:\n"
"$FileCreateMode 0640\n"
"References:\n"
"1. See the rsyslog.conf(5) man page for more information."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/rsyslog.d/\""
" filename_regex: \"*.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*\\\\$FileCreateMode [0-9]+\""
" expected_regex: \"\\\\s*\\\\$FileCreateMode 0[640][40]0\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/rsyslog.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*\\\\$FileCreateMode [0-9]+\""
" expected_regex: \"\\\\s*\\\\$FileCreateMode 0[640][40]0\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "rsyslog-configured-to-send-logs-to-remote-host"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure rsyslog is configured to send logs to a remote log host"
description:
"The rsysilog 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.\n"
"Note: Ensure that the selection of logfiles being sent follows local site policy"
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"
remediation:
"Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following"
"lines:\n"
"<files to sent to the remote log server> action (type=\"omfwd\" target=\"<FQDN or"
"ip of loghost>\" port=\"<port number>\" protocol=\"tcp\""
"<number of re-tries>\"\n"
"queue.type=\"LinkedList\"\n"
"action.resumeRetryCount\n"
"queue.size=<number of messages to queue>\")\n"
"Example:\n"
"*.* action (type=\"omfwd\" target=\"192.168.2.100\" port=\"514\" protocol=\"tcp\""
"action.resumeRetryCount=\"100\""
"queue. type=\"LinkedList\" queue.size=\"1000\")\n"
"Run the following command to reload the rsys1og configuration:\n"
"# systemctl restart rsyslog\n"
"References:\n"
"1. See the rsyslog.conf(5) man page for more information."
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/rsyslog.conf\""
" }"
" }"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/rsyslog.d/\""
" filename_regex: \"*.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*([^#]+\\\\s+)?action\\\\(([^#]+\\\\s+)?\\\\btarget=\\\"?[^#\\\"]+\\\"?\\\\b\""
" expected_regex: \"^\\\\s*([^#]+\\\\s+)?action\\\\(([^#]+\\\\s+)?\\\\btarget=\\\"?[^#\\\"]+\\\"?\\\\b\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/rsyslog.conf\""
" }"
" }"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/rsyslog.d/\""
" filename_regex: \"*.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^[^#]\\\\s*\\\\S+\\\\.\\\\*\\\\s+@\""
" expected_regex: \"^[^#]\\\\s*\\\\S+\\\\.\\\\*\\\\s+@\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "journald-is-configured-to-send-logs-to-rsyslog"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure journald is configured to send logs to rsyslog"
description:
"Data from journald may be stored in volatile memory or persisted locally on the server."
"Utilities exist to accept remote export of journald logs, however, use of the rsyslog service "
"provides a consistent means of log collection and export.\n"
"Notes:\n"
"This recommendation assumes that recommendation 4.2.1.5, \"Ensure rsyslog is "
"configured to send logs to a remote log host\" has been implemented.\n"
"The main configuration file /etc/systemd/journald. conf is read before any of the "
"custom *.conf files. If there are custom configs present, they override the main "
"configuration parameters\n"
"As noted in the journald man pages: journald logs may be exported to rsyslog either "
"through the process mentioned here, or through a facility like systemd-"
"journald.service. There are trade-offs involved in each implementation, where "
"ForwardToSyslog Will immediately capture all events (and forward to an external log "
"server, if properly configured), but may not capture all boot-up activities. Mechanisms "
"such as systemd-journald.service, on the other hand, will record bootup events, but "
"may delay sending the information to rsyslog, leading to the potential for log "
"manipulation prior to export. Be aware of the limitations of all tools employed to "
"secure a system."
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."
remediation:
"Edit the /etc/systemd/journald.conf file and add the following line:\n"
"ForwardToSyslog=yes\n"
"References:\n"
"1. https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsyste"
"mdjournaldconf"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/systemd/journald.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*ForwardToSyslog=[a-z]+\""
" expected_regex: \"\\\\s*ForwardToSyslog=yes\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "journald-is-configured-to-compress-large-log-files"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure journald is configured to compress large log files"
description:
"The journald system includes the capability of compressing overly large files to avoid filling "
"up the system with logs or making the logs unmanageably large.\n"
"Note: The main configuration file /etc/systemd/journald. conf is read before any of the "
"custom *.conf files. If there are custom configs present, they override the main configuration "
"parameters"
rationale:
"Uncompressed large files may unexpectedly fill a filesystem leading to resource "
"unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem "
"impacts."
remediation:
"Edit the /etc/systemd/journald.cont file and add the following line:\n"
"Compress=yes\n"
"References:\n"
"1. https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsyste"
"mdjournaldconf"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/systemd/journald.conf\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"\\\\s*Compress=[a-z]\""
" expected_regex: \"\\\\s*Compress=yes\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "sudo-commands-use-pty"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure sudo commands use pty"
description:
"sudo can be configured to run only from a pseudo-pty\n"
"Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the "
"sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for "
"parse errors. If the sudoers file is currently being edited you will receive a message to try "
"again later. The -f option allows you to tell visudo which file to edit."
rationale:
"Attackers can run a malicious program using sudo, which would again fork a background "
"process that remains even when the main program has finished executing.\n"
"This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, "
"whether 1/0 logging is turned on or not."
remediation:
"Edit the file /etc/sudoers orafile in /etc/sudoers.d/ with visudo or visudo "
"and add the following line:\n"
"Defaults use_pty"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/sudoers\""
" }"
" }"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sudoers.d/\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*Defaults\\\\s+([^#]\\\\S+,\\\\s*)?use_pty\b\""
" expected_regex: \"^\\\\s*Defaults\\\\s+([^#]\\\\S+,\\\\s*)?use_pty\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "sudo-log-file-exists"
compliance_note: {
version: { cpe_uri: "cpe:/o:centos:centos:7.%02" version: "3.1.2" benchmark_document: "CIS Centos Linux 7.x" }
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure sudo log file exists"
description:
"sudo can use a custom log file\n"
"Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the "
"sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for "
"parse errors. If the sudoers file is currently being edited you will receive a message to try "
"again later. The -f option allows you to tell visudo which file to edit."
rationale:
"A sudo log file simplifies auditing of sudo commands\n"
"Impact:\n"
"Editing the sudo configuration incorrectly can cause sudo to stop functioning"
remediation:
"edit the file /etc/sudoers orafile in /etc/sudoers.d/ with visudo or visudo -f <PATH\n"
"To FILE>and add the following line:\n"
"Defaults logfile=\"<PATH TO CUSTOM LOG FILE>\"\n"
"Example:\n"
"Pefaults logfile=\"/var/log/sudo.log\"\n"
"References:\n"
"1. SUDO(8)\n"
"2. VISUDO(8)"
cis_benchmark: {
profile_level: 1
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{"
" path:\"/etc/sudoers\""
" }"
" }"
" files_to_check:{files_in_dir:{"
" dir_path:\"/etc/sudoers.d/\""
" }"
" }"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria: {"
" filter_regex: \"^\\\\s*Defaults\\\\s+([^#;]+,\\\\s*)?logfile\\\\s*=\\\\s*(\\\")?[^#;]+(\\\")?\""
" expected_regex: \"Defaults logfile=\\\"[/.a-z]\\\"\""
" }"
" }"
" }"
" }"
"}"
}
}
benchmark_configs: {
id: "ssh-allowtcpforwarding-disabled"
compliance_note: {
version: { cpe_uri: "cpe:/o:rockylinux:rockylinux:8.5" version: "1.0.0" benchmark_document: "CIS Rocky Linux 8" }
title: "Ensure SSH AllowTcpForwarding is disabled"
description:
"SSH port forwarding is a mechanism in SSH for tunneling application ports from the client "
"to the server, or servers to clients. It can be used for adding encryption to legacy "
"applications, going through firewalls, and some system administrators and IT professionals "
"use it for opening backdoors into the internal network from their home machines."
rationale:
"Leaving port forwarding enabled can expose the organization to security risks and back-"
"doors.\n"
"SSH connections are protected with strong encryption. This makes their contents invisible "
"to most deployed network monitoring and traffic filtering solutions. This invisibility carries "
"considerable risk potential if it is used for malicious purposes such as data exfiltration. "
"Cybercriminals or malware could exploit SSH to hide their unauthorized communications, "
"or to exfiltrate stolen data from the target network."
remediation:
"Edit the /etc/ssh/sshd_config file to set the parameter as follows:\n"
"```\n"
"AllowTcpForwarding no\n"
"```"
cis_benchmark: {
profile_level: 2
severity: LOW
}
scan_instructions:
"generic:{"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: ALL_MATCH_ANY_ORDER"
" match_criteria:{"
" filter_regex: \"\\\\s*AllowTcpForwarding\\\\s+.*\""
" expected_regex: \"AllowTcpForwarding\\\\s+no\""
" }"
" }"
" }"
" }"
" check_alternatives:{"
" file_checks:{"
" files_to_check:{single_file:{path:\"/etc/ssh/sshd_config\"}}"
" content_entry:{"
" match_type: NONE_MATCH"
" match_criteria:{"
" filter_regex: \"\\\\s*AllowTcpForwarding\\\\s+.*\""
" expected_regex: \"AllowTcpForwarding\\\\s+[^n][^o].*\""
" }"
" }"
" }"
" }"
"}"
}
}