collection1asset0 python 2.6.6 5.10 2011-09-21T13:44:00 All Password Hashes Shadowed Fedora 19 All password hashes should be shadowed. Restrict Virtual Console Root Logins Fedora 19 Preventing direct root login to virtual console devices helps ensure accountability for actions taken on the system using the root account. No nullok Option in /etc/pam.d/system-auth Fedora 19 The file /etc/pam.d/system-auth should not contain the nullok option Set Password Expiration Parameters Fedora 19 The maximum password age policy should meet minimum requirements. Disable root Login via SSH Fedora 19 Root login via SSH should be disabled (and dependencies are met) UID 0 Belongs Only To Root Fedora 19 Only the root account should be assigned a user id of 0. Set OpenSSH Idle Timeout Interval Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Fedora 20 The SSH idle timeout interval should be set to an appropriate value. System Accounts Do Not Run a Shell Fedora 19 The root account is the only system account that should have a login shell. Verify that Shared Library Files Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are owned by root. Fedora release 19 (Schrödinger's Cat) Fedora 19 The operating system installed on the system is Fedora release 19 (Schrödinger's Cat) Service sshd Disabled Fedora 19 The sshd service should be disabled. Service ntpd Enabled Fedora 19 The ntpd service should be enabled. Package ntp Installed Fedora 19 The RPM package ntp should be installed. Set Password Expiration Parameters Fedora 19 The password minimum length should be set appropriately. Set ClientAliveCountMax for User Logins Fedora 19 The SSH ClientAliveCountMax should be set to an appropriate value (and dependencies are met) Verify that Shared Library Files Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are not group-writable or world-writable. Ensure Yum gpgcheck Globally Activated Fedora 19 The gpgcheck option should be used to ensure that checking of an RPM package's signature always occurs prior to its installation. Specify a Remote NTP Server for Time Data Fedora 19 A remote NTP Server for time synchronization should be specified Restrict Serial Port Root Logins Fedora 19 Preventing direct root login to serial port interfaces helps ensure accountability for actions taken on the system using the root account. Disable Empty Passwords Fedora 19 Remote connections from accounts with empty passwords should be disabled (and dependencies are met) Ensure gpgcheck Enabled For All Yum Package Repositories Fedora 19 Ensure all yum repositories utilize signature checking. Disable Prelinking Fedora 19 The prelinking feature can interfere with the operation of checksum integrity tools (e.g. AIDE), mitigates the protection provided by ASLR, and requires additional CPU cycles by software upgrades. Package openssh-server Removed Fedora 19 The RPM package openssh-server should be removed. Verify that System Executables Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, and objects therein, are owned by root. Verify No netrc Files Exist Fedora 19 The .netrc files contain login information used to auto-login into FTP servers and reside in the user's home directory. Any .netrc files should be removed. Set Password Expiration Parameters Fedora 19 The minimum password age policy should be set appropriately. Verify that System Executables Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that binary files under /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, and /usr/local/sbin, are not group-writable or world-writable. Set Password Expiration Parameters Fedora 19 The password expiration warning age should be set appropriately. .* /etc/securetty ^vc/[0-9]+$ 1 /etc/pam.d/system-auth \s*nullok\s* 1 /etc/login.defs ^[\s]*PASS_MAX_DAYS[\s]+(\d+)\s*$ 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitRootLogin\s+yes).)*(\n\s*PermitRootLogin\s+no)(.*)$ 1 /etc/passwd ^(?!root:)[^:]*:[^:]:0 1 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveInterval[\s]+(\d+)[\s]*$ 1 /etc/passwd ^(?!root).*:x:[\d]*:0*([0-9]{1,2}|[1-4][0-9]{2}):[^:]*:[^:]*:(?!\/sbin\/nologin|\/bin\/sync|\/sbin\/shutdown|\/sbin\/halt).*$ 1 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:204 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:204 fedora-release /etc/systemd/system/multi-user.target.wants/sshd.service oval:ssg:ste:205 /etc/systemd/system/multi-user.target.wants/ntpd.service oval:ssg:ste:205 ntp /etc/login.defs ^PASS_MIN_LEN\s+(\d+)\s*$ 1 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveCountMax[\s]+([\d]+)[\s]*$ 1 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:206 oval:ssg:ste:207 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:206 oval:ssg:ste:207 /etc/yum.conf ^\s*gpgcheck\s*=\s*1\s*$ 1 /etc/ntp.conf ^[\s]*server[\s]+.+$ 1 /etc/securetty ^ttyS[0-9]+$ 1 /etc/ssh/sshd_config ^(?i)\s*PermitEmptyPasswords\s+(yes|no)\s*$ 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitEmptyPasswords\s+yes).)*(\n\s*PermitEmptyPasswords\s+no)(.*)$ 1 /etc/yum.repos.d .* ^\s*gpgcheck\s*=\s*0\s*$ 1 /etc/sysconfig/prelink ^PRELINKING=no$ 1 openssh-server ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin oval:ssg:ste:208 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:208 /home ^\.netrc$ /etc/login.defs ^[\s]*PASS_MIN_DAYS[\s]+(\d+)\s*$ 1 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:209 oval:ssg:ste:210 /etc/login.defs ^[\s]*PASS_WARN_AGE[\s]*(\d+)\s*$ 1 x 0 0 unix ^19$ symbolic link 0 true true symbolic link 0 true true symbolic link draft Guide to the Secure Configuration of Fedora This guide presents a catalog of security-relevant configuration settings for Fedora operating system formatted in the eXtensible Configuration Checklist Description Format (XCCDF).

