Rules with ANSSI Reference in Guide to the Secure Configuration of Red Hat Enterprise Linux 7

Mapping | Rule Title | Description | Rationale
BP28(R1) NT007(R03) | Uninstall the telnet server | The telnet daemon should be uninstalled. | `telnet` allows clear text communications, and does not protect any data transmission between client and server. Any confidential data can be listened and no integrity checking is made.'
BP28(R1) | Uninstall rsh-server Package | The `rsh-server` package can be removed with the following command:
    $ sudo yum erase rsh-server
| The `rsh-server` service provides unencrypted remote access service which does not provide for the confidentiality and integrity of user passwords or the remote session and has very weak authentication. If a privileged user were to login using this service, the privileged user password could be compromised. The `rsh-server` package provides several obsolete and insecure network services. Removing it decreases the risk of those services' accidental (or intentional) activation.
BP28(R1) | Uninstall Sendmail Package | Sendmail is not the default mail transfer agent and is not installed by default. The `sendmail` package can be removed with the following command:
    $ sudo yum erase sendmail
| The sendmail software was not developed with security in mind and its design prevents it from being effectively contained by SELinux. Postfix should be used instead.
BP28(R1) | Remove telnet Clients | The telnet client allows users to start connections to other systems via the telnet protocol. | 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 Red Hat Enterprise Linux 7.
BP28(R1) | Remove tftp Daemon | Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot files between systems. TFTP does not support authentication and can be easily hacked. The package `tftp` is a client program that allows for connections to a `tftp` server. | It is recommended that TFTP be removed, unless there is a specific need for TFTP (such as a boot server). In that case, use extreme caution when configuring the services.
BP28(R1) | Uninstall xinetd Package | The `xinetd` package can be removed with the following command:
    $ sudo yum erase xinetd