Providing system administrators with such guidance informs them how to securely configure systems under their control in a variety of network roles. Policy makers and baseline creators can use this catalog of settings, with its associated references to higher-level security control catalogs, in order to assist them in security baseline creation. This guide is a catalog, not a checklist, and satisfaction of every item is not likely to be possible or sensible in many operational scenarios. However, the XCCDF format enables granular selection and adjustment of settings, and their association with OVAL and OCIL content provides an automated checking capability. Transformations of this document, and its associated automated checking content, are capable of providing baselines that meet a diverse set of policy objectives. Some example XCCDF Profiles, which are selections of items that form checklists and can be used as baselines, are available with this guide. They can be processed, in an automated fashion, with tools that support the Security Content Automation Protocol (SCAP).
Do not attempt to implement any of the settings in this guide without first testing them in a non-operational environment. The creators of this guidance assume no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. The SCAP Security Guide Project
https://fedorahosted.org/scap-security-guide
Red Hat and Fedora are either registered trademarks or trademarks of Red Hat, Inc. in the United States and other countries. All other names are registered trademarks or trademarks of their respective companies. 0.0.4 Common Profile for General-Purpose Fedora Systems This profile contains items common to general-purpose Fedora installations. A conditional clause for check statements. A conditional clause for check statements. This is a placeholder. Introduction The purpose of this guidance is to provide security configuration recommendations and baselines for the Fedora operating system. Recommended settings for the basic operating system are provided, as well as for many network services that the system can provide to other systems. The guide is intended for system administrators. Readers are assumed to possess basic system administration skills for Unix-like systems, as well as some familiarity with Fedora's documentation and administration conventions. Some instructions within this guide are complex. All directions should be followed completely and with understanding of their effects in order to avoid serious adverse effects on the system and its security. General Principles The following general principles motivate much of the advice in this guide and should also influence any configuration decisions that are not explicitly covered. Encrypt Transmitted Data Whenever Possible Data transmitted over a network, whether wired or wireless, is susceptible to passive monitoring. Whenever practical solutions for encrypting such data exist, they should be applied. Even if data is expected to be transmitted only over a local network, it should still be encrypted. Encrypting authentication data, such as passwords, is particularly important. Networks of Fedora machines can and should be configured so that no unencrypted authentication data is ever transmitted between machines. Minimize Software to Minimize Vulnerability The simplest way to avoid vulnerabilities in software is to avoid installing that software. On Fedora, the RPM Package Manager (originally Red Hat Package Manager, abbreviated RPM) allows for careful management of the set of software packages installed on a system. Installed software contributes to system vulnerability in several ways. Packages that include setuid programs may provide local attackers a potential path to privilege escalation. Packages that include network services may give this opportunity to network-based attackers. Packages that include programs which are predictably executed by local users (e.g. after graphical login) may provide opportunities for trojan horses or other attack code to be run undetected. The number of software packages installed on a system can almost always be significantly pruned to include only the software for which there is an environmental or operational need. Run Different Network Services on Separate Systems Whenever possible, a server should be dedicated to serving exactly one network service. This limits the number of other services that can be compromised in the event that an attacker is able to successfully exploit a software flaw in one network service. Configure Security Tools to Improve System Robustness Several tools exist which can be effectively used to improve a system's resistance to and detection of unknown attacks. These tools can improve robustness against attack at the cost of relatively little configuration effort. In particular, this guide recommends and discusses the use of Iptables for host-based firewalling, SELinux for protection against vulnerable services, and a logging and auditing infrastructure for detection of problems. Least Privilege Grant the least privilege necessary for user accounts and software to perform tasks. For example, sudo can be implemented to limit authorization to super user accounts on the system only to designated personnel. Another example is to limit logins on server systems to only those administrators who need to log into them in order to perform administration tasks. Using SELinux also follows the principle of least privilege: SELinux policy can confine software to perform only actions on the system that are specifically allowed. This can be far more restrictive than the actions permissible by the traditional Unix permissions model. How to Use This Guide Readers should heed the following points when using the guide. Read Sections Completely and in Order Each section may build on information and recommendations discussed in prior sections. Each section should be read and understood completely; instructions should never be blindly applied. Relevant discussion may occur after instructions for an action. Test in Non-Production Environment This guidance should always be tested in a non-production environment before deployment. This test environment should simulate the setup in which the system will be deployed as closely as possible. Root Shell Environment Assumed Most of the actions listed in this document are written with the assumption that they will be executed by the root user running the /bin/bash shell. Commands preceded with a hash mark (#) assume that the administrator will execute the commands as root, i.e. apply the command via sudo whenever possible, or use su to gain root privileges if sudo cannot be used. Commands which can be executed as a non-root user are are preceded by a dollar sign ($) prompt. Formatting Conventions Commands intended for shell execution, as well as configuration file text, are featured in a monospace font. Italics are used to indicate instances where the system administrator must substitute the appropriate information into a command or configuration file. Reboot Required A system reboot is implicitly required after some actions in order to complete the reconfiguration of the system. In many cases, the changes will not take effect until a reboot is performed. In order to ensure that changes are applied properly and to test functionality, always reboot the system after applying a set of recommendations from this guide. System Settings General System Wide Configuration Settings The following sections contain information on various security-relevant configuration settings that in particular way modify the behaviour of the system as a whole. Prelinking Disabled The prelinking feature changes binaries in an attempt to decrease their startup time. In order to disable it, change or add the following line inside the file /etc/sysconfig/prelink:
PRELINKING=no
Next, run the following command to return binaries to a normal, non-prelinked state:
# /sbin/prelink -ua
CM-6(d) CM-6(3) SC-28 SI-7 The prelinking feature can interfere with the operation of checksum integrity tools (e.g. AIDE), because it modifies binaries to speed up their startup time. Also it makes the location of shared libraries very predictable, mitigating the efficiency of address space layout randomization (ASLR) protection mechanism. In addition, each upgrade of an application or a library requires prelink to be run again. # # Disable prelinking altogether # if grep -q ^PRELINKING /etc/sysconfig/prelink then sed -i 's/PRELINKING.*/PRELINKING=no/g' /etc/sysconfig/prelink else echo -e "\n# Set PRELINKING=no per security requirements" >> /etc/sysconfig/prelink echo "PRELINKING=no" >> /etc/sysconfig/prelink fi # # Undo previous prelink changes to binaries # /usr/sbin/prelink -ua
Installing and Maintaining Software The following sections contain information on security-relevant choices during the initial operating system installation process and the setup of software updates. Updating Software The yum command line tool is used to install and update software packages. The system also provides a graphical software update tool in the System menu, in the Administration submenu, called Software Update.

Fedora systems contain an installed software catalog called the RPM database, which records metadata of installed packages. Tools such as yum or the graphical Software Update ensure usage of RPM packages for software installation. This allows for insight into the current inventory of installed software on the system, and is highly recommended.
gpgcheck Enabled In Main Yum Configuration The gpgcheck option should be used to ensure checking of an RPM package's signature always occurs prior to its 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
SI-7 MA-1(b) 352 663 Ensuring the validity of packages' cryptographic signatures prior to installation ensures the provenance of the software and protects against malicious tampering. To determine whether yum is configured to use gpgcheck, inspect /etc/yum.conf and ensure the following appears in the [main] section:
gpgcheck=1
A value of 1 indicates that gpgcheck is enabled. Absence of a gpgcheck line or a setting of 0 indicates that it is disabled.
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
SI-7 MA-1(b) 352 663 Ensuring all packages' cryptographic signatures are valid prior to installation ensures the provenance of the software and protects against malicious tampering. To determine whether yum has been configured to disable gpgcheck for any repos, inspect all files in /etc/yum.repos.d and ensure the following does not appear in any sections:
gpgcheck=0
A value of 0 indicates that gpgcheck has been disabled for that repo.
File Permissions and Masks Traditional Unix security relies heavily on file and directory permissions to prevent unauthorized users from reading or modifying files to which they should not have access. Verify File Permissions Within Some Important Directories Some directories contain files whose confidentiality or integrity is notably important and may also be susceptible to misconfiguration over time, particularly if unpackaged software is installed. As such, an argument exists to verify that files' permissions within these directories remain configured correctly and restrictively. Shared Library Files Have Restrictive Permissions System-wide shared library files, which are linked to executables during process load time or run time, are stored in the following directories by default:
/lib
/lib64
/usr/lib
/usr/lib64
Kernel modules, which can be added to the kernel during runtime, are stored in /lib/modules. All files in these directories should not be group-writable or world-writable. If any file in these directories is found to be group-writable or world-writable, correct its permission with the following command:
# chmod go-w FILE
AC-6 1499 Files from shared library directories are loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime. Restrictive permissions are necessary to protect the integrity of the system.
Shared Library Files Have Root Ownership System-wide shared library files, which are linked to executables during process load time or run time, are stored in the following directories by default:
/lib
/lib64
/usr/lib
/usr/lib64
Kernel modules, which can be added to the kernel during runtime, are also stored in /lib/modules. All files in these directories should be owned by the root user. If the directory, or any file in these directories, is found to be owned by a user other than root correct its ownership with the following command:
# chown root FILE
AC-6 1499 Files from shared library directories are loaded into the address space of processes (including privileged ones) or of the kernel itself at runtime. Proper ownership is necessary to protect the integrity of the system.
System Executables Have Restrictive Permissions System executables are stored in the following directories by default:
/bin
/usr/bin
/usr/local/bin
/sbin
/usr/sbin
/usr/local/sbin
All files in these directories should not be group-writable or world-writable. If any file FILE in these directories is found to be group-writable or world-writable, correct its permission with the following command:
# chmod go-w FILE
AC-6 1499 System binaries are executed by privileged users, as well as system services, and restrictive permissions are necessary to ensure execution of these programs cannot be co-opted.
System Executables Have Root Ownership System executables are stored in the following directories by default:
/bin
/usr/bin
/usr/local/bin
/sbin
/usr/sbin
/usr/local/sbin
All files in these directories should be owned by the root user. If any file FILE in these directories is found to be owned by a user other than root, correct its ownership with the following command:
# chown root FILE
AC-6 1499 System binaries are executed by privileged users as well as system services, and restrictive permissions are necessary to ensure that their execution of these programs cannot be co-opted.
Account and Access Control In traditional Unix security, if an attacker gains shell access to a certain login account, they can perform any action or access any file to which that account has access. Therefore, making it more difficult for unauthorized people to gain shell access to accounts, particularly to privileged accounts, is a necessary part of securing a system. This section introduces mechanisms for restricting access to accounts under Fedora. Protect Accounts by Restricting Password-Based Login Conventionally, Unix shell accounts are accessed by providing a username and password to a login program, which tests these values for correctness using the /etc/passwd and /etc/shadow files. Password-based login is vulnerable to guessing of weak passwords, and to sniffing and man-in-the-middle attacks against passwords entered over a network or at an insecure console. Therefore, mechanisms for accessing accounts by entering usernames and passwords should be restricted to those which are operationally necessary. Restrict Root Logins Direct root logins should be allowed only for emergency use. In normal situations, the administrator should access the system via a unique unprivileged account, and then use su or sudo to execute privileged commands. Discouraging administrators from accessing the root account directly ensures an audit trail in organizations with multiple administrators. Locking down the channels through which root can connect directly also reduces opportunities for password-guessing against the root account. The login program uses the file /etc/securetty to determine which interfaces should allow root logins. The virtual devices /dev/console and /dev/tty* represent the system consoles (accessible via the Ctrl-Alt-F1 through Ctrl-Alt-F6 keyboard sequences on a default installation). The default securetty file also contains /dev/vc/*. These are likely to be deprecated in most environments, but may be retained for compatibility. Furthermore, /dev/hvc* represent virtio-serial consoles, /dev/hvsi* IBM pSeries serial consoles, and finally /dev/xvc0 Xen virtual console. Root should also be prohibited from connecting via network protocols. Other sections of this document include guidance describing how to prevent root from logging in via SSH. 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 his machine as root via Telnet, which sends the password in plain text over the network. By default, Fedora's /etc/securetty file only allows the root user to login at the console physically attached to the machine. 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:
echo > /etc/securetty
IA-2(1) 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 scenario is nowadays required by security standards. To ensure root may not directly login to the system over physical consoles, run the following command:
cat /etc/securetty
If any output is returned, this is a finding.
Virtual Console Root Logins Restricted To restrict root logins through the (deprecated) virtual console devices, ensure lines of this form do not appear in /etc/securetty:
vc/1
vc/2
vc/3
vc/4
AC-6(2) 770 Preventing direct root login to virtual console devices helps ensure accountability for actions taken on the system using the root account. To check for virtual console entries which permit root login, run the following command:
# grep ^vc/[0-9] /etc/securetty
If any output is returned, then root logins over virtual console devices is permitted.
Serial Port Root Logins Restricted To restrict root logins on serial ports, ensure lines of this form do not appear in /etc/securetty:
ttyS0
ttyS1
AC-6(2) 770 Preventing direct root login to serial port interfaces helps ensure accountability for actions taken on the systems using the root account. To check for serial port entries which permit root login, run the following command:
# grep ^ttyS/[0-9] /etc/securetty
If any output is returned, then root login over serial ports is permitted.
Web Browser Use for Administrative Accounts Restricted Enforce policy requiring administrative accounts use web browsers only for local service administration. If a browser vulnerability is exploited while running with administrative privileges, the entire system could be compromised. Specific exceptions for local service administration should be documented in site-defined policy. Check the root home directory for a .mozilla directory. If one exists, ensure browsing is limited to local service administration. System Accounts Do Not Run a Shell Upon Login Some accounts are not associated with a human user of the system, and exist to perform some administrative function. Should an attacker be able to log into these accounts, they should not be granted access to a shell.

The login shell for each local account is stored in the last field of each line in /etc/passwd. System accounts are those user accounts with a user ID less than 500. The user ID is stored in the third field. If any system account SYSACCT (other than root) has a login shell, disable it with the command:
# usermod -s /sbin/nologin SYSACCT
Do not perform the steps in this section on the root account. Doing so might cause the system to become inaccessible. 178 Ensuring shells are not given to system accounts upon login makes it more difficult for attackers to make use of system accounts. To obtain a listing of all users, their UIDs, and their shells, run the command:
$ awk -F: '{print $1 ":" $3 ":" $7}' /etc/passwd
Identify the system accounts from this listing. These will primarily be the accounts with UID numbers less than 500, other than root.
Only Root Has UID 0 If any account other than root has a UID of 0, this misconfiguration should be investigated and the accounts other than root should be removed or have their UID changed. AC-6 IA-2(1) 366 An account has root authority if it has a UID of 0. Multiple accounts with a UID of 0 afford more opportunity for potential intruders to guess a password for a privileged account. Proper configuration of sudo is recommended to afford multiple system administrators access to root privileges in an accountable manner. To list all password file entries for accounts with UID 0, run the following command:
# awk -F: '($3 == "0") {print}' /etc/passwd
This should print only one line, for the user root.
Root Path Is Vendor Default Assuming root shell is bash, edit the following files:
~/.profile
~/.bashrc
Change any PATH variables to the vendor default for root and remove any empty PATH entries or references to relative paths.
The root account's executable search path must be the vendor default, and must contain only absolute paths. To view the root user's PATH, run the following command:
# env | grep PATH
If correctly configured, the PATH must: use vendor default settings, have no empty entries, and have no entries beginning with a character other than a slash (/).
Proper Storage and Existence of Password Hashes By default, password hashes for local accounts are stored in the second field (colon-separated) in /etc/shadow. This file should be readable only by processes running with root credentials, preventing users from casually accessing others' password hashes and attempting to crack them. However, it remains possible to misconfigure the system and store password hashes in world-readable files such as /etc/passwd, or to even store passwords themselves in plaintext on the system. Using system-provided tools for password change/creation should allow administrators to avoid such misconfiguration. Log In to Accounts With Empty Password Impossible If an account is configured for password authentication but does not have an assigned password, it may be possible to log into the account without authentication. Remove any instances of the nullok option in /etc/pam.d/system-auth to prevent logins with empty passwords. IA-5(b) IA-5(c) IA-5(1)(a) If an account has an empty password, anyone could log in and run commands with the privileges of that account. Accounts with empty passwords should never be used in operational environments. To verify that null passwords cannot be used, run the following command:
# grep nullok /etc/pam.d/system-auth
If this produces any output, it may be possible to log into accounts with empty passwords.
Password Hashes For Each Account Shadowed If any password hashes are stored in /etc/passwd (in the second field, instead of an x), the cause of this misconfiguration should be investigated. The account should have its password reset and the hash should be properly stored, or the account should be deleted entirely. IA-5(h) 201 The hashes for all user account passwords should be stored in the file /etc/shadow and never in /etc/passwd, which is readable by all users. To check that no password hashes are stored in /etc/passwd, run the following command:
# awk -F: '($2 != "x") {print}' /etc/passwd
If it produces any output, then a password hash is stored in /etc/passwd.
All GIDs referenced in /etc/passwd Defined in /etc/group Add a group to the system for each GID referenced without a corresponding group. 366 Inconsistency in GIDs between /etc/passwd and /etc/group could lead to a user having unintended rights. To ensure all GIDs referenced in /etc/passwd are defined in /etc/group, run the following command:
# pwck -qr
There should be no output.
netrc Files Do Not Exist The .netrc files contain login information used to auto-login into FTP servers and reside in the user's home directory. These files may contain unencrypted passwords to remote FTP servers making them susceptible to access by unauthorized users and should not be used. Any .netrc files should be removed. IA-5(h) 196 Unencrypted passwords for remote FTP servers may be stored in .netrc files. DoD policy requires passwords be encrypted in storage and not used in access scripts. To check the system for the existence of any .netrc files, run the following command:
# find /home -xdev -name .netrc
Set Password Expiration Parameters The file /etc/login.defs controls several password-related settings. Programs such as passwd, su, and login consult /etc/login.defs to determine behavior with regard to password aging, expiration warnings, and length. See the man page login.defs(5) for more information.

Users should be forced to change their passwords, in order to decrease the utility of compromised passwords. However, the need to change passwords often should be balanced against the risk that users will reuse or write down passwords if forced to change them too often. Forcing password changes every 90-360 days, depending on the environment, is recommended. Set the appropriate value as PASS_MAX_DAYS and apply it to existing accounts with the -M flag.

The PASS_MIN_DAYS (-m) setting prevents password changes for 7 days after the first change, to discourage password cycling. If you use this setting, train users to contact an administrator for an emergency password change in case a new password becomes compromised. The PASS_WARN_AGE (-W) setting gives users 7 days of warnings at login time that their passwords are about to expire.

For example, for each existing human user USER, expiration parameters could be adjusted to a 180 day maximum password age, 7 day minimum password age, and 7 day warning period with the following command:
# chage -M 180 -m 7 -W 7 USER
minimum password length Minimum number of characters in password This will only check new passwords 12 6 8 10 12 14 maximum password age Maximum age of password in days This will only apply to newly created accounts 60 60 90 120 180 minimum password age Minimum age of password in days This will only apply to newly created accounts 7 7 5 1 2 0 warning days before password expires The number of days' warning given before a password expires. This will only apply to newly created accounts 7 0 7 14 Password Minimum Length To specify password length requirements for new accounts, edit the file /etc/login.defs and add or correct the following lines:
PASS_MIN_LEN 12


Nowadays recommended values, considered as secure by various organizations focused on topic of computer security, range from 12 (FISMA) up to 14 (DoD) characters for password length requirements. If a program consults /etc/login.defs and also another PAM module (such as pam_cracklib) during a password change operation, then the most restrictive must be satisfied. See PAM section for more information about enforcing password quality requirements.
IA-5(f) IA-5(1)(a) 205 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. var_accounts_password_minlen_login_defs="" grep -q ^PASS_MIN_LEN /etc/login.defs && \ sed -i "s/PASS_MIN_LEN.*/PASS_MIN_LEN\t$var_accounts_password_minlen_login_defs/g" /etc/login.defs if ! [ $? -eq 0 ] then echo -e "PASS_MIN_LEN\t$var_accounts_password_minlen_login_defs" >> /etc/login.defs fi To check the minimum password length, run the command:
$ grep PASS_MIN_LEN /etc/login.defs
Passwords of length 12 characters and more are nowadays considered to be a standard requirement.
Password Minimum Age To specify password minimum age for new accounts, edit the file /etc/login.defs and add or correct the following line, replacing the DAYS item as appropriate:
PASS_MIN_DAYS DAYS
A value of 1 day is considered to be sufficient for many environments.
IA-5(f) IA-5(1)(d) 198 Setting the minimum password age protects against users cycling back to a favorite password after satisfying the password reuse requirement. var_accounts_minimum_age_login_defs="" grep -q ^PASS_MIN_DAYS /etc/login.defs && \ sed -i "s/PASS_MIN_DAYS.*/PASS_MIN_DAYS\t$var_accounts_minimum_age_login_defs/g" /etc/login.defs if ! [ $? -eq 0 ] then echo -e "PASS_MIN_DAYS\t$var_accounts_minimum_age_login_defs" >> /etc/login.defs fi To check the minimum password age, run the command:
$ grep PASS_MIN_DAYS /etc/login.defs
A value of 1 day is considered to be sufficient for many environments.
Password Maximum Age To specify password maximum age for new accounts, edit the file /etc/login.defs and add or correct the following line, replacing the DAYS item appropriately:
PASS_MAX_DAYS DAYS
A value of 180 days is sufficient for many environments.
IA-5(f) IA-5(g) IA-5(1)(d) 180 199 Setting the password maximum age ensures users are required to periodically change their passwords. This could possibly decrease the utility of a stolen password. Requiring shorter password lifetimes increases the risk of users writing down the password in a convenient location subject to physical compromise. var_accounts_maximum_age_login_defs="" grep -q ^PASS_MAX_DAYS /etc/login.defs && \ sed -i "s/PASS_MAX_DAYS.*/PASS_MAX_DAYS\t$var_accounts_maximum_age_login_defs/g" /etc/login.defs if ! [ $? -eq 0 ] then echo -e "PASS_MAX_DAYS\t$var_accounts_maximum_age_login_defs" >> /etc/login.defs fi To check the maximum password age, run the command:
$ grep PASS_MAX_DAYS /etc/login.defs
A value of 180 days is sufficient for many environments.
Password Warning Age To specify how many days prior to password expiration that a warning will be issued to users, edit the file /etc/login.defs and add or correct the following line, replacing the DAYS item as appropriate:
PASS_WARN_AGE DAYS
A value of 7 days would be nowadays considered to be a standard.
IA-5(f) Setting the password warning age enables users to make the change at a practical time. var_accounts_password_warn_age_login_defs="" grep -q ^PASS_WARN_AGE /etc/login.defs && \ sed -i "s/PASS_WARN_AGE.*/PASS_WARN_AGE\t$var_accounts_password_warn_age_login_defs/g" /etc/login.defs if ! [ $? -eq 0 ] then echo -e "PASS_WARN_AGE\t$var_accounts_password_warn_age_login_defs" >> /etc/login.defs fi To check the password warning age, run the command:
$ grep PASS_WARN_AGE /etc/login.defs
A value of 7 days would be nowadays considered to be a standard.
Services The best protection against vulnerable software is running less software. This section describes how to review the software which Fedora installs on a system and disable software which is not needed. It then enumerates the software packages installed on a default Fedora system and provides guidance about which ones can be safely disabled.

Fedora provides a convenient minimal install option that essentially installs the bare necessities for a functional system. When building Fedora servers, it is highly recommended to select the minimal packages and then build up the system from there.
Network Time Protocol The Network Time Protocol is used to manage the system clock over a network. Computer clocks are not very accurate, so time will drift unpredictably on unmanaged systems. Central time protocols can be used both to ensure that time is consistent among a network of machines, and that their time is consistent with the outside world.

If every system on a network reliably reports the same time, then it is much easier to correlate log messages in case of an attack. In addition, a number of cryptographic protocols (such as Kerberos) use timestamps to prevent certain types of attacks. If your network does not have synchronized time, these protocols may be unreliable or even unusable.

Depending on the specifics of the network, global time accuracy may be just as important as local synchronization, or not very important at all. If your network is connected to the Internet, using a public timeserver (or one provided by your enterprise) provides globally accurate timestamps which may be essential in investigating or responding to an attack which originated outside of your network.

A typical network setup involves a small number of internal systems operating as NTP servers, and the remainder obtaining time information from those internal servers.

More information on how to configure the NTP server software, including configuration of cryptographic authentication for time data, is available at http://www.ntp.org.
NTP Daemon Enabled The ntpd service can be enabled with the following command: # systemctl enable ntpd.service AU-8(1) 160 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. Additional information on this is available at http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate
# # Install ntp package if necessary # yum -y install ntp # # Enable ntpd service (for current systemd target) # systemctl enable ntpd.service # # Start ntpd if not currently running # systemctl start ntpd.service
Remote NTP Server Specified To specify a remote NTP server for time synchronization, edit the file /etc/ntp.conf. Add or correct the following lines, substituting the IP or hostname of a remote NTP server for ntpserver:
server ntpserver
This instructs the NTP software to contact that remote server to obtain time data.
AU-8(1) 160 Synchronizing with an NTP server makes it possible to collate system logs from multiple sources or correlate computer events with real time events.
SSH Server The SSH protocol is recommended for remote login and remote file transfer. SSH provides confidentiality and integrity for data exchanged between two systems, as well as server authentication, through the use of public key cryptography. The implementation included with the system is called OpenSSH, and more detailed documentation is available from its website, http://www.openssh.org. Its server program is called sshd and provided by the RPM package openssh-server. SSH session Idle time Specify duration of allowed idle time. 300 300 600 900 Configure OpenSSH Server if Necessary If the system needs to act as an SSH server, then certain changes should be made to the OpenSSH daemon configuration file /etc/ssh/sshd_config. The following recommendations can be applied to this file. See the sshd_config(5) man page for more detailed information. SSH Root Login Disabled 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
AC-6(2) IA-2(1) 770 Permitting direct root login reduces auditable information about who ran privileged commands on the system and also allows direct attack attempts on root's password. SSHD_CONFIG='/etc/ssh/sshd_config' # Obtain line number of first uncommented case-insensitive occurrence of Match # block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG) # Obtain line number of first uncommented case-insensitive occurence of # PermitRootLogin directive (possibly prefixed with whitespace) present in # $SSHD_CONFIG FIRST_PERMIT_ROOT_LOGIN=$(sed -n '/^[[:space:]]*PermitRootLogin[^\n]*/I{=;q}' $SSHD_CONFIG) # Case: Match block directive not present in $SSHD_CONFIG if [ -z "$FIRST_MATCH_BLOCK" ] then # Case: PermitRootLogin directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_PERMIT_ROOT_LOGIN" ] then # Append 'PermitRootLogin no' at the end of $SSHD_CONFIG echo -e "\nPermitRootLogin no" >> $SSHD_CONFIG # Case: PermitRootLogin directive present in $SSHD_CONFIG already else # Replace first uncommented case-insensitive occurrence # of PermitRootLogin directive sed -i "$FIRST_PERMIT_ROOT_LOGIN s/^[[:space:]]*PermitRootLogin.*$/PermitRootLogin no/I" $SSHD_CONFIG fi # Case: Match block directive present in $SSHD_CONFIG else # Case: PermitRootLogin directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_PERMIT_ROOT_LOGIN" ] then # Prepend 'PermitRootLogin no' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitRootLogin no\n\1/I" $SSHD_CONFIG # Case: PermitRootLogin directive present in $SSHD_CONFIG and placed # before first Match block directive elif [ "$FIRST_PERMIT_ROOT_LOGIN" -lt "$FIRST_MATCH_BLOCK" ] then # Replace first uncommented case-insensitive occurrence # of PermitRootLogin directive sed -i "$FIRST_PERMIT_ROOT_LOGIN s/^[[:space:]]*PermitRootLogin.*$/PermitRootLogin no/I" $SSHD_CONFIG # Case: PermitRootLogin directive present in $SSHD_CONFIG and placed # after first Match block directive else # Prepend 'PermitRootLogin no' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitRootLogin no\n\1/I" $SSHD_CONFIG fi fi
SSH Access via Empty Passwords Disabled To explicitly disallow remote 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.
765 766 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. SSHD_CONFIG='/etc/ssh/sshd_config' # Obtain line number of first uncommented case-insensitive occurrence of Match # block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG) # Obtain line number of first uncommented case-insensitive occurence of # PermitEmptyPasswords directive (possibly prefixed with whitespace) present in # $SSHD_CONFIG FIRST_PERMIT_EMPTY_PASSWORDS=$(sed -n '/^[[:space:]]*PermitEmptyPasswords[^\n]*/I{=;q}' $SSHD_CONFIG) # Case: Match block directive not present in $SSHD_CONFIG if [ -z "$FIRST_MATCH_BLOCK" ] then # Case: PermitEmptyPasswords directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_PERMIT_EMPTY_PASSWORDS" ] then # Append 'PermitEmptyPasswords no' at the end of $SSHD_CONFIG echo -e "\nPermitEmptyPasswords no" >> $SSHD_CONFIG # Case: PermitEmptyPasswords directive present in $SSHD_CONFIG already else # Replace first uncommented case-insensitive occurrence # of PermitEmptyPasswords directive sed -i "$FIRST_PERMIT_EMPTY_PASSWORDS s/^[[:space:]]*PermitEmptyPasswords.*$/PermitEmptyPasswords no/I" $SSHD_CONFIG fi # Case: Match block directive present in $SSHD_CONFIG else # Case: PermitEmptyPasswords directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_PERMIT_EMPTY_PASSWORDS" ] then # Prepend 'PermitEmptyPasswords no' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitEmptyPasswords no\n\1/I" $SSHD_CONFIG # Case: PermitEmptyPasswords directive present in $SSHD_CONFIG and placed # before first Match block directive elif [ "$FIRST_PERMIT_EMPTY_PASSWORDS" -lt "$FIRST_MATCH_BLOCK" ] then # Replace first uncommented case-insensitive occurrence # of PermitEmptyPasswords directive sed -i "$FIRST_PERMIT_EMPTY_PASSWORDS s/^[[:space:]]*PermitEmptyPasswords.*$/PermitEmptyPasswords no/I" $SSHD_CONFIG # Case: PermitEmptyPasswords directive present in $SSHD_CONFIG and placed # after first Match block directive else # Prepend 'PermitEmptyPasswords no' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/PermitEmptyPasswords no\n\1/I" $SSHD_CONFIG fi fi
SSH Idle Timeout Interval Used 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 INTERVAL
The timeout INTERVAL is given in seconds. To have a timeout of 15 minutes, set interval to 900.

If a shorter timeout has already been set for the login shell, that value will preempt any SSH setting made here. Keep in mind that some processes may stop SSH from correctly detecting that the user is idle.
879 1133 Causing idle users to be automatically logged out guards against compromises one system leading trivially to compromises on another. sshd_idle_timeout_value="" SSHD_CONFIG='/etc/ssh/sshd_config' # Obtain line number of first uncommented case-insensitive occurrence of Match # block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG) # Obtain line number of first uncommented case-insensitive occurence of # ClientAliveInterval directive (possibly prefixed with whitespace) present in # $SSHD_CONFIG FIRST_CLIENT_ALIVE_INTERVAL=$(sed -n '/^[[:space:]]*ClientAliveInterval[^\n]*/I{=;q}' $SSHD_CONFIG) # Case: Match block directive not present in $SSHD_CONFIG if [ -z "$FIRST_MATCH_BLOCK" ] then # Case: ClientAliveInterval directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_CLIENT_ALIVE_INTERVAL" ] then # Append 'ClientAliveInterval $sshd_idle_timeout_value' at the end of $SSHD_CONFIG echo -e "\nClientAliveInterval $sshd_idle_timeout_value" >> $SSHD_CONFIG # Case: ClientAliveInterval directive present in $SSHD_CONFIG already else # Replace first uncommented case-insensitive occurrence # of ClientAliveInterval directive sed -i "$FIRST_CLIENT_ALIVE_INTERVAL s/^[[:space:]]*ClientAliveInterval.*$/ClientAliveInterval $sshd_idle_timeout_value/I" $SSHD_CONFIG fi # Case: Match block directive present in $SSHD_CONFIG else # Case: ClientAliveInterval directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_CLIENT_ALIVE_INTERVAL" ] then # Prepend 'ClientAliveInterval $sshd_idle_timeout_value' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveInterval $sshd_idle_timeout_value\n\1/I" $SSHD_CONFIG # Case: ClientAliveInterval directive present in $SSHD_CONFIG and placed # before first Match block directive elif [ "$FIRST_CLIENT_ALIVE_INTERVAL" -lt "$FIRST_MATCH_BLOCK" ] then # Replace first uncommented case-insensitive occurrence # of ClientAliveInterval directive sed -i "$FIRST_CLIENT_ALIVE_INTERVAL s/^[[:space:]]*ClientAliveInterval.*$/ClientAliveInterval $sshd_idle_timeout_value/I" $SSHD_CONFIG # Case: ClientAliveInterval directive present in $SSHD_CONFIG and placed # after first Match block directive else # Prepend 'ClientAliveInterval $sshd_idle_timeout_value' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveInterval $sshd_idle_timeout_value\n\1/I" $SSHD_CONFIG fi fi
SSH Client Alive Count Used To ensure the SSH idle timeout occurs precisely when the ClientAliveCountMax is set, edit /etc/ssh/sshd_config as follows:
ClientAliveCountMax 0
879 1133 This ensures a user login will be terminated as soon as the ClientAliveCountMax is reached. SSHD_CONFIG='/etc/ssh/sshd_config' # Obtain line number of first uncommented case-insensitive occurrence of Match # block directive (possibly prefixed with whitespace) present in $SSHD_CONFIG FIRST_MATCH_BLOCK=$(sed -n '/^[[:space:]]*Match[^\n]*/I{=;q}' $SSHD_CONFIG) # Obtain line number of first uncommented case-insensitive occurence of # ClientAliveCountMax directive (possibly prefixed with whitespace) present in # $SSHD_CONFIG FIRST_CLIENT_ALIVE_COUNT_MAX=$(sed -n '/^[[:space:]]*ClientAliveCountMax[^\n]*/I{=;q}' $SSHD_CONFIG) # Case: Match block directive not present in $SSHD_CONFIG if [ -z "$FIRST_MATCH_BLOCK" ] then # Case: ClientAliveCountMax directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_CLIENT_ALIVE_COUNT_MAX" ] then # Append 'ClientAliveCountMax 0' at the end of $SSHD_CONFIG echo -e "\nClientAliveCountMax 0" >> $SSHD_CONFIG # Case: ClientAliveCountMax directive present in $SSHD_CONFIG already else # Replace first uncommented case-insensitive occurrence # of ClientAliveCountMax directive sed -i "$FIRST_CLIENT_ALIVE_COUNT_MAX s/^[[:space:]]*ClientAliveCountMax.*$/ClientAliveCountMax 0/I" $SSHD_CONFIG fi # Case: Match block directive present in $SSHD_CONFIG else # Case: ClientAliveCountMax directive not present in $SSHD_CONFIG yet if [ -z "$FIRST_CLIENT_ALIVE_COUNT_MAX" ] then # Prepend 'ClientAliveCountMax 0' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveCountMax 0\n\1/I" $SSHD_CONFIG # Case: ClientAliveCountMax directive present in $SSHD_CONFIG and placed # before first Match block directive elif [ "$FIRST_CLIENT_ALIVE_COUNT_MAX" -lt "$FIRST_MATCH_BLOCK" ] then # Replace first uncommented case-insensitive occurrence # of ClientAliveCountMax directive sed -i "$FIRST_CLIENT_ALIVE_COUNT_MAX s/^[[:space:]]*ClientAliveCountMax.*$/ClientAliveCountMax 0/I" $SSHD_CONFIG # Case: ClientAliveCountMax directive present in $SSHD_CONFIG and placed # after first Match block directive else # Prepend 'ClientAliveCountMax 0' before first uncommented # case-insensitive occurrence of Match block directive sed -i "$FIRST_MATCH_BLOCK s/^\([[:space:]]*Match[^\n]*\)/ClientAliveCountMax 0\n\1/I" $SSHD_CONFIG fi fi
python 2.6.6 5.10 2011-09-21T13:44:00 Fedora release 19 (Schrödinger's Cat) Fedora 19 The operating system installed on the system is Fedora release 19 (Schrödinger's Cat) fedora-release unix ^19$ Fedora release 19 (Schrödinger's Cat) oval:ssg:def:100 python 2.6.6 5.10 2011-09-21T13:44:00 All Password Hashes Shadowed Fedora 19 All password hashes should be shadowed. Restrict Virtual Console Root Logins Fedora 19 Preventing direct root login to virtual console devices helps ensure accountability for actions taken on the system using the root account. No nullok Option in /etc/pam.d/system-auth Fedora 19 The file /etc/pam.d/system-auth should not contain the nullok option Set Password Expiration Parameters Fedora 19 The maximum password age policy should meet minimum requirements. Disable root Login via SSH Fedora 19 Root login via SSH should be disabled (and dependencies are met) UID 0 Belongs Only To Root Fedora 19 Only the root account should be assigned a user id of 0. Set OpenSSH Idle Timeout Interval Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Fedora 20 The SSH idle timeout interval should be set to an appropriate value. System Accounts Do Not Run a Shell Fedora 19 The root account is the only system account that should have a login shell. Verify that Shared Library Files Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are owned by root. Fedora release 19 (Schrödinger's Cat) Fedora 19 The operating system installed on the system is Fedora release 19 (Schrödinger's Cat) Service sshd Disabled Fedora 19 The sshd service should be disabled. Service ntpd Enabled Fedora 19 The ntpd service should be enabled. Package ntp Installed Fedora 19 The RPM package ntp should be installed. Set Password Expiration Parameters Fedora 19 The password minimum length should be set appropriately. Set ClientAliveCountMax for User Logins Fedora 19 The SSH ClientAliveCountMax should be set to an appropriate value (and dependencies are met) Verify that Shared Library Files Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are not group-writable or world-writable. Ensure Yum gpgcheck Globally Activated Fedora 19 The gpgcheck option should be used to ensure that checking of an RPM package's signature always occurs prior to its installation. Specify a Remote NTP Server for Time Data Fedora 19 A remote NTP Server for time synchronization should be specified Restrict Serial Port Root Logins Fedora 19 Preventing direct root login to serial port interfaces helps ensure accountability for actions taken on the system using the root account. Disable Empty Passwords Fedora 19 Remote connections from accounts with empty passwords should be disabled (and dependencies are met) Ensure gpgcheck Enabled For All Yum Package Repositories Fedora 19 Ensure all yum repositories utilize signature checking. Disable Prelinking Fedora 19 The prelinking feature can interfere with the operation of checksum integrity tools (e.g. AIDE), mitigates the protection provided by ASLR, and requires additional CPU cycles by software upgrades. Package openssh-server Removed Fedora 19 The RPM package openssh-server should be removed. Verify that System Executables Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, and objects therein, are owned by root. Verify No netrc Files Exist Fedora 19 The .netrc files contain login information used to auto-login into FTP servers and reside in the user's home directory. Any .netrc files should be removed. Set Password Expiration Parameters Fedora 19 The minimum password age policy should be set appropriately. Verify that System Executables Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that binary files under /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, and /usr/local/sbin, are not group-writable or world-writable. Set Password Expiration Parameters Fedora 19 The password expiration warning age should be set appropriately. .* /etc/securetty ^vc/[0-9]+$ 1 /etc/pam.d/system-auth \s*nullok\s* 1 /etc/login.defs ^[\s]*PASS_MAX_DAYS[\s]+(\d+)\s*$ 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitRootLogin\s+yes).)*(\n\s*PermitRootLogin\s+no)(.*)$ 1 /etc/passwd ^(?!root:)[^:]*:[^:]:0 1 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveInterval[\s]+(\d+)[\s]*$ 1 /etc/passwd ^(?!root).*:x:[\d]*:0*([0-9]{1,2}|[1-4][0-9]{2}):[^:]*:[^:]*:(?!\/sbin\/nologin|\/bin\/sync|\/sbin\/shutdown|\/sbin\/halt).*$ 1 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:204 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:204 fedora-release /etc/systemd/system/multi-user.target.wants/sshd.service oval:ssg:ste:205 /etc/systemd/system/multi-user.target.wants/ntpd.service oval:ssg:ste:205 ntp /etc/login.defs ^PASS_MIN_LEN\s+(\d+)\s*$ 1 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveCountMax[\s]+([\d]+)[\s]*$ 1 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:206 oval:ssg:ste:207 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:206 oval:ssg:ste:207 /etc/yum.conf ^\s*gpgcheck\s*=\s*1\s*$ 1 /etc/ntp.conf ^[\s]*server[\s]+.+$ 1 /etc/securetty ^ttyS[0-9]+$ 1 /etc/ssh/sshd_config ^(?i)\s*PermitEmptyPasswords\s+(yes|no)\s*$ 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitEmptyPasswords\s+yes).)*(\n\s*PermitEmptyPasswords\s+no)(.*)$ 1 /etc/yum.repos.d .* ^\s*gpgcheck\s*=\s*0\s*$ 1 /etc/sysconfig/prelink ^PRELINKING=no$ 1 openssh-server ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin oval:ssg:ste:208 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:208 /home ^\.netrc$ /etc/login.defs ^[\s]*PASS_MIN_DAYS[\s]+(\d+)\s*$ 1 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:209 oval:ssg:ste:210 /etc/login.defs ^[\s]*PASS_WARN_AGE[\s]*(\d+)\s*$ 1 x 0 0 unix ^19$ symbolic link 0 true true symbolic link 0 true true symbolic link
127.0.0.1 0:0:0:0:0:0:0:1 00:00:00:00:00:00 localhost.localdomain localhost OSCAP Scan Result root localhost.localdomain 127.0.0.1 0:0:0:0:0:0:0:1 OpenSCAP 1.0.9 00:00:00:00:00:00 fail pass pass fail pass pass pass notchecked No candidate or applicable check found. To ensure root may not directly login to the system over physical consoles, run the following command:
cat /etc/securetty
If any output is returned, this is a finding.
fail pass notselected Check the root home directory for a .mozilla directory. If one exists, ensure browsing is limited to local service administration. notselected To obtain a listing of all users, their UIDs, and their shells, run the command:
$ awk -F: '{print $1 ":" $3 ":" $7}' /etc/passwd
Identify the system accounts from this listing. These will primarily be the accounts with UID numbers less than 500, other than root.
pass notselected To view the root user's PATH, run the following command:
# env | grep PATH
If correctly configured, the PATH must: use vendor default settings, have no empty entries, and have no entries beginning with a character other than a slash (/).
fail pass notselected To ensure all GIDs referenced in /etc/passwd are defined in /etc/group, run the following command:
# pwck -qr
There should be no output.
pass fail fail fail pass fail fail fail pass fail fail 34.722221
cpe:/a:open-scap:oscap 5.10 2014-10-17T09:07:43 python 2.6.6 5.10 2011-09-21T13:44:00 Set Password Expiration Parameters Fedora 19 The password expiration warning age should be set appropriately. Verify that System Executables Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that binary files under /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, and /usr/local/sbin, are not group-writable or world-writable. Set Password Expiration Parameters Fedora 19 The minimum password age policy should be set appropriately. Verify No netrc Files Exist Fedora 19 The .netrc files contain login information used to auto-login into FTP servers and reside in the user's home directory. Any .netrc files should be removed. Verify that System Executables Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, and objects therein, are owned by root. Disable Prelinking Fedora 19 The prelinking feature can interfere with the operation of checksum integrity tools (e.g. AIDE), mitigates the protection provided by ASLR, and requires additional CPU cycles by software upgrades. Ensure gpgcheck Enabled For All Yum Package Repositories Fedora 19 Ensure all yum repositories utilize signature checking. Disable Empty Passwords Fedora 19 Remote connections from accounts with empty passwords should be disabled (and dependencies are met) Restrict Serial Port Root Logins Fedora 19 Preventing direct root login to serial port interfaces helps ensure accountability for actions taken on the system using the root account. Specify a Remote NTP Server for Time Data Fedora 19 A remote NTP Server for time synchronization should be specified Ensure Yum gpgcheck Globally Activated Fedora 19 The gpgcheck option should be used to ensure that checking of an RPM package's signature always occurs prior to its installation. Verify that Shared Library Files Have Restrictive Permissions Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are not group-writable or world-writable. Set ClientAliveCountMax for User Logins Fedora 19 The SSH ClientAliveCountMax should be set to an appropriate value (and dependencies are met) Set Password Expiration Parameters Fedora 19 The password minimum length should be set appropriately. Package ntp Installed Fedora 19 The RPM package ntp should be installed. Service ntpd Enabled Fedora 19 The ntpd service should be enabled. Package openssh-server Removed Fedora 19 The RPM package openssh-server should be removed. Verify that Shared Library Files Have Root Ownership Fedora 19 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Checks that /lib, /lib64, /usr/lib, /usr/lib64, /lib/modules, and objects therein, are owned by root. System Accounts Do Not Run a Shell Fedora 19 The root account is the only system account that should have a login shell. Set OpenSSH Idle Timeout Interval Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 7 Fedora 20 The SSH idle timeout interval should be set to an appropriate value. UID 0 Belongs Only To Root Fedora 19 Only the root account should be assigned a user id of 0. Service sshd Disabled Fedora 19 The sshd service should be disabled. Disable root Login via SSH Fedora 19 Root login via SSH should be disabled (and dependencies are met) Set Password Expiration Parameters Fedora 19 The maximum password age policy should meet minimum requirements. No nullok Option in /etc/pam.d/system-auth Fedora 19 The file /etc/pam.d/system-auth should not contain the nullok option Restrict Virtual Console Root Logins Fedora 19 Preventing direct root login to virtual console devices helps ensure accountability for actions taken on the system using the root account. All Password Hashes Shadowed Fedora 19 All password hashes should be shadowed. Fedora release 19 (Schrödinger's Cat) Fedora 19 The operating system installed on the system is Fedora release 19 (Schrödinger's Cat) /etc/login.defs ^[\s]*PASS_WARN_AGE[\s]*(\d+)\s*$ 1 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:209 oval:ssg:ste:210 /etc/login.defs ^[\s]*PASS_MIN_DAYS[\s]+(\d+)\s*$ 1 /home ^\.netrc$ ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin ^.*$ oval:ssg:ste:208 ^\/(|s)bin|^\/usr\/(|local\/)(|s)bin oval:ssg:ste:208 openssh-server /etc/sysconfig/prelink ^PRELINKING=no$ 1 /etc/yum.repos.d .* ^\s*gpgcheck\s*=\s*0\s*$ 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitEmptyPasswords\s+yes).)*(\n\s*PermitEmptyPasswords\s+no)(.*)$ 1 /etc/ssh/sshd_config ^(?i)\s*PermitEmptyPasswords\s+(yes|no)\s*$ 1 /etc/securetty ^ttyS[0-9]+$ 1 /etc/ntp.conf ^[\s]*server[\s]+.+$ 1 /etc/yum.conf ^\s*gpgcheck\s*=\s*1\s*$ 1 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:206 oval:ssg:ste:207 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:206 oval:ssg:ste:207 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveCountMax[\s]+([\d]+)[\s]*$ 1 /etc/login.defs ^PASS_MIN_LEN\s+(\d+)\s*$ 1 ntp /etc/systemd/system/multi-user.target.wants/ntpd.service oval:ssg:ste:205 /etc/systemd/system/multi-user.target.wants/sshd.service oval:ssg:ste:205 ^\/lib(|64)|^\/usr\/lib(|64) ^.*$ oval:ssg:ste:204 ^\/lib(|64)|^\/usr\/lib(|64) oval:ssg:ste:204 /etc/passwd ^(?!root).*:x:[\d]*:0*([0-9]{1,2}|[1-4][0-9]{2}):[^:]*:[^:]*:(?!\/sbin\/nologin|\/bin\/sync|\/sbin\/shutdown|\/sbin\/halt).*$ 1 /etc/ssh/sshd_config ^[\s]*(?i)ClientAliveInterval[\s]+(\d+)[\s]*$ 1 /etc/passwd ^(?!root:)[^:]*:[^:]:0 1 /etc/ssh/sshd_config ^(?i)(?:(?!\n\s*PermitRootLogin\s+yes).)*(\n\s*PermitRootLogin\s+no)(.*)$ 1 /etc/login.defs ^[\s]*PASS_MAX_DAYS[\s]+(\d+)\s*$ 1 /etc/pam.d/system-auth \s*nullok\s* 1 /etc/securetty ^vc/[0-9]+$ 1 .* fedora-release symbolic link true true 0 symbolic link true true symbolic link 0 0 0 x ^19$ unix 90 300 12 7 7 cpe:/a:open-scap:oscap 5.10 2014-10-17T09:07:43 Linux #1 SMP Mon Jul 7 14:24:41 UTC 2014 x86_64 localhost.localdomain lo 127.0.0.1 00:00:00:00:00:00 lo ::1 00:00:00:00:00:00 openssh-server x86_64 (none) 4.fc20 6.4p1 0:6.4p1-4.fc20 2eb161fa246110c1 openssh-server-0:6.4p1-4.fc20.x86_64 mail x 8 12 mail /var/spool/mail /sbin/nologin 0 halt x 7 0 halt /sbin /sbin/halt 0 shutdown x 6 0 shutdown /sbin /sbin/shutdown 0 sync x 5 0 sync /sbin /bin/sync 0 lp x 4 7 lp /var/spool/lpd /sbin/nologin 0 adm x 3 4 adm /var/adm /sbin/nologin 0 daemon x 2 2 daemon /sbin /sbin/nologin 0 puppet x 52 52 Puppet /var/lib/puppet /sbin/nologin 0 mgrepl x 1001 1001 /home/mgrepl /bin/bash 1395936192 unbound x 997 997 Unbound DNS resolver /etc/unbound /sbin/nologin 0 saslauth x 998 76 "Saslauthd user" /run/saslauthd /sbin/nologin 0 bin x 1 1 bin /bin /sbin/nologin 0 tss x 59 59 Account used by the trousers package to sandbox the tcsd daemon /dev/null /sbin/nologin 0 slukasik x 1000 1000 slukasik /home/slukasik /bin/bash 1413545481 sshd x 74 74 Privilege-separated SSH /var/empty/sshd /sbin/nologin 0 avahi-autoipd x 170 170 Avahi IPv4LL Stack /var/lib/avahi-autoipd /sbin/nologin 0 polkitd x 999 998 User for polkitd / /sbin/nologin 0 dbus x 81 81 System message bus / /sbin/nologin 0 nobody x 99 99 Nobody / /sbin/nologin 0 ftp x 14 50 FTP User /var/ftp /sbin/nologin 0 games x 12 100 games /usr/games /sbin/nologin 0 operator x 11 0 operator /root /sbin/nologin 0 root x 0 0 root /root /bin/bash 1413551246 /etc/systemd/system/multi-user.target.wants/sshd.service /etc/systemd/system/multi-user.target.wants sshd.service symbolic link 0 0 1413551275 1395677966 1395677966 36 false false false true true true true true true true true true false /lib/rpm/redhat/config.guess /lib/rpm/redhat config.guess regular 0 0 1378324987 1405349994 1378324987 45297 false false false true true true true true true true false true false /lib/rpm/redhat/config.sub /lib/rpm/redhat config.sub regular 0 0 1378324987 1405349994 1378324987 35576 false false false true true true true true true true false true false /usr/lib/rpm/redhat/config.guess /usr/lib/rpm/redhat config.guess regular 0 0 1378324987 1405349994 1378324987 45297 false false false true true true true true true true false true false /usr/lib/rpm/redhat/config.sub /usr/lib/rpm/redhat config.sub regular 0 0 1378324987 1405349994 1378324987 35576 false false false true true true true true true true false true false /etc/securetty /etc securetty ^vc/[0-9]+$ 8 ^vc/[0-9]+$ vc/8 /etc/securetty /etc securetty ^vc/[0-9]+$ 7 ^vc/[0-9]+$ vc/7 /etc/securetty /etc securetty ^vc/[0-9]+$ 6 ^vc/[0-9]+$ vc/6 /etc/securetty /etc securetty ^vc/[0-9]+$ 5 ^vc/[0-9]+$ vc/5 /etc/securetty /etc securetty ^vc/[0-9]+$ 4 ^vc/[0-9]+$ vc/4 /etc/securetty /etc securetty ^vc/[0-9]+$ 3 ^vc/[0-9]+$ vc/3 /etc/securetty /etc securetty ^vc/[0-9]+$ 2 ^vc/[0-9]+$ vc/2 /etc/securetty /etc securetty ^vc/[0-9]+$ 1 ^vc/[0-9]+$ vc/1 /etc/login.defs /etc login.defs ^[\s]*PASS_WARN_AGE[\s]*(\d+)\s*$ 1 ^[\s]*PASS_WARN_AGE[\s]*(\d+)\s*$ PASS_WARN_AGE 7 7 /etc/login.defs /etc login.defs ^[\s]*PASS_MAX_DAYS[\s]+(\d+)\s*$ 1 ^[\s]*PASS_MAX_DAYS[\s]+(\d+)\s*$ PASS_MAX_DAYS 99999 99999 /etc/login.defs /etc login.defs ^[\s]*PASS_MIN_DAYS[\s]+(\d+)\s*$ 1 ^[\s]*PASS_MIN_DAYS[\s]+(\d+)\s*$ PASS_MIN_DAYS 0 0 /etc/login.defs /etc login.defs ^PASS_MIN_LEN\s+(\d+)\s*$ 1 ^PASS_MIN_LEN\s+(\d+)\s*$ PASS_MIN_LEN 5 5 /etc/pam.d/system-auth /etc/pam.d system-auth \s*nullok\s* 1 \s*nullok\s* nullok /etc/securetty /etc securetty ^vc/[0-9]+$ 11 ^vc/[0-9]+$ vc/11 /etc/securetty /etc securetty ^vc/[0-9]+$ 10 ^vc/[0-9]+$ vc/10 /etc/securetty /etc securetty ^vc/[0-9]+$ 9 ^vc/[0-9]+$ vc/9 /etc/yum.conf /etc yum.conf ^\s*gpgcheck\s*=\s*1\s*$ 1 ^\s*gpgcheck\s*=\s*1\s*$ gpgcheck=1 5.10.1 2014-10-17T09:07:43 vim 5.10.1 2012-11-22T15:00:00+01:00 Red Hat Enterprise Linux 7 Red Hat Enterprise Linux 7 The operating system installed on the system is Red Hat Enterprise Linux 7 Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 6 The operating system installed on the system is Red Hat Enterprise Linux 6 Red Hat Enterprise Linux 5 Red Hat Enterprise Linux 5 The operating system installed on the system is Red Hat Enterprise Linux 5 Red Hat Enterprise Linux Red Hat Enterprise Linux The operating system installed on the system is Red Hat Enterprise Linux Fedora 21 Fedora 21 The operating system installed on the system is Fedora 21 Fedora 20 Fedora 20 The operating system installed on the system is Fedora 20 Fedora 19 Fedora 19 The operating system installed on the system is Fedora 19 Fedora 18 Fedora 18 The operating system installed on the system is Fedora 18 Fedora 17 Fedora 17 The operating system installed on the system is Fedora 17 Fedora 16 Fedora 16 The operating system installed on the system is Fedora 16 /etc/redhat-release redhat-release fedora-release unix ^redhat-release ^7[^\d] ^redhat-release ^6[^\d] ^5[^\d] ^redhat-release ^21$ ^20$ ^19$ ^18$ ^17$ ^16$ 5.10.1 2014-10-17T09:07:43 Linux #1 SMP Mon Jul 7 14:24:41 UTC 2014 x86_64 localhost.localdomain lo 127.0.0.1 00:00:00:00:00:00 lo ::1 00:00:00:00:00:00 fedora-release noarch (none) 3 20 0:20-3 2eb161fa246110c1 fedora-release-0:20-3.noarch unix 5.10 2014-10-17T09:07:43 python 2.6.6 5.10 2011-09-21T13:44:00 Fedora release 19 (Schrödinger's Cat) Fedora 19 The operating system installed on the system is Fedora release 19 (Schrödinger's Cat) fedora-release ^19$ unix 5.10 2014-10-17T09:07:43 Linux #1 SMP Mon Jul 7 14:24:41 UTC 2014 x86_64 localhost.localdomain lo 127.0.0.1 00:00:00:00:00:00 lo ::1 00:00:00:00:00:00 fedora-release noarch (none) 3 20 0:20-3 2eb161fa246110c1 fedora-release-0:20-3.noarch unix