| Removing the `xinetd` package decreases the risk of the xinetd service's accidental (or intentional) activation.
BP28(R1) | Uninstall rsh Package | The `rsh` package contains the client commands for the rsh services | 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`.
BP28(R1) | Uninstall talk-server Package | The `talk-server` package can be removed with the following command:
     $ sudo yum erase talk-server
| The talk software presents a security risk as it uses unencrypted protocols for communications. Removing the `talk-server` package decreases the risk of the accidental (or intentional) activation of talk services.
BP28(R1) | Uninstall tftp-server Package | The `tftp-server` package can be removed with the following command:
     $ sudo yum erase tftp-server
| Removing the `tftp-server` package decreases the risk of the accidental (or intentional) activation of tftp services. If TFTP is required for operational support (such as transmission of router configurations), its use must be documented with the Information Systems Securty Manager (ISSM), restricted to only authorized personnel, and have access control rules established.
BP28(R1) | Uninstall DHCP Server Package | If the system does not need to act as a DHCP server, the dhcp package can be uninstalled. The `dhcp` package can be removed with the following command:
    $ sudo yum erase dhcp
| Removing the DHCP server ensures that it cannot be easily or accidentally reactivated and disrupt network operation.
BP28(R1) | Uninstall telnet-server Package | The `telnet-server` package can be removed with the following command:
    $ sudo yum erase telnet-server
| It is detrimental for operating systems to provide, or install by default, functionality exceeding requirements or mission objectives. These unnecessary capabilities are often overlooked and therefore may remain unsecure. They increase the risk to the platform by providing additional attack vectors. The telnet service provides an unencrypted remote access service which does not provide for the confidentiality and integrity of user passwords or the remote session. If a privileged user were to login using this service, the privileged user password could be compromised. Removing the `telnet-server` package decreases the risk of the telnet service's accidental (or intentional) activation.
BP28(R1) | Uninstall talk Package | The `talk` package contains the client program for the Internet talk protocol, which allows the user to chat with other users on different systems. Talk is a communication program which copies lines from one terminal to the terminal of another user. The `talk` package can be removed with the following command:
    $ sudo yum erase talk
| The talk software presents a security risk as it uses unencrypted protocols for communications. Removing the `talk` package decreases the risk of the accidental (or intentional) activation of talk client program.
BP28(R1) | Uninstall ypserv Package | The `ypserv` package can be removed with the following command:
    $ sudo yum erase ypserv
| The NIS service provides an unencrypted authentication service which does not provide for the confidentiality and integrity of user passwords or the remote session. Removing the `ypserv` package decreases the risk of the accidental (or intentional) activation of NIS or NIS+ services.
BP28(R1) | Remove NIS Client | The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (`ypbind`) was used to bind a system to an NIS server and receive the distributed configuration files. | The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed.
BP28(R4) BP28(R66) | Ensure SELinux State is Enforcing | The SELinux state should be set to ``enforcing`` at system boot time. In the file `/etc/selinux/config`, add or correct the following line to configure the system to boot into enforcing mode:
    SELINUX=enforcing
| Setting the SELinux state to enforcing ensures SELinux is able to confine potentially compromised processes to the security policy, which is designed to prevent them from causing damage to the system or further elevating their privileges.
BP28(R5) NT28(R46) | Ensure rsyslog is Installed | Rsyslog is installed by default. The `rsyslog` package can be installed with the following command:
     $ sudo yum install rsyslog
| The rsyslog package provides the rsyslog daemon, which provides system logging services.
BP28(R5) NT28(R46) | Enable rsyslog Service | The `rsyslog` service provides syslog-style logging by default on Red Hat Enterprise Linux 7. The `rsyslog` service can be enabled with the following command:
    $ sudo systemctl enable rsyslog.service
| The `rsyslog` service must be running in order to provide logging services, which are essential to system administration.
BP28(R5) BP28(R59) | Ensure Users Re-Authenticate for Privilege Escalation - sudo !authenticate | The sudo `!authenticate` option, when specified, allows a user to execute commands using sudo without having to authenticate. This should be disabled by making sure that the `!authenticate` option does not exist in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Without re-authentication, users may access resources or perform tasks for which they do not have authorization. When operating systems provide the capability to escalate a functional capability, it is critical that the user re-authenticate.
BP28(R5) BP28(R59) | Ensure Users Re-Authenticate for Privilege Escalation - sudo NOPASSWD | The sudo `NOPASSWD` tag, when specified, allows a user to execute commands using sudo without having to authenticate. This should be disabled by making sure that the `NOPASSWD` tag does not exist in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Without re-authentication, users may access resources or perform tasks for which they do not have authorization. When operating systems provide the capability to escalate a functional capability, it is critical that the user re-authenticate.
BP28(R7) NT28(R43) NT12(R5) | Ensure Logs Sent To Remote Host | To configure rsyslog to send logs to a remote log server, open `/etc/rsyslog.conf` and read and understand the last section of the file, which describes the multiple directives necessary to activate remote logging. Along with these other directives, the system can be configured to forward its logs to a particular log server by adding or correcting one of the following lines, substituting ``logcollector`` appropriately. The choice of protocol depends on the environment of the system; although TCP and RELP provide more reliable message delivery, they may not be supported in all environments. To use UDP for log message delivery:
    *.* @logcollector
To use TCP for log message delivery:
    *.* @@logcollector
To use RELP for log message delivery:
    *.* :omrelp:logcollector
There must be a resolvable DNS CNAME or Alias record set to "`logcollector`" for logs to be sent correctly to the centralized logging utility. | A log server (loghost) receives syslog messages from one or more systems. This data can be used as an additional log source in the event a system is compromised and its local logs are suspect. Forwarding log messages to a remote loghost also provides system administrators with a centralized place to view the status of multiple hosts within the enterprise.
BP28(R08) | Ensure Software Patches Installed | If the system is joined to the Red Hat Network, a Red Hat Satellite Server, or a yum server, run the following command to install updates:
    $ sudo yum update
If the system is not configured to use one of these sources, updates (in the form of RPM packages) can be manually downloaded from the Red Hat Network and installed using `rpm`. NOTE: U.S. Defense systems are required to be patched within 30 days or sooner as local policy dictates. | Installing software updates is a fundamental mitigation against the exploitation of publicly-known vulnerabilities. If the most recent security patches and updates are not installed, unauthorized users may take advantage of weaknesses in the unpatched software. The lack of prompt attention to patching could result in a system compromise.
BP28(R9) | Enable ExecShield via sysctl | By default on Red Hat Enterprise Linux 7 64-bit systems, ExecShield is enabled and can only be disabled if the hardware does not support ExecShield or is disabled in `/etc/default/grub`. For Red Hat Enterprise Linux 7 32-bit systems, `sysctl` can be used to enable ExecShield. | ExecShield uses the segmentation feature on all x86 systems to prevent execution in memory higher than a certain address. It writes an address as a limit in the code segment descriptor, to control where code can be executed, on a per-process basis. When the kernel places a process's memory regions such as the stack and heap higher than this address, the hardware prevents execution in that address range. This is enabled by default on the latest Red Hat and Fedora systems if supported by the hardware.
BP28(R9) | Install PAE Kernel on Supported 32-bit x86 Systems | Systems that are using the 64-bit x86 kernel package do not need to install the kernel-PAE package because the 64-bit x86 kernel already includes this support. However, if the system is 32-bit and also supports the PAE and NX features as determined in the previous section, the kernel-PAE package should be installed to enable XD or NX support. The `kernel-PAE` package can be installed with the following command:
    $ sudo yum install kernel-PAE
The installation process should also have configured the bootloader to load the new kernel at boot. Verify this after reboot and modify `/etc/default/grub` if necessary. | On 32-bit systems that support the XD or NX bit, the vendor-supplied PAE kernel is required to enable either Execute Disable (XD) or No Execute (NX) support.
BP28(R9) | Enable NX or XD Support in the BIOS | Reboot the system and enter the BIOS or Setup configuration menu. Navigate the BIOS configuration menu and make sure that the option is enabled. The setting may be located under a Security section. Look for Execute Disable (XD) on Intel-based systems and No Execute (NX) on AMD-based systems. | Computers with the ability to prevent this type of code execution frequently put an option in the BIOS that will allow users to turn the feature on or off at will.
BP28(R10) | Prefer to use a 64-bit Operating System when supported | Prefer installation of 64-bit operating systems when the CPU supports it. | Use of a 64-bit operating system offers a few advantages, like a larger address space range for Address Space Layout Randomization (ASLR) and systematic presence of No eXecute and Execute Disable (NX/XD) protection bits.
BP28(R11) | IOMMU configuration directive | On x86 architecture supporting VT-d, the IOMMU manages the access control policy between the hardware devices and some of the system critical units such as the memory. To ensure that `iommu=force` is added as a kernel command line argument to newly installed kernels, ad `iommu=force` to the default Grub2 command line for Linux operating systems. Modify the line within `/etc/default/grub` as shown below:
    GRUB_CMDLINE_LINUX="... iommu=force ..."
Run the following command to update command line for already installed kernels:
    # grubby --update-kernel=ALL --args="iommu=force"
| On x86 architectures, activating the I/OMMU prevents the system from arbitrary accesses potentially made by hardware devices.
BP28(R12) | Add nodev Option to Non-Root Local Partitions | The `nodev` mount option prevents files from being interpreted as character or block devices. Legitimate character and block devices should exist only in the `/dev` directory on the root partition or within chroot jails built for system services. Add the `nodev` option to the fourth column of `/etc/fstab` for the line which controls mounting of any non-root local partitions. | The `nodev` mount option prevents files from being interpreted as character or block devices. The only legitimate location for device files is the `/dev` directory located on the root partition. The only exception to this is chroot jails, for which it is not advised to set `nodev` on these filesystems.
BP28(R12) | Add nosuid Option to /boot | The `nosuid` mount option can be used to prevent execution of setuid programs in `/boot`. The SUID and SGID permissions should not be required on the boot partition. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/boot`. | The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from boot partitions.
BP28(R12) | Add noexec Option to /var | The `noexec` mount option can be used to prevent binaries from being executed out of `/var`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var`. | The `/var` directory contains variable system data such as logs, mails and caches. No binaries should be executed from this directory.
BP28(R12) | Add nosuid Option to /tmp | The `nosuid` mount option can be used to prevent execution of setuid programs in `/tmp`. The SUID and SGID permissions should not be required in these world-writable directories. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/tmp`. | The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from temporary storage partitions.
BP28(R12) | Add nosuid Option to /srv | The `nosuid` mount option can be used to prevent execution of setuid programs in `/srv`. The SUID and SGID permissions should not be required in this directory. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/srv`. | The presence of SUID and SGID executables should be tightly controlled. The `/srv` directory contains files served by various network services such as FTP. Users should not be able to execute SUID or SGID binaries from this directory.
BP28(R12) | Add noexec Option to /var/log | The `noexec` mount option can be used to prevent binaries from being executed out of `/var/log`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var/log`. | Allowing users to execute binaries from directories containing log files such as `/var/log` should never be necessary in normal operation and can expose the system to potential compromise.
BP28(R12) | Add nosuid Option to /home | The `nosuid` mount option can be used to prevent execution of setuid programs in `/home`. The SUID and SGID permissions should not be required in these user data directories. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/home`. | The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from user home directory partitions.
BP28(R12) | Add noauto Option to /boot | The `noauto` mount option is used to prevent automatic mounting of th `/boot` partition. Add the `noauto` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/boot`. | The `/boot` partition contains the kernel and the bootloader. Access to the partition after the boot process finishes should not be needed. Files contained within this partition can be analysed and gained information can be used for exploit creation.
BP28(R12) BP28(R47) | Ensure /var/log Located On Separate Partition | System logs are stored in the `/var/log` directory. Ensure that `/var/log` has its own partition or logical volume at installation time, or migrate it using LVM. | Placing `/var/log` in its own partition enables better separation between log files and other files in `/var/`.
BP28(R12) | Add nodev Option to /tmp | The `nodev` mount option can be used to prevent device files from being created in `/tmp`. Legitimate character and block devices should not exist within temporary directories like `/tmp`. Add the `nodev` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/tmp`. | The only legitimate location for device files is the `/dev` directory located on the root partition. The only exception to this is chroot jails.
BP28(R12) | Add nosuid Option to /var/log | The `nosuid` mount option can be used to prevent execution of setuid programs in `/var/log`. The SUID and SGID permissions should not be required in directories containing log files. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var/log`. | The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from partitions designated for log files.
BP28(R12) | Add nosuid Option to /var/tmp | The `nosuid` mount option can be used to prevent execution of setuid programs in `/var/tmp`. The SUID and SGID permissions should not be required in these world-writable directories. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var/tmp`. | The presence of SUID and SGID executables should be tightly controlled. Users should not be able to execute SUID or SGID binaries from temporary storage partitions.
BP28(R12) | Ensure /home Located On Separate Partition | If user home directories will be stored locally, create a separate partition for `/home` at installation time (or migrate it later using LVM). If `/home` will be mounted from another system such as an NFS server, then creating a separate partition is not necessary at installation time, and the mountpoint can instead be configured later. | Ensuring that `/home` is mounted on its own partition enables the setting of more restrictive mount options, and also helps ensure that users cannot trivially fill partitions used for log or audit data storage.
BP28(R12) | Add noexec Option to /boot | The `noexec` mount option can be used to prevent binaries from being executed out of `/boot`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/boot`. | The `/boot` partition contains the kernel and the bootloader. No binaries should be executed from this partition after the booting process finishes.
BP28(R12) | Ensure /var Located On Separate Partition | The `/var` directory is used by daemons and other system services to store frequently-changing data. Ensure that `/var` has its own partition or logical volume at installation time, or migrate it using LVM. | Ensuring that `/var` is mounted on its own partition enables the setting of more restrictive mount options. This helps protect system services such as daemons or other programs which use it. It is not uncommon for the `/var` directory to contain world-writable directories installed by other software packages.
BP28(R12) | Add nosuid Option to /opt | The `nosuid` mount option can be used to prevent execution of setuid programs in `/opt`. The SUID and SGID permissions should not be required in this directory. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/opt`. | The presence of SUID and SGID executables should be tightly controlled. The `/opt` directory contains additional software packages. Users should not be able to execute SUID or SGID binaries from this directory.
BP28(R12) | Ensure /tmp Located On Separate Partition | The `/tmp` directory is a world-writable directory used for temporary file storage. Ensure it has its own partition or logical volume at installation time, or migrate it using LVM. | The `/tmp` partition is used as temporary storage by many programs. Placing `/tmp` in its own partition enables the setting of more restrictive mount options, which can help protect programs which use it.
BP28(R12) | Ensure /srv Located On Separate Partition | If a file server (FTP, TFTP...) is hosted locally, create a separate partition for `/srv` at installation time (or migrate it later using LVM). If `/srv` will be mounted from another system such as an NFS server, then creating a separate partition is not necessary at installation time, and the mountpoint can instead be configured later. | Srv deserves files for local network file server such as FTP. Ensuring that `/srv` is mounted on its own partition enables the setting of more restrictive mount options, and also helps ensure that users cannot trivially fill partitions used for log or audit data storage.
BP28(R12) | Add nosuid Option to /var | The `nosuid` mount option can be used to prevent execution of setuid programs in `/var`. The SUID and SGID permissions should not be required for this directory. Add the `nosuid` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var`. | The presence of SUID and SGID executables should be tightly controlled.
BP28(R12) | Ensure /usr Located On Separate Partition | It is recommended that the `/usr` directory resides on a separate partition. | The `/usr` partition contains system software, utilities and files. Putting it on a separate partition allows limiting its size and applying restrictions through mount options.
BP28(R12) | Add noexec Option to /var/tmp | The `noexec` mount option can be used to prevent binaries from being executed out of `/var/tmp`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var/tmp`. | Allowing users to execute binaries from world-writable directories such as `/var/tmp` should never be necessary in normal operation and can expose the system to potential compromise.
BP28(R12) | Ensure /boot Located On Separate Partition | It is recommended that the `/boot` directory resides on a separate partition. This makes it easier to apply restrictions e.g. through the `noexec` mount option. Eventually, the `/boot` partition can be configured not to be mounted automatically with the `noauto` mount option. | The `/boot` partition contains the kernel and bootloader files. Access to this partition should be restricted.
BP28(R12) | Add noexec Option to /home | The `noexec` mount option can be used to prevent binaries from being executed out of `/home`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/home`. | The `/home` directory contains data of individual users. Binaries in this directory should not be considered as trusted and users should not be able to execute them.
BP28(R12) | Add noexec Option to /tmp | The `noexec` mount option can be used to prevent binaries from being executed out of `/tmp`. Add the `noexec` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/tmp`. | Allowing users to execute binaries from world-writable directories such as `/tmp` should never be necessary in normal operation and can expose the system to potential compromise.
BP28(R12) | Add nodev Option to /home | The `nodev` mount option can be used to prevent device files from being created in `/home`. Legitimate character and block devices should exist only in the `/dev` directory on the root partition or within chroot jails built for system services. Add the `nodev` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/home`. | The only legitimate location for device files is the `/dev` directory located on the root partition. The only exception to this is chroot jails.
BP28(R12) | Add nodev Option to /var/tmp | The `nodev` mount option can be used to prevent device files from being created in `/var/tmp`. Legitimate character and block devices should not exist within temporary directories like `/var/tmp`. Add the `nodev` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/var/tmp`. | The only legitimate location for device files is the `/dev` directory located on the root partition. The only exception to this is chroot jails.
BP28(R12) | Add hidepid Option to /proc | The `hidepid` mount option is applicable to `/proc` and is used to control who can access the information in `/proc/[pid]` directories. The option can have one of the following values:
    0: Everybody may access all /proc/[pid] directories.
    1: Users may not access files and subdirectories inside any /proc/[pid] directories
       but their own. The /proc/[pid] directories themselves remain visible.
    2: Same as for mode 1, but in addition the /proc/[pid] directories belonging to other
       users become invisible.
For example, if you choose the value 2: Add the `hidepid=2` option to the fourth column of `/etc/fstab` for the line which controls mounting of `/proc`. | Users should not be able to see and access directories within /proc, which are not related to their own processes in a system. Otherwise, sensitive information from other users could be seem.
BP28(R12) | Ensure /opt Located On Separate Partition | It is recommended that the `/opt` directory resides on a separate partition. | The `/opt` partition contains additional software, usually installed outside the packaging system. Putting this directory on a separate partition makes it easier to apply restrictions e.g. through the `nosuid` mount option.
BP28(R12) | Ensure /var/tmp Located On Separate Partition | The `/var/tmp` directory is a world-writable directory used for temporary file storage. Ensure it has its own partition or logical volume at installation time, or migrate it using LVM. | The `/var/tmp` partition is used as temporary storage by many programs. Placing `/var/tmp` in its own partition enables the setting of more restrictive mount options, which can help protect programs which use it.
BP28(R13) | Verify that local System.map file (if exists) is readable only by root | Files containing sensitive informations should be protected by restrictive permissions. Most of the time, there is no need that these files need to be read by any non-root user To properly set the permissions of `/boot/System.map-*`, run the command:
    $ sudo chmod 0600 /boot/System.map-*
| The `System.map` file contains information about kernel symbols and can give some hints to generate local exploitation.
BP28(R15) | Ensure gpgcheck Enabled for Local Packages | `yum` should be configured to verify the signature(s) of local packages prior to installation. To configure `yum` to verify signatures of local packages, set the `localpkg_gpgcheck` to `1` in `/etc/yum.conf`. | Changes to any software components can have significant effects to the overall security of the operating system. This requirement ensures the software has not been tampered and has been provided by a trusted vendor. Accordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization.
BP28(R15) | Ensure Red Hat GPG Key Installed | To ensure the system can cryptographically verify base software packages come from Red Hat (and to connect to the Red Hat Network to receive them), the Red Hat GPG key must properly be installed. To install the Red Hat GPG key, run:
    $ sudo subscription-manager register
If the system is not connected to the Internet or an RHN Satellite, then install the Red Hat GPG key from trusted media such as the Red Hat installation CD-ROM or DVD. Assuming the disc is mounted in `/media/cdrom`, use the following command as the root user to import it into the keyring:
    $ sudo rpm --import /media/cdrom/RPM-GPG-KEY
Alternatively, the key may be pre-loaded during the RHEL installation. In such cases, the key can be installed by running the following command:
    sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
| Changes to software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. The Red Hat GPG key is necessary to cryptographically verify packages are from Red Hat.
BP28(R15) | Ensure gpgcheck Enabled In Main yum Configuration | The `gpgcheck` option controls whether RPM packages' signatures are always checked prior to installation. To configure yum to check package signatures before installing them, ensure the following line appears in `/etc/yum.conf` in the `[main]` section:
    gpgcheck=1
| Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor. Accordingly, patches, service packs, device drivers, or operating system components must be signed with a certificate recognized and approved by the organization. Verifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. Certificates used to verify the software must be from an approved Certificate Authority (CA).
BP28(R15) | Ensure gpgcheck Enabled for All yum Package Repositories | To ensure signature checking is not disabled for any repos, remove any lines from files in `/etc/yum.repos.d` of the form:
    gpgcheck=0
| Verifying the authenticity of the software prior to installation validates the integrity of the patch or upgrade received from a vendor. This ensures the software has not been tampered with and that it has been provided by a trusted vendor. Self-signed certificates are disallowed by this requirement. Certificates used to verify the software must be from an approved Certificate Authority (CA)."
BP28(R17) | Set the Boot Loader Admin Username to a Non-Default Value | The grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings. To maximize the protection, select a password-protected superuser account with unique name, and modify the `/etc/grub.d/01_users` configuration file to reflect the account name change. Do not to use common administrator account names like root, admin, or administrator for the grub2 superuser account. Change the superuser to a different username (The default is 'root').
    $ sed -i 's/\(set superuser=\).*/\1"<unique user ID>"/g' /etc/grub.d/01_users
Once the superuser account has been added, update the `grub.cfg` file by running:
    grub2-mkconfig -o /boot/grub2/grub.cfg
| Having a non-default grub superuser username makes password-guessing attacks less effective.
BP28(R17) | Set the UEFI Boot Loader Password | The grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings. Since plaintext passwords are a security risk, generate a hash for the password by running the following command:
    # grub2-setpassword
When prompted, enter the password that was selected. | Password protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.
BP28(R17) | Set the UEFI Boot Loader Admin Username to a Non-Default Value | The grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings. To maximize the protection, select a password-protected superuser account with unique name, and modify the `/etc/grub.d/01_users` configuration file to reflect the account name change. It is highly suggested not to use common administrator account names like root, admin, or administrator for the grub2 superuser account. Change the superuser to a different username (The default is 'root').
    $ sed -i 's/\(set superuser=\).*/\1"<unique user ID>"/g' /etc/grub.d/01_users
Once the superuser account has been added, update the `grub.cfg` file by running:
    grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
| Having a non-default grub superuser username makes password-guessing attacks less effective. For more information on how to configure the grub2 superuser account and password, please refer to https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/ch-working_with_the_grub_2_boot_loader#sec-Protecting_GRUB_2_with_a_Password .
BP28(R17) | Set Boot Loader Password in grub2 | The grub2 boot loader should have a superuser account and password protection enabled to protect boot-time settings. Since plaintext passwords are a security risk, generate a hash for the password by running the following command:
    # grub2-setpassword
When prompted, enter the password that was selected. | Password protection on the boot loader configuration ensures users with physical access cannot trivially alter important bootloader settings. These include which kernel to use, and whether to enter single-user mode.
BP28(R18) | Ensure PAM Enforces Password Requirements - Minimum Length | The pam_pwquality module's `minlen` parameter controls requirements for minimum characters required in a password. Add `minlen=`15`` after pam_pwquality to set minimum password length requirements. | The shorter the password, the lower the number of possible combinations that need to be tested before the password is compromised. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password length is one factor of several that helps to determine strength and how long it takes to crack a password. Use of more characters in a password helps to exponentially increase the time and/or resources required to compromose the password.
- BP28(R18) | Limit Password Reuse | Do not allow users to reuse recent passwords. This can be accomplished by using the `remember` option for the `pam_unix` or `pam_pwhistory` PAM modules. In the file `/etc/pam.d/system-auth`, append `remember=`5`` to the line which refers to the `pam_unix.so` or `pam_pwhistory.so`module, as shown below: for the `pam_unix.so` case:
      password sufficient pam_unix.so ...existing_options... remember=5
- for the `pam_pwhistory.so` case:
      password requisite pam_pwhistory.so ...existing_options... remember=5
The DoD STIG requirement is 5 passwords. | Preventing re-use of previous passwords helps ensure that a compromised password is not re-used by a user.
BP28(R18) | Configure the root Account for Failed Password Attempts | This rule configures the system to lock out the `root` account after a number of incorrect login attempts using `pam_faillock.so`. pam_faillock.so module requires multiple entries in pam files. These entries must be carefully defined to work as expected. In order to avoid any errors when manually editing these files, it is recommended to use the appropriate tools, such as `authselect` or `authconfig`, depending on the OS version. | By limiting the number of failed logon attempts, the risk of unauthorized system access via user password guessing, also known as brute-forcing, is reduced. Limits are imposed by locking the account.
- BP28(R18) | Set Interval For Counting Failed Password Attempts | Utilizing `pam_faillock.so`, the `fail_interval` directive configures the system to lock out an account after a number of incorrect login attempts within a specified time period. First make sure the feature is enabled using the following command:
      authconfig --enablefaillock --update
- Then modify the content of both `/etc/pam.d/system-auth` and `/etc/pam.d/password-auth` as follows: edit the fail_interval parameter in the following line `before` the `pam_unix.so` statement in the `auth` section, like this:
      auth required pam_faillock.so preauth silent deny=3 unlock_time=0 fail_interval=900
- edit the deny parameter in the following line `after` the `pam_unix.so` statement in the `auth` section, like this:
      auth required pam_faillock.so authfail deny=3 unlock_time=0 fail_interval=900
| By limiting the number of failed logon attempts the risk of unauthorized system access via user password guessing, otherwise known as brute-forcing, is reduced. Limits are imposed by locking the account.
BP28(R18) | Ensure PAM Enforces Password Requirements - Minimum Special Characters | The pam_pwquality module's `ocredit=` parameter controls requirements for usage of special (or "other") characters in a password. When set to a negative number, any password will be required to contain that many special characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each special character. Modify the `ocredit` setting in `/etc/security/pwquality.conf` to equal `-1` to require use of a special character in passwords. | Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possble combinations that need to be tested before the password is compromised. Requiring a minimum number of special characters makes password guessing attacks more difficult by ensuring a larger search space.
BP28(R18) | Lock Accounts After Failed Password Attempts | This rule configures the system to lock out accounts after a number of incorrect login attempts using `pam_faillock.so`. pam_faillock.so module requires multiple entries in pam files. These entries must be carefully defined to work as expected. In order to avoid any errors when manually editing these files, it is recommended to use the appropriate tools, such as `authselect` or `authconfig`, depending on the OS version. | Locking out user accounts after a number of incorrect attempts prevents direct password guessing attacks. In combination with the `silent` option, user enumeration attacks are also mitigated.
BP28(R18) | Set Password Maximum Age | To specify password maximum age for new accounts, edit the file `/etc/login.defs` and add or correct the following line:
    PASS_MAX_DAYS 60
A value of 180 days is sufficient for many environments. The DoD requirement is 60. The profile requirement is ``60``. | Any password, no matter how complex, can eventually be cracked. Therefore, passwords need to be changed periodically. If the operating system does not limit the lifetime of passwords and force users to change their passwords, there is the risk that the operating system passwords could be compromised. Setting the password maximum age ensures users are required to periodically change their passwords. Requiring shorter password lifetimes increases the risk of users writing down the password in a convenient location subject to physical compromise.
BP28(R18) | Set Lockout Time for Failed Password Attempts | This rule configures the system to lock out accounts during a specified time period after a number of incorrect login attempts using `pam_faillock.so`. pam_faillock.so module requires multiple entries in pam files. These entries must be carefully defined to work as expected. In order to avoid any errors when manually editing these files, it is recommended to use the appropriate tools, such as `authselect` or `authconfig`, depending on the OS version. | Locking out user accounts after a number of incorrect attempts prevents direct password guessing attacks. Ensuring that an administrator is involved in unlocking locked accounts draws appropriate attention to such situations.
BP28(R18) | Ensure PAM Enforces Password Requirements - Minimum Uppercase Characters | The pam_pwquality module's `ucredit=` parameter controls requirements for usage of uppercase letters in a password. When set to a negative number, any password will be required to contain that many uppercase characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each uppercase character. Modify the `ucredit` setting in `/etc/security/pwquality.conf` to require the use of an uppercase character in passwords. | Use of a complex password helps to increase the time and resources reuiqred to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised.
BP28(R18) | Ensure PAM Enforces Password Requirements - Minimum Lowercase Characters | The pam_pwquality module's `lcredit` parameter controls requirements for usage of lowercase letters in a password. When set to a negative number, any password will be required to contain that many lowercase characters. When set to a positive number, pam_pwquality will grant +1 additional length credit for each lowercase character. Modify the `lcredit` setting in `/etc/security/pwquality.conf` to require the use of a lowercase character in passwords. | Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possble combinations that need to be tested before the password is compromised. Requiring a minimum number of lowercase characters makes password guessing attacks more difficult by ensuring a larger search space.
BP28(R18) | Ensure PAM Enforces Password Requirements - Minimum Digit Characters | The pam_pwquality module's `dcredit` parameter controls requirements for usage of digits in a password. When set to a negative number, any password will be required to contain that many digits. When set to a positive number, pam_pwquality will grant +1 additional length credit for each digit. Modify the `dcredit` setting in `/etc/security/pwquality.conf` to require the use of a digit in passwords. | Use of a complex password helps to increase the time and resources required to compromise the password. Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks. Password complexity is one factor of several that determines how long it takes to crack a password. The more complex the password, the greater the number of possible combinations that need to be tested before the password is compromised. Requiring digits makes password guessing attacks more difficult by ensuring a larger search space.
BP28(R18) | Set Password Minimum Length in login.defs | To specify password length requirements for new accounts, edit the file `/etc/login.defs` and add or correct the following line:
    PASS_MIN_LEN 15
The DoD requirement is `15`. The FISMA requirement is `12`. The profile requirement is ``15``. If a program consults `/etc/login.defs` and also another PAM module (such as `pam_pwquality`) during a password change operation, then the most restrictive must be satisfied. See PAM section for more information about enforcing password quality requirements. | Requiring a minimum password length makes password cracking attacks more difficult by ensuring a larger search space. However, any security benefit from an onerous requirement must be carefully weighed against usability problems, support costs, or counterproductive behavior that may result.
BP28(R19) | Ensure auditd Collects Information on the Use of Privileged Commands - sudo | At a minimum, the audit system should collect the execution of privileged commands for all users and root. If the `auditd` daemon is configured to use the `augenrules` program to read audit rules during daemon startup (the default), add a line of the following form to a file with suffix `.rules` in the directory `/etc/audit/rules.d`:
    -a always,exit -F path=/usr/bin/sudo -F auid>=1000 -F auid!=unset -F key=privileged
If the `auditd` daemon is configured to use the `auditctl` utility to read audit rules during daemon startup, add a line of the following form to `/etc/audit/audit.rules`:
    -a always,exit -F path=/usr/bin/sudo -F auid>=1000 -F auid!=unset -F key=privileged
| Misuse of privileged functions, either intentionally or unintentionally by authorized users, or by unauthorized external entities that have compromised system accounts, is a serious and ongoing concern and can have significant adverse impacts on organizations. Auditing the use of privileged functions is one way to detect such misuse and identify the risk from insider and advanced persistent threats. Privileged programs are subject to escalation-of-privilege attacks, which attempt to subvert their normal role of providing some necessary but limited capability. As such, motivation exists to monitor these programs for unusual activity.
BP28(R19) | Direct root Logins Not Allowed | To further limit access to the `root` account, administrators can disable root logins at the console by editing the `/etc/securetty` file. This file lists all devices the root user is allowed to login to. If the file does not exist at all, the root user can login through any communication device on the system, whether via the console or via a raw network interface. This is dangerous as user can login to the system as root via Telnet, which sends the password in plain text over the network. By default, Red Hat Enterprise Linux 7's `/etc/securetty` file only allows the root user to login at the console physically attached to the system. To prevent root from logging in, remove the contents of this file. To prevent direct root logins, remove the contents of this file by typing the following command:
    $ sudo echo > /etc/securetty
| Disabling direct root logins ensures proper accountability and multifactor authentication to privileged accounts. Users will first login, then escalate to privileged (root) access via su / sudo. This is required for FISMA Low and FISMA Moderate systems.
BP28(R19) | Install sudo Package | The `sudo` package can be installed with the following command:
    $ sudo yum install sudo
| `sudo` is a program designed to allow a system administrator to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow system users to get their work done.
BP28(R19) NT007(R21) | Disable SSH Root Login | The root user should never be allowed to login to a system directly over a network. To disable root login via SSH, add or correct the following line in `/etc/ssh/sshd_config`:
    PermitRootLogin no
| Even though the communications channel may be encrypted, an additional layer of security is gained by extending the policy of not logging directly on as root. In addition, logging in with a user-specific account provides individual accountability of actions performed on the system and also helps to minimize direct attack attempts on root's password.
BP28(R22) | Disable Kernel Parameter for Accepting ICMP Redirects by Default on IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.default.accept_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.default.accept_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.default.accept_redirects = 0
| ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. This feature of the IPv4 protocol has few legitimate uses. It should be disabled unless absolutely required.
BP28(R22) | Configure Maximum Number of Autoconfigured Addresses on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.max_addresses` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.max_addresses=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.max_addresses = 1
| The number of global unicast IPv6 addresses for each interface should be limited exactly to the number of statically configured addresses.
BP28(R22) | Enable Kernel Parameter to Use TCP Syncookies on IPv4 Interfaces | To set the runtime status of the `net.ipv4.tcp_syncookies` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.tcp_syncookies=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.tcp_syncookies = 1
| A TCP SYN flood attack can cause a denial of service by filling a system's TCP connection table with connections in the SYN_RCVD state. Syncookies can be used to track a connection when a subsequent ACK is received, verifying the initiator is attempting a valid connection and is not a flood source. This feature is activated when a flood condition is detected, and enables the system to continue servicing valid connection requests.
BP28(R22) | Configure Accepting Router Preference in Router Advertisements on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.accept_ra_rtr_pref` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.accept_ra_rtr_pref=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.accept_ra_rtr_pref = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Configure Denying Router Solicitations on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.router_solicitations` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.router_solicitations=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.router_solicitations = 0
| To prevent discovery of the system by other systems, router solicitation requests should be denied.
BP28(R22) | Enable Kernel Parameter to Ignore Bogus ICMP Error Responses on IPv4 Interfaces | To set the runtime status of the `net.ipv4.icmp_ignore_bogus_error_responses` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.icmp_ignore_bogus_error_responses = 1
| Ignoring bogus ICMP error responses reduces log size, although some activity would not be logged.
BP28(R22) | Disable Kernel Parameter for Accepting Secure ICMP Redirects on all IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.secure_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.secure_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.secure_redirects = 0
| Accepting "secure" ICMP redirects (from those gateways listed as default gateways) has few legitimate uses. It should be disabled unless it is absolutely required.
BP28(R22) | Disable Accepting ICMP Redirects for All IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.accept_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.accept_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.accept_redirects = 0
| ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages modify the host's route table and are unauthenticated. An illicit ICMP redirect message could result in a man-in-the-middle attack. This feature of the IPv4 protocol has few legitimate uses. It should be disabled unless absolutely required."
BP28(R22) | Disable Kernel Parameter for Accepting Source-Routed Packets on IPv4 Interfaces by Default | To set the runtime status of the `net.ipv4.conf.default.accept_source_route` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.default.accept_source_route=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.default.accept_source_route = 0
| Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It should be disabled unless it is absolutely required, such as when IPv4 forwarding is enabled and the system is legitimately functioning as a router.
BP28(R22) | Disable Kernel Parameter for Accepting Source-Routed Packets on all IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.accept_source_route` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.accept_source_route=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.accept_source_route = 0
| Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routerd traffic, such as when IPv4 forwarding is enabled and the system is functioning as a router. Accepting source-routed packets in the IPv4 protocol has few legitimate uses. It should be disabled unless it is absolutely required.
BP28(R22) | Configure Accepting Default Router in Router Advertisements on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.accept_ra_defrtr` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.accept_ra_defrtr=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.accept_ra_defrtr = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Configure Auto Configuration on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.autoconf` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.autoconf=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.autoconf = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Configure Accepting Prefix Information in Router Advertisements on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.accept_ra_pinfo` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.accept_ra_pinfo=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.accept_ra_pinfo = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Enable Kernel Parameter to Log Martian Packets on all IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.log_martians` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.log_martians=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.log_martians = 1
| The presence of "martian" packets (which have impossible addresses) as well as spoofed packets, source-routed packets, and redirects could be a sign of nefarious network activity. Logging these packets enables this activity to be detected.
BP28(R22) | Disable Kernel Parameter for Accepting Source-Routed Packets on IPv6 Interfaces by Default | To set the runtime status of the `net.ipv6.conf.default.accept_source_route` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.accept_source_route=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.accept_source_route = 0
| Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routerd traffic, such as when IPv6 forwarding is enabled and the system is functioning as a router. Accepting source-routed packets in the IPv6 protocol has few legitimate uses. It should be disabled unless it is absolutely required.
BP28(R22) | Disable Accepting ICMP Redirects for All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.accept_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.accept_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.accept_redirects = 0
| An illicit ICMP redirect message could result in a man-in-the-middle attack.
BP28(R22) | Disable Kernel Parameter for Accepting ICMP Redirects by Default on IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.default.accept_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.accept_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.accept_redirects = 0
| An illicit ICMP redirect message could result in a man-in-the-middle attack.
BP28(R22) | Disable Kernel Parameter for IP Forwarding on IPv4 Interfaces | To set the runtime status of the `net.ipv4.ip_forward` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.ip_forward=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.ip_forward = 0
| Routing protocol daemons are typically used on routers to exchange network topology information with other routers. If this capability is used when not required, system network information may be unnecessarily transmitted across the network.
BP28(R22) | Configure Accepting Router Preference in Router Advertisements on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.accept_ra_rtr_pref` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.accept_ra_rtr_pref=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.accept_ra_rtr_pref = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Set Kernel Parameter to Increase Local Port Range | To set the runtime status of the `net.ipv4.ip_local_port_range` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.ip_local_port_range=32768 65535
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.ip_local_port_range = 32768 65535
| This setting defines the local port range that is used by TCP and UDP to choose the local port. The first number is the first, the second the last local port number.
BP28(R22) | Enable Kernel Parameter to Use Reverse Path Filtering on all IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.rp_filter` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.rp_filter=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.rp_filter = 1
| Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface they were received on. It should not be used on systems which are routers for complicated networks, but is helpful for end hosts and routers serving small networks.
BP28(R22) | Configure Maximum Number of Autoconfigured Addresses on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.max_addresses` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.max_addresses=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.max_addresses = 1
| The number of global unicast IPv6 addresses for each interface should be limited exactly to the number of statically configured addresses.
BP28(R22) | Configure Kernel Parameter for Accepting Secure Redirects By Default | To set the runtime status of the `net.ipv4.conf.default.secure_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.default.secure_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.default.secure_redirects = 0
| Accepting "secure" ICMP redirects (from those gateways listed as default gateways) has few legitimate uses. It should be disabled unless it is absolutely required.
BP28(R22) | Enable Kernel Parameter to Use TCP RFC 1337 on IPv4 Interfaces | To set the runtime status of the `net.ipv4.tcp_rfc1337` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.tcp_rfc1337=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.tcp_rfc1337 = 1
| Enable TCP behavior conformant with RFC 1337. When disabled, if a RST is received in TIME_WAIT state, we close the socket immediately without waiting for the end of the TIME_WAIT period.
BP28(R22) | Disable Kernel Parameter for Sending ICMP Redirects on all IPv4 Interfaces | To set the runtime status of the `net.ipv4.conf.all.send_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.all.send_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.all.send_redirects = 0
| ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table possibly revealing portions of the network topology. The ability to send ICMP redirects is only appropriate for systems acting as routers.
BP28(R22) | Configure Accepting Prefix Information in Router Advertisements on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.accept_ra_pinfo` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.accept_ra_pinfo=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.accept_ra_pinfo = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Configure Accepting Default Router in Router Advertisements on All IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.accept_ra_defrtr` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.accept_ra_defrtr=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.accept_ra_defrtr = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Enable Kernel Parameter to Use Reverse Path Filtering on all IPv4 Interfaces by Default | To set the runtime status of the `net.ipv4.conf.default.rp_filter` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.default.rp_filter=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.default.rp_filter = 1
| Enabling reverse path filtering drops packets with source addresses that should not have been able to be received on the interface they were received on. It should not be used on systems which are routers for complicated networks, but is helpful for end hosts and routers serving small networks.
BP28(R22) | Disable Kernel Parameter for Sending ICMP Redirects on all IPv4 Interfaces by Default | To set the runtime status of the `net.ipv4.conf.default.send_redirects` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv4.conf.default.send_redirects=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv4.conf.default.send_redirects = 0
| ICMP redirect messages are used by routers to inform hosts that a more direct route exists for a particular destination. These messages contain information from the system's route table possibly revealing portions of the network topology. The ability to send ICMP redirects is only appropriate for systems acting as routers.
BP28(R22) | Configure Auto Configuration on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.autoconf` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.autoconf=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.autoconf = 0
| An illicit router advertisement message could result in a man-in-the-middle attack.
BP28(R22) | Configure Denying Router Solicitations on All IPv6 Interfaces By Default | To set the runtime status of the `net.ipv6.conf.default.router_solicitations` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.default.router_solicitations=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.default.router_solicitations = 0
| To prevent discovery of the system by other systems, router solicitation requests should be denied.
BP28(R22) | Disable Kernel Parameter for Accepting Source-Routed Packets on all IPv6 Interfaces | To set the runtime status of the `net.ipv6.conf.all.accept_source_route` kernel parameter, run the following command:
    $ sudo sysctl -w net.ipv6.conf.all.accept_source_route=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    net.ipv6.conf.all.accept_source_route = 0
| Source-routed packets allow the source of the packet to suggest routers forward the packet along a different path than configured on the router, which can be used to bypass network security measures. This requirement applies only to the forwarding of source-routerd traffic, such as when IPv6 forwarding is enabled and the system is functioning as a router. Accepting source-routed packets in the IPv6 protocol has few legitimate uses. It should be disabled unless it is absolutely required.
BP28(R23) | Enable Kernel Parameter to Enforce DAC on Symlinks | To set the runtime status of the `fs.protected_symlinks` kernel parameter, run the following command:
    $ sudo sysctl -w fs.protected_symlinks=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    fs.protected_symlinks = 1
| By enabling this kernel parameter, symbolic links are permitted to be followed only when outside a sticky world-writable directory, or when the UID of the link and follower match, or when the directory owner matches the symlink's owner. Disallowing such symlinks helps mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of `open()` or `creat()`.
BP28(R23) | Disallow magic SysRq key | To set the runtime status of the `kernel.sysrq` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.sysrq=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.sysrq = 0
| The Magic SysRq key allows sending certain commands directly to the running kernel. It can dump various system and process information, potentially revealing sensitive information. It can also reboot or shutdown the machine, disturbing its availability.
BP28(R23) | Disable Core Dumps for SUID programs | To set the runtime status of the `fs.suid_dumpable` kernel parameter, run the following command:
    $ sudo sysctl -w fs.suid_dumpable=0
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    fs.suid_dumpable = 0
| The core dump of a setuid program is more likely to contain sensitive data, as the program itself runs with greater privileges than the user who initiated execution of the program. Disabling the ability for any setuid program to write a core file decreases the risk of unauthorized access of such data.
BP28(R23) | Limit CPU consumption of the Perf system | To set the runtime status of the `kernel.perf_cpu_time_max_percent` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.perf_cpu_time_max_percent=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.perf_cpu_time_max_percent = 1
| The `kernel.perf_cpu_time_max_percent` configures a treshold of maximum percentile of CPU that can be used by Perf system. Restricting usage of `Perf` system decreases risk of potential availability problems.
BP28(R23) | Configure maximum number of process identifiers | To set the runtime status of the `kernel.pid_max` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.pid_max=65536
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.pid_max = 65536
| The `kernel.pid_max` parameter configures upper limit on process identifiers (PID). If this number is not high enough, it might happen that forking of new processes is not possible, because all available PIDs are exhausted. Increasing this number enhances availability.
BP28(R23) | Enable Randomized Layout of Virtual Address Space | To set the runtime status of the `kernel.randomize_va_space` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.randomize_va_space=2
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.randomize_va_space = 2
| Address space layout randomization (ASLR) makes it more difficult for an attacker to predict the location of attack code they have introduced into a process's address space during an attempt at exploitation. Additionally, ASLR makes it more difficult for an attacker to know the location of existing code in order to re-purpose it using return oriented programming (ROP) techniques.
BP28(R23) | Prevent applications from mapping low portion of virtual memory | To set the runtime status of the `vm.mmap_min_addr` kernel parameter, run the following command:
    $ sudo sysctl -w vm.mmap_min_addr=65536
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    vm.mmap_min_addr = 65536
| The `vm.mmap_min_addr` parameter specifies the minimum virtual address that a process is allowed to mmap. Allowing a process to mmap low portion of virtual memory can have security implications such as such as heightened risk of kernel null pointer dereference defects.
BP28(R23) | Restrict Access to Kernel Message Buffer | To set the runtime status of the `kernel.dmesg_restrict` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.dmesg_restrict=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.dmesg_restrict = 1
| Unprivileged access to the kernel syslog can expose sensitive kernel address information.
BP28(R23) | Enable Kernel Parameter to Enforce DAC on Hardlinks | To set the runtime status of the `fs.protected_hardlinks` kernel parameter, run the following command:
    $ sudo sysctl -w fs.protected_hardlinks=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    fs.protected_hardlinks = 1
| By enabling this kernel parameter, users can no longer create soft or hard links to files which they do not own. Disallowing such hardlinks mitigate vulnerabilities based on insecure file system accessed by privileged programs, avoiding an exploitation vector exploiting unsafe use of `open()` or `creat()`.
BP28(R23) | Disallow kernel profiling by unprivileged users | To set the runtime status of the `kernel.perf_event_paranoid` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.perf_event_paranoid=2
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.perf_event_paranoid = 2
| Kernel profiling can reveal sensitive information about kernel behaviour.
BP28(R23) | Limit sampling frequency of the Perf system | To set the runtime status of the `kernel.perf_event_max_sample_rate` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.perf_event_max_sample_rate=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.perf_event_max_sample_rate = 1
| The `kernel.perf_event_max_sample_rate` parameter configures maximum frequency of collecting of samples for the Perf system. It is expressed in samples per second. Restricting usage of `Perf` system decreases risk of potential availability problems.
BP28(R23) | Restrict Exposed Kernel Pointer Addresses Access | To set the runtime status of the `kernel.kptr_restrict` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.kptr_restrict=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.kptr_restrict = 1
| Exposing kernel pointers (through procfs or `seq_printf()`) exposes kernel writeable structures that can contain functions pointers. If a write vulnereability occurs in the kernel allowing a write access to any of this structure, the kernel can be compromise. This option disallow any program withtout the CAP_SYSLOG capability from getting the kernel pointers addresses, replacing them with 0.
BP28(R24) | Disable loading and unloading of kernel modules | To set the runtime status of the `kernel.modules_disabled` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.modules_disabled=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.modules_disabled = 1
| Malicious kernel modules can have a significant impact on system security and availability. Disabling loading of kernel modules prevents this threat. Note that once this option has been set, it cannot be reverted without doing a system reboot. Make sure that all needed kernel modules are loaded before setting this option.
BP28(R25) | Restrict usage of ptrace to descendant processes | To set the runtime status of the `kernel.yama.ptrace_scope` kernel parameter, run the following command:
    $ sudo sysctl -w kernel.yama.ptrace_scope=1
To make sure that the setting is persistent, add the following line to a file in the directory `/etc/sysctl.d`:
    kernel.yama.ptrace_scope = 1
| Unrestricted usage of ptrace allows compromised binaries to run ptrace on another processes of the user. Like this, the attacker can steal sensitive information from the target processes (e.g. SSH sessions, web browser, ...) without any additional assistance from the user (i.e. without resorting to phishing).
BP28(R29) | Set Interactive Session Timeout | Setting the `TMOUT` option in `/etc/profile` ensures that all user sessions will terminate based on inactivity. The `TMOUT` setting in a file loaded by `/etc/profile`, e.g. `/etc/profile.d/tmout.sh` should read as follows:
    TMOUT=600
| Terminating an idle session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been left unattended.
BP28(R29) | Set SSH Idle Timeout Interval | SSH allows administrators to set an idle timeout interval. After this interval has passed, the idle user will be automatically logged out. To set an idle timeout interval, edit the following line in `/etc/ssh/sshd_config` as follows:
    ClientAliveInterval 300
The timeout interval is given in seconds. For example, have a timeout of 10 minutes, set interval to 600. If a shorter timeout has already been set for the login shell, that value will preempt any SSH setting made in `/etc/ssh/sshd_config`. Keep in mind that some processes may stop SSH from correctly detecting that the user is idle. | Terminating an idle ssh session within a short time period reduces the window of opportunity for unauthorized personnel to take control of a management session enabled on the console or console port that has been let unattended.
BP28(R29) | Set SSH Client Alive Count Max | The SSH server sends at most `ClientAliveCountMax` messages during a SSH session and waits for a response from the SSH client. The option `ClientAliveInterval` configures timeout after each `ClientAliveCountMax` message. If the SSH server does not receive a response from the client, then the connection is considered idle and terminated. For SSH earlier than v8.2, a `ClientAliveCountMax` value of `0` causes an idle timeout precisely when the `ClientAliveInterval` is set. Starting with v8.2, a value of `0` disables the timeout functionality completely. If the option is set to a number greater than `0`, then the idle session will be disconnected after `ClientAliveInterval * ClientAliveCountMax` seconds. | This ensures a user login will be terminated as soon as the `ClientAliveInterval` is reached.
BP28(R32) | Set PAM's Password Hashing Algorithm | The PAM system service can be configured to only store encrypted representations of passwords. In `/etc/pam.d/system-auth`, the `password` section of the file controls which PAM modules execute during a password change. Set the `pam_unix.so` module in the `password` section to include the argument `sha512`, as shown below:
    password    sufficient    pam_unix.so sha512 other arguments...
This will help ensure when local users change their passwords, hashes for the new passwords will be generated using the SHA-512 algorithm. This is the default. | Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kepy in plain text. This setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the `crypt_style` configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.
BP28(R32) | Set Password Hashing Algorithm in /etc/login.defs | In `/etc/login.defs`, add or correct the following line to ensure the system will use SHA-512 as the hashing algorithm:
    ENCRYPT_METHOD SHA512
| Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kept in plain text. Using a stronger hashing algorithm makes password cracking attacks more difficult.
BP28(R32) | Set number of Password Hashing Rounds - system-auth | Configure the number or rounds for the password hashing algorithm. This can be accomplished by using the `rounds` option for the `pam_unix` PAM module. In file `/etc/pam.d/system-auth` append `rounds=`5000`` to the `pam_unix.so` file, as shown below:
    password sufficient pam_unix.so ...existing_options... rounds=5000
The system's default number of rounds is 5000. | Using a higher number of rounds makes password cracking attacks more difficult.
BP28(R32) | Set number of Password Hashing Rounds - password-auth | Configure the number or rounds for the password hashing algorithm. This can be accomplished by using the `rounds` option for the `pam_unix` PAM module. In file `/etc/pam.d/password-auth` append `rounds=`5000`` to the `pam_unix.so` file, as shown below:
    password sufficient pam_unix.so ...existing_options... rounds=5000
The system's default number of rounds is 5000. | Using a higher number of rounds makes password cracking attacks more difficult.
BP28(R32) | Set PAM's Password Hashing Algorithm - password-auth | The PAM system service can be configured to only store encrypted representations of passwords. In `/etc/pam.d/password-auth`, the `password` section of the file controls which PAM modules execute during a password change. Set the `pam_unix.so` module in the `password` section to include the argument `sha512`, as shown below:
    password    sufficient    pam_unix.so sha512 other arguments...
This will help ensure when local users change their passwords, hashes for the new passwords will be generated using the SHA-512 algorithm. This is the default. | Passwords need to be protected at all times, and encryption is the standard method for protecting passwords. If passwords are not encrypted, they can be plainly read (i.e., clear text) and easily compromised. Passwords that are encrypted with a weak algorithm are no more protected than if they are kepy in plain text. This setting ensures user and group account administration utilities are configured to store only encrypted representations of passwords. Additionally, the `crypt_style` configuration option ensures the use of a strong hashing algorithm that makes password cracking attacks more difficult.
BP28(R35) | Ensure the Default Bash Umask is Set Correctly | To ensure the default umask for users of the Bash shell is set properly, add or correct the `umask` setting in `/etc/bashrc` to read as follows:
    umask 027
| The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.
BP28(R35) | Ensure the Default Umask is Set Correctly in login.defs | To ensure the default umask controlled by `/etc/login.defs` is set properly, add or correct the `UMASK` setting in `/etc/login.defs` to read as follows:
    UMASK 027
| The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read and written to by unauthorized users.
BP28(R35) | Ensure the Default Umask is Set Correctly in /etc/profile | To ensure the default umask controlled by `/etc/profile` is set properly, add or correct the `umask` setting in `/etc/profile` to read as follows:
    umask 027
| The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.
BP28(R36) | Verify User Who Owns shadow File | To properly set the owner of `/etc/shadow`, run the command:
    $ sudo chown root /etc/shadow
| The `/etc/shadow` file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information which could weaken the system security posture.
BP28(R36) | Ensure System Log Files Have Correct Permissions | The file permissions for all log files written by `rsyslog` should be set to 600, or more restrictive. These log files are determined by the second part of each Rule line in `/etc/rsyslog.conf` and typically all appear in `/var/log`. For each log file LOGFILE referenced in `/etc/rsyslog.conf`, run the following command to inspect the file's permissions:
    $ ls -l LOGFILE
If the permissions are not 600 or more restrictive, run the following command to correct this:
    $ sudo chmod 0600 LOGFILE
" | Log files can contain valuable information regarding system configuration. If the system log files are not protected unauthorized users could change the logged data, eliminating their forensic value.
BP28(R36) | Verify Permissions on passwd File | To properly set the permissions of `/etc/passwd`, run the command:
    $ sudo chmod 0644 /etc/passwd
| If the `/etc/passwd` file is writable by a group-owner or the world the risk of its compromise is increased. The file contains the list of accounts on the system and associated information, and protection of this file is critical for system security.
BP28(R36) | Verify Permissions on SSH Server Private *_key Key Files | To properly set the permissions of `/etc/ssh/*_key`, run the command:
    $ sudo chmod 0600 /etc/ssh/*_key
| If an unauthorized user obtains the private SSH host key file, the host could be impersonated.
BP28(R36) | Verify Permissions on gshadow File | To properly set the permissions of `/etc/gshadow`, run the command:
    $ sudo chmod 0000 /etc/gshadow
| The `/etc/gshadow` file contains group password hashes. Protection of this file is critical for system security.
BP28(R36) | Verify User Who Owns gshadow File | To properly set the owner of `/etc/gshadow`, run the command:
    $ sudo chown root /etc/gshadow
| The `/etc/gshadow` file contains group password hashes. Protection of this file is critical for system security.
BP28(R36) | Verify Permissions on shadow File | To properly set the permissions of `/etc/shadow`, run the command:
    $ sudo chmod 0000 /etc/shadow
| The `/etc/shadow` file contains the list of local system accounts and stores password hashes. Protection of this file is critical for system security. Failure to give ownership of this file to root provides the designated owner with access to sensitive information which could weaken the system security posture.
BP28(R36) | Verify Permissions on group File | To properly set the permissions of `/etc/passwd`, run the command:
    $ sudo chmod 0644 /etc/passwd
| The `/etc/group` file contains information regarding groups that are configured on the system. Protection of this file is important for system security.
BP28(R37) BP28(R38) | Ensure All SUID Executables Are Authorized | The SUID (set user id) bit should be set only on files that were installed via authorized means. A straightforward means of identifying unauthorized SUID files is determine if any were not installed as part of an RPM package, which is cryptographically verified. Investigate the origin of any unpackaged SUID files. This configuration check considers authorized SUID files which were installed via RPM. It is assumed that when an individual has sudo access to install an RPM and all packages are signed with an organizationally-recognized GPG key, the software should be considered an approved package on the system. Any SUID file not deployed through an RPM will be flagged for further review. | Executable files with the SUID permission run with the privileges of the owner of the file. SUID files of uncertain provenance could allow for unprivileged users to elevate privileges. The presence of these files should be strictly controlled on the system.
BP28(R37) BP28(R38) | Ensure All SGID Executables Are Authorized | The SGID (set group id) bit should be set only on files that were installed via authorized means. A straightforward means of identifying unauthorized SGID files is determine if any were not installed as part of an RPM package, which is cryptographically verified. Investigate the origin of any unpackaged SGID files. This configuration check considers authorized SGID files which were installed via RPM. It is assumed that when an individual has sudo access to install an RPM and all packages are signed with an organizationally-recognized GPG key, the software should be considered an approved package on the system. Any SGID file not deployed through an RPM will be flagged for further review. | Executable files with the SGID permission run with the privileges of the owner of the file. SGID files of uncertain provenance could allow for unprivileged users to elevate privileges. The presence of these files should be strictly controlled on the system.
BP28(R39) | Configure Polyinstantiation of /var/tmp Directories | To configure polyinstantiated /tmp directories, first create the parent directories which will hold the polyinstantiation child directories. Use the following command:
    $ sudo mkdir --mode 000 /var/tmp/tmp-inst
Then, add the following entry to `/etc/security/namespace.conf`:
    /var/tmp /var/tmp/tmp-inst/    level      root,adm
| Polyinstantiation of temporary directories is a proactive security measure which reduces chances of attacks that are made possible by /var/tmp directories being world-writable.
BP28(R39) | Set Up a Private Namespace in PAM Configuration | To setup a private namespace add the following line to `/etc/pam.d/login`:
    session    required     pam_namespace.so
| The pam_namespace PAM module sets up a private namespace for a session with polyinstantiated directories. A polyinstantiated directory provides a different instance of itself based on user name, or when using SELinux, user name, security context or both. The polyinstatied directories can be used to dedicate separate temporary directories to each account.
BP28(R39) | Disable the polyinstantiation_enabled SELinux Boolean | By default, the SELinux boolean `polyinstantiation_enabled` is disabled. If this setting is enabled, it should be disabled. To disable the `polyinstantiation_enabled` SELinux boolean, run the following command:
    $ sudo setsebool -P polyinstantiation_enabled off
BP28(R39) | Configure Polyinstantiation of /tmp Directories | To configure polyinstantiated /tmp directories, first create the parent directories which will hold the polyinstantiation child directories. Use the following command:
    $ sudo mkdir --mode 000 /tmp/tmp-inst
Then, add the following entry to `/etc/security/namespace.conf`:
    /tmp     /tmp/tmp-inst/            level      root,adm
| Polyinstantiation of temporary directories is a proactive security measure which reduces chances of attacks that are made possible by /tmp directories being world-writable.
BP28(R40) | Ensure All World-Writable Directories Are Owned by root user | All directories in local partitions which are world-writable should be owned by root. If any world-writable directories are not owned by root, this should be investigated. Following this, the files should be deleted or assigned to root user. | Allowing a user account to own a world-writable directory is undesirable because it allows the owner of that directory to remove or replace any files that may be placed in the directory by other users.
BP28(R40) | Verify that All World-Writable Directories Have Sticky Bits Set | When the so-called 'sticky bit' is set on a directory, only the owner of a given file may remove that file from the directory. Without the sticky bit, any user with write access to a directory may remove any file in the directory. Setting the sticky bit prevents users from removing each other's files. In cases where there is no reason for a directory to be world-writable, a better solution is to remove that permission rather than to set the sticky bit. However, if a directory is used by a particular application, consult that application's documentation instead of blindly changing modes. To set the sticky bit on a world-writable directory DIR, run the following command:
    $ sudo chmod +t DIR
| Failing to set the sticky bit on public directories allows unauthorized users to delete files in the directory structure. The only authorized public directories are those temporary directories supplied with the system, or those designed to be temporary file repositories. The setting is normally reserved for directories used by the system, by users for temporary file storage (such as `/tmp`), and for directories requiring global read/write access.
BP28(R40) | Ensure No World-Writable Files Exist | It is generally a good idea to remove global (other) write access to a file when it is discovered. However, check with documentation for specific applications before making changes. Also, monitor for recurring world-writable files, as these may be symptoms of a misconfigured application or user account. Finally, this applies to real files and not virtual files that are a part of pseudo file systems such as `sysfs` or `procfs`. | Data in world-writable files can be modified by any user on the system. In almost all circumstances, files can be configured using a combination of user and group permissions to support whatever legitimate access is needed without the risk caused by world-writable files.
BP28(R43) | Ensure rsyslog-gnutls is installed | TLS protocol support for rsyslog is installed. The `rsyslog-gnutls` package can be installed with the following command:
    $ sudo yum install rsyslog-gnutls
| The rsyslog-gnutls package provides Transport Layer Security (TLS) support for the rsyslog daemon, which enables secure remote logging.
BP28(R43) NT12(R18) | Ensure Logrotate Runs Periodically | The `logrotate` utility allows for the automatic rotation of log files. The frequency of rotation is specified in `/etc/logrotate.conf`, which triggers a cron task. To configure logrotate to run daily, add or correct the following line in `/etc/logrotate.conf`:
    # rotate log files frequency
    daily
| Log files that are not properly rotated run the risk of growing so large that they fill up the /var/log partition. Valuable logging information could be lost if the /var/log partition becomes full.
BP28(R43) | Configure CA certificate for rsyslog remote logging | Configure CA certificate for `rsyslog` logging to remote server using Transport Layer Security (TLS) using correct path for the `DefaultNetstreamDriverCAFile` global option in `/etc/rsyslog.conf`, for example with the following command:
    echo 'global(DefaultNetstreamDriverCAFile="/etc/pki/tls/cert.pem")' >> /etc/rsyslog.conf
Replace the `/etc/pki/tls/cert.pem` in the above command with the path to the file with CA certificate generated for the purpose of remote logging. | The CA certificate needs to be set or `rsyslog.service` fails to start with
    error: ca certificate is not set, cannot continue
BP28(R43) | Configure TLS for rsyslog remote logging | Configure `rsyslog` to use Transport Layer Security (TLS) support for logging to remote server for the Forwarding Output Module in `/etc/rsyslog.conf` using action. You can use the following command:
    echo 'action(type="omfwd" protocol="tcp" Target="<remote system>" port="6514"
        StreamDriver="gtls" StreamDriverMode="1" StreamDriverAuthMode="x509/name" streamdriver.CheckExtendedKeyPurpose="on")' >> /etc/rsyslog.conf
Replace the `<remote system>` in the above command with an IP address or a host name of the remote logging server. | For protection of data being logged, the connection to the remote logging server needs to be authenticated and encrypted.
BP28(R43) | A remote time server for Chrony is configured | `Chrony` 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 `chrony` can be found at http://chrony.tuxfamily.org/. `Chrony` can be configured to be a client and/or a server. Add or edit server or pool lines to `/etc/chrony.conf` as appropriate:
    server <remote-server>
Multiple servers may be configured. | If `chrony` is in use on the system proper configuration is vital to ensuring time synchronization is working properly.
BP28(R43) | The Chrony package is installed | 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. The `chrony` package can be installed with the following command:
    $ sudo yum install chrony
| 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.
BP28(R43) | Ensure /var/log/audit Located On Separate Partition | Audit logs are stored in the `/var/log/audit` directory. Ensure that `/var/log/audit` has its own partition or logical volume at installation time, or migrate it using LVM. Make absolutely certain that it is large enough to store all audit logs that will be created by the auditing daemon. | Placing `/var/log/audit` in its own partition enables better separation between audit files and other files, and helps ensure that auditing cannot be halted due to the partition running out of space.
BP28(R46) BP28(R5) | Enable syslog-ng Service | The `syslog-ng` service (in replacement of rsyslog) provides syslog-style logging by default on Debian. The `syslog-ng` service can be enabled with the following command:
    $ sudo systemctl enable syslog-ng.service
| The `syslog-ng` service must be running in order to provide logging services, which are essential to system administration.
BP28(R46) BP28(R5) | Ensure Log Files Are Owned By Appropriate User | The owner of all log files written by `rsyslog` should be ``root``. These log files are determined by the second part of each Rule line in `/etc/rsyslog.conf` and typically all appear in `/var/log`. For each log file LOGFILE referenced in `/etc/rsyslog.conf`, run the following command to inspect the file's owner:
    $ ls -l LOGFILE
If the owner is not ``root``, run the following command to correct this:
    $ sudo chown root LOGFILE
| The log files generated by rsyslog contain valuable information regarding system configuration, user authentication, and other such information. Log files should be protected from unauthorized access.
BP28(R46) BP28(R5) | Ensure Log Files Are Owned By Appropriate Group | The group-owner of all log files written by `rsyslog` should be ``root``. These log files are determined by the second part of each Rule line in `/etc/rsyslog.conf` and typically all appear in `/var/log`. For each log file LOGFILE referenced in `/etc/rsyslog.conf`, run the following command to inspect the file's group owner:
    $ ls -l LOGFILE
If the owner is not ``root``, run the following command to correct this:
    $ sudo chgrp root LOGFILE
| The log files generated by rsyslog contain valuable information regarding system configuration, user authentication, and other such information. Log files should be protected from unauthorized access.
BP28(R46) BP28(R5) | Ensure syslog-ng is Installed | syslog-ng can be installed in replacement of rsyslog. The `syslog-ng-core` package can be installed with the following command:
    $ sudo yum install syslog-ng-core
| The syslog-ng-core package provides the syslog-ng daemon, which provides system logging services.
BP28(R48) | Disable Postfix Network Listening | Edit the file `/etc/postfix/main.cf` to ensure that only the following `inet_interfaces` line appears:
    inet_interfaces = loopback-only
| This ensures `postfix` accepts mail messages (such as cron job reports) from the local system only, and not from the network, which protects it from network attack.
BP28(R49) | Configure System to Forward All Mail For The Root Account | Make sure that mails delivered to root user are forwarded to a monitored email address. Make sure that the address `system.administrator@mail.mil` is a valid email address reachable from the system in question. Use the following command to configure the alias:
    $ sudo echo "root: system.administrator@mail.mil" >> /etc/aliases
    $ sudo newaliases
| A number of system services utilize email messages sent to the root user to notify system administrators of active or impending issues. These messages must be forwarded to at least one monitored email address.
BP28(R50) | Install the cron service | The Cron service should be installed. | The cron service allow periodic job execution, needed for almost all administrative tasks and services (software update, log rotating, etc.). Access to cron service should be restricted to administrative accounts only.
BP28(R50) | Ensure the audit Subsystem is Installed | The audit package should be installed. | The auditd service is an access monitoring and accounting daemon, watching system calls to audit any access, in comparison with potential local access control policy such as SELinux policy.
BP28(R51) | Build and Test AIDE Database | Run the following command to generate a new database:
    $ sudo /usr/sbin/aide --init
By default, the database will be written to the file `/var/lib/aide/aide.db.new.gz`. Storing the database, the configuration file `/etc/aide.conf`, and the binary `/usr/sbin/aide` (or hashes of these files), in a secure location (such as on read-only media) provides additional assurance about their integrity. The newly-generated database can be installed as follows:
    $ sudo cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz
To initiate a manual check, run the following command:
    $ sudo /usr/sbin/aide --check
If this check produces any unexpected output, investigate. | For AIDE to be effective, an initial database of "known-good" information about files must be captured and it should be able to be verified against the installed files.
BP28(R51) | Configure Periodic Execution of AIDE | At a minimum, AIDE should be configured to run a weekly scan. To implement a daily execution of AIDE at 4:05am using cron, add the following line to `/etc/crontab`:
    05 4 * * * root  --check
To implement a weekly execution of AIDE at 4:05am using cron, add the following line to `/etc/crontab`:
    05 4 * * 0 root  --check
AIDE can be executed periodically through other means; this is merely one example. The usage of cron's special time codes, such as `@daily` and `@weekly` is acceptable. | By default, AIDE does not install itself for periodic execution. Periodically running AIDE is necessary to reveal unexpected changes in installed files. Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. Detecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's Information Management Officer (IMO)/Information System Security Officer (ISSO) and System Administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.
BP28(R51) | Configure Notification of Post-AIDE Scan Details | AIDE should notify appropriate personnel of the details of a scan after the scan has been run. If AIDE has already been configured for periodic execution in `/etc/crontab`, append the following line to the existing AIDE line:
     | /bin/mail -s "$(hostname) - AIDE Integrity Check" root@localhost
Otherwise, add the following line to `/etc/crontab`:
    05 4 * * * root /usr/sbin/aide --check | /bin/mail -s "$(hostname) - AIDE Integrity Check" root@localhost
AIDE can be executed periodically through other means; this is merely one example. | Unauthorized changes to the baseline configuration could make the system vulnerable to various attacks or allow unauthorized access to the operating system. Changes to operating system configurations can have unintended side effects, some of which may be relevant to security. Detecting such changes and providing an automated response can help avoid unintended, negative consequences that could ultimately affect the security state of the operating system. The operating system's Information Management Officer (IMO)/Information System Security Officer (ISSO) and System Administrators (SAs) must be notified via email and/or monitoring system trap when there is an unauthorized modification of a configuration item.
BP28(R51) | Configure AIDE to Verify Extended Attributes | By default, the `xattrs` option is added to the `FIPSR` ruleset in AIDE. If using a custom ruleset or the `xattrs` option is missing, add `xattrs` to the appropriate ruleset. For example, add `xattrs` to the following line in `/etc/aide.conf`:
    FIPSR = p+i+n+u+g+s+m+c+acl+selinux+xattrs+sha256
AIDE rules can be configured in multiple ways; this is merely one example that is already configured by default. The remediation provided with this rule adds `xattrs` to all rule sets available in `/etc/aide.conf` | Extended attributes in file systems are used to contain arbitrary data and file metadata with security implications.
BP28(R51) | Configure AIDE to Verify Access Control Lists (ACLs) | By default, the `acl` option is added to the `FIPSR` ruleset in AIDE. If using a custom ruleset or the `acl` option is missing, add `acl` to the appropriate ruleset. For example, add `acl` to the following line in `/etc/aide.conf`:
    FIPSR = p+i+n+u+g+s+m+c+acl+selinux+xattrs+sha256
AIDE rules can be configured in multiple ways; this is merely one example that is already configured by default. The remediation provided with this rule adds `acl` to all rule sets available in `/etc/aide.conf` | ACLs can provide permissions beyond those permitted through the file mode and must be verified by the file integrity tools.
BP28(R51) | Install AIDE | The `aide` package can be installed with the following command:
    $ sudo yum install aide
| The AIDE package must be installed if it is to be available for integrity checking.
BP28(R57) | Ensure a dedicated group owns sudo | Restrict the execution of privilege escalated commands to a dedicated group of users. Ensure the group owner of /usr/bin/sudo is `root`. | Restricting the set of users able to execute commands as privileged user reduces the attack surface.
BP28(R57) | Ensure only owner and members of group owner of /usr/bin/sudo can execute it | Remove the execute permission bit of `/etc/bin/sudo` for the other users. To properly set the permissions of `/usr/bin/sudo`, run the command:
    $ sudo chmod 4110 /usr/bin/sudo
| Restricting the set of users able to execute commands as privileged user reduces the attack surface.
BP28(R58) | Ensure sudo passwd_timeout is appropriate - sudo passwd_timeout | The sudo `passwd_timeout` tag sets the amount of time sudo password prompt waits. On Red Hat Enterprise Linux 7, the default `passwd_timeout` value is 5 minutes. The passwd_timeout should be configured by making sure that the `passwd_timeout=sub_var_value("var_sudo_passwd_timeout")` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Reducing the time `sudo` waits for a a password reduces the time the process is exposed.
BP28(R58) | Ensure Only Users Logged In To Real tty Can Execute Sudo - sudo requiretty | The sudo `requiretty` tag, when specified, will only execute sudo commands from users logged in to a real tty. This should be enabled by making sure that the `requiretty` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Restricting the use cases in which a user is allowed to execute sudo commands reduces the attack surface.
BP28(R58) | Ensure sudo Ignores Commands In Current Dir - sudo ignore_dot | The sudo `ignore_dot` tag, when specified, will ignore the current directory in the PATH environment variable. On Red Hat Enterprise Linux 7, `env_reset` is enabled by default This should be enabled by making sure that the `ignore_dot` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Ignoring the commands in the user's current directory prevents an attacker from executing commands downloaded locally.
BP28(R58) | Ensure sudo Runs In A Minimal Environment - sudo env_reset | The sudo `env_reset` tag, when specified, will run the command in a minimal environment, containing the TERM, PATH, HOME, MAIL, SHELL, LOGNAME, USER and SUDO_* variables. On Red Hat Enterprise Linux 7, `env_reset` is enabled by default This should be enabled by making sure that the `env_reset` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Forcing sudo to reset the environment ensures that environment variables are not passed on to the command accidentaly, preventing leak of potentially sensitive information.
BP28(R58) | Ensure sudo umask is appropriate - sudo umask | The sudo `umask` tag, when specified, will be added the to the user's umask in the command environment. On Red Hat Enterprise Linux 7, the default `umask` value is 0022. The umask should be configured by making sure that the `umask=sub_var_value("var_sudo_umask")` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | The umask value influences the permissions assigned to files when they are created. A misconfigured umask value could result in files with excessive permissions that can be read or written to by unauthorized users.
BP28(R58) | Ensure Privileged Escalated Commands Cannot Execute Other Commands - sudo NOEXEC | The sudo `NOEXEC` tag, when specified, prevents user executed commands from executing other commands, like a shell for example. This should be enabled by making sure that the `NOEXEC` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Restricting the capability of sudo allowed commands to execute sub-commands prevents users from running programs with privileges they wouldn't have otherwise.
BP28(R58) | Ensure Only Users Logged In To Real tty Can Execute Sudo - sudo use_pty | The sudo `use_pty` tag, when specified, will only execute sudo commands from users logged in to a real tty. This should be enabled by making sure that the `use_pty` tag exists in `/etc/sudoers` configuration file or any sudo configuration snippets in `/etc/sudoers.d/`. | Requiring that sudo commands be run in a pseudo-terminal can prevent an attacker from retaining access to the user's terminal after the main program has finished executing.
BP28(R60) | Don't target root user in the sudoers file | The targeted users of a user specification should be, as much as possible, non privileged users (i.e.: non-root). User specifications have to explicitly list the runas spec (i.e. the list of target users that can be impersonated), and `ALL` or `root` should not be used. | It is common that the command to be executed does not require superuser rights (editing a file whose the owner is not root, sending a signal to an unprivileged process,etc.). In order to limit any attempt of privilege escalation through a command, it is better to apply normal user rights.
BP28(R61) | Don't define allowed commands in sudoers by means of exclusion | Policies applied by sudo through the sudoers file should not involve negation. Each user specification in the `sudoers` file contains a comma-delimited list of command specifications. The definition can make use glob patterns, as well as of negations. Indirect definition of those commands by means of exclusion of a set of commands is trivial to bypass, so it is not allowed to use such constructs. | Specifying access right using negation is inefficient and can be easily circumvented. For example, it is expected that a specification like
    # To avoid absolutely , this rule can be easily circumvented!
    user ALL = ALL ,!/ bin/sh
prevents the execution of the shell but that’s not the case: just copy the binary `/bin/sh` to a different name to make it executable again through the rule keyword `ALL`.
BP28(R63) | Explicit arguments in sudo specifications | All commands in the sudoers file must strictly specify the arguments allowed to be used for a given user. If the command is supposed to be executed only without arguments, pass "" as an argument in the corresponding user specification. | Any argument can modify quite significantly the behavior of a program, whether regarding the realized operation (read, write, delete, etc.) or accessed resources (path in a file system tree). To avoid any possibility of misuse of a command by a user, the ambiguities must be removed at the level of its specification. For example, on some systems, the kernel messages are only accessible by root. If a user nevertheless must have the privileges to read them, the argument of the dmesg command has to be restricted in order to prevent the user from flushing the buffer through the -c option:
    user ALL = dmesg ""
BP28(R66) | Configure SELinux Policy | The SELinux `targeted` policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in `/etc/selinux/config`:
    SELINUXTYPE=targeted
Other policies, such as `mls`, provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases. | Setting the SELinux policy to `targeted` or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services. Note: During the development or debugging of SELinux modules, it is common to temporarily place non-production systems in `permissive` mode. In such temporary cases, SELinux policies should be developed, and once work is completed, the system should be reconfigured to ``.
BP28(R67) | Enable the deny_execmem SELinux Boolean | By default, the SELinux boolean `deny_execmem` is disabled. If this setting is disabled, it should be enabled. To disable the `deny_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P deny_execmem off
| Allowing user domain applications to map a memory region as both writable and executable makes them more susceptible to data execution attacks.
BP28(R67) | Disable the secure_mode_insmod SELinux Boolean | By default, the SELinux boolean `secure_mode_insmod` is disabled. If this setting is enabled, it should be disabled. To disable the `secure_mode_insmod` SELinux boolean, run the following command:
    $ sudo setsebool -P secure_mode_insmod off
BP28(R67) | Disable the glance_use_execmem SELinux Boolean | By default, the SELinux boolean `glance_use_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `glance_use_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P glance_use_execmem off
BP28(R67) | Disable the httpd_execmem SELinux Boolean | By default, the SELinux boolean `httpd_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `httpd_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P httpd_execmem off
BP28(R67) | Disable the cups_execmem SELinux Boolean | By default, the SELinux boolean `cups_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `cups_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P cups_execmem off
BP28(R67) | Disable the boinc_execmem SELinux Boolean | By default, the SELinux boolean `boinc_execmem` is enabled. This setting should be disabled. To disable the `boinc_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P boinc_execmem off
BP28(R67) | Disable the ssh_sysadm_login SELinux Boolean | By default, the SELinux boolean `ssh_sysadm_login` is disabled. If this setting is enabled, it should be disabled. To disable the `ssh_sysadm_login` SELinux boolean, run the following command:
    $ sudo setsebool -P ssh_sysadm_login off
| Preventing non-privileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges. Privileged functions include, for example, establishing accounts, performing system integrity checks, or administering cryptographic key management activities. Non-privileged users are individuals who do not possess appropriate authorizations. Circumventing intrusion detection and prevention mechanisms or malicious code protection mechanisms are examples of privileged functions that require protection from non-privileged users.
BP28(R67) | Disable the cluster_use_execmem SELinux Boolean | By default, the SELinux boolean `cluster_use_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `cluster_use_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P cluster_use_execmem off
BP28(R67) | Disable the xserver_execmem SELinux Boolean | By default, the SELinux boolean `xserver_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `xserver_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P xserver_execmem off
BP28(R67) | Disable the selinuxuser_execheap SELinux Boolean | By default, the SELinux boolean `selinuxuser_execheap` is disabled. When enabled this boolean is enabled it allows selinuxusers to execute code from the heap. If this setting is enabled, it should be disabled. To disable the `selinuxuser_execheap` SELinux boolean, run the following command:
    $ sudo setsebool -P selinuxuser_execheap off
| Disabling code execution from the heap blocks buffer overflow attacks.
BP28(R67) | Disable the virt_use_execmem SELinux Boolean | By default, the SELinux boolean `virt_use_execmem` is disabled. If this setting is enabled, it should be disabled. To disable the `virt_use_execmem` SELinux boolean, run the following command:
    $ sudo setsebool -P virt_use_execmem off
BP28(R67) | disable the selinuxuser_execstack SELinux Boolean | By default, the SELinux boolean `selinuxuser_execstack` is enabled. This setting should be disabled as unconfined executables should not be able to make their stack executable. To disable the `selinuxuser_execstack` SELinux boolean, run the following command:
    $ sudo setsebool -P selinuxuser_execstack off
| Disabling code execution from the stack blocks buffer overflow attacks.
BP28(R68) | Uninstall setroubleshoot Package | The SETroubleshoot service notifies desktop users of SELinux denials. The service provides information around configuration errors, unauthorized intrusions, and other potential errors. The `setroubleshoot` package can be removed with the following command:
    $ sudo yum erase setroubleshoot
| The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is removed or disabled.
BP28(R68) | Uninstall setroubleshoot-plugins Package | The SETroubleshoot plugins are used to analyze SELinux AVC data. The service provides information around configuration errors, unauthorized intrusions, and other potential errors. The `setroubleshoot-plugins` package can be removed with the following command:
    $ sudo yum erase setroubleshoot-plugins
| The SETroubleshoot service is an unnecessary daemon to have running on a server.
BP28(R68) | Uninstall setroubleshoot-server Package | The SETroubleshoot service notifies desktop users of SELinux denials. The service provides information around configuration errors, unauthorized intrusions, and other potential errors. The `setroubleshoot-server` package can be removed with the following command:
    $ sudo yum erase setroubleshoot-server
| The SETroubleshoot service is an unnecessary daemon to have running on a server.
NT012(R03) | Install the ntp service | The ntpd service should be installed. | Time synchronization (using NTP) is required by almost all network and administrative tasks (syslog, cryptographic based services (authentication, etc.), etc.). Ntpd is regulary maintained and updated, supporting security features such as RFC 5906.
NT007(R02) | Uninstall the ssl compliant telnet server | The `telnet` daemon, even with ssl support, should be uninstalled. | `telnet`, even with ssl support, should not be installed. When remote shell is required, up-to-date ssh daemon can be used.
NT012(R03) | Enable the NTP Daemon | The `ntpd` service can be enabled with the following command:
    $ sudo systemctl enable ntpd.service
| Enabling the `ntpd` service ensures that the `ntpd` service will be running and that the system will synchronize its time to any servers specified. This is important whether the system is configured to be a client (and synchronize only its own clock) or it is also acting as an NTP server to other systems. Synchronizing time is essential for authentication services such as Kerberos, but it is also important for maintaining accurate logs and auditing possible security breaches. The NTP daemon offers all of the functionality of `ntpdate`, which is now deprecated.
NT007(R17) | Disable SSH Access via Empty Passwords | Disallow SSH login with empty passwords. The default SSH configuration disables logins with empty passwords. The appropriate configuration is used if no value is set for `PermitEmptyPasswords`. To explicitly disallow SSH login from accounts with empty passwords, add or correct the following line in `/etc/ssh/sshd_config`:
    PermitEmptyPasswords no
Any accounts with empty passwords should be disabled immediately, and PAM configuration should prevent users from being able to assign themselves empty passwords. | Configuring this setting for the SSH daemon provides additional assurance that remote login via SSH will require a password, even in the event of misconfiguration elsewhere.
NT007(R1) | Allow Only SSH Protocol 2 | Only SSH protocol version 2 connections should be permitted. The default setting in `/etc/ssh/sshd_config` is correct, and can be verified by ensuring that the following line appears:
    Protocol 2
| SSH protocol version 1 is an insecure implementation of the SSH protocol and has many well-known vulnerability exploits. Exploits of the SSH daemon could provide immediate root access to the system.
NT007(R03) | Uninstall the inet-based telnet server | The inet-based telnet daemon should be uninstalled. | `telnet` allows clear text communications, and does not protect any data transmission between client and server. Any confidential data can be listened and no integrity checking is made.