Select any two versions of this STIG to compare the individual requirements
Select any old version/release of this STIG to view the previous requirements
Check if the system requires a password for entering single-user mode. # grep '~:S:' /etc/inittab If /sbin/sulogin is not listed, this is a finding.
Edit /etc/inittab and set sulogin to run in single-user mode. Example line in /etc/inittab: # what to do in single-user mode ls:S:wait:/etc/init.d/rc S ~~:S:respawn:/sbin/sulogin
Use the last command to check for multiple accesses to an account from different workstations/IP addresses. # last -R If users log directly onto accounts, rather than using the switch user (su) command from their own named account to access them, this is a finding (such as logging directly on to oracle). Verify with the SA or the IAO on documentation for users/administrators to log into their own accounts first and then switch user (su) to the account to be shared has been maintained including requirements and procedures. If no such documentation exists, this is a finding.
Use the switch user (su) command from a named account login to access shared accounts. Maintain audit trails to identify the actual user of the account name. Document requirements and procedures for users/administrators to log into their own accounts first and then switch user (su) to the account to be shared.
Check the system for duplicate account names. Example: # pwck -r If any duplicate account names are found, this is a finding.
Change user account names, or delete accounts, so each account has a unique name.
Perform the following to ensure there are no duplicate UIDs: # pwck -r If any duplicate UIDs are found, this is a finding.
Edit user accounts to provide unique UIDs for each account.
Access the system console and make a login attempt. Check for either of the following login banners based on the character limitations imposed by the system. An exact match is required. If one of these banners is not displayed, this is a finding. You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests- -not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details. OR I've read & consent to terms in IS user agreem't.
Edit /etc/issue and add one of the DoD login banners (based on the character limitations imposed by the system). DoD Login Banners: You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions: -The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. -At any time, the USG may inspect and seize data stored on this IS. -Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. -This IS includes security measures (e.g., authentication and access controls) to protect USG interests- -not for your personal benefit or privacy. -Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details. OR I've read & consent to terms in IS user agreem't.
Determine if all logon attempts are being logged. Procedure: Verify successful logins are being logged: # last -R | more If the command does not return successful logins, this is a finding. Verify if unsuccessful logons are being logged: # lastb -R | more If the command does not return unsuccessful logins, this is a finding.
Make sure the collection files exist. Procedure: If there are no successful logins being returned from the "last" command, create /var/log/wtmp: # touch /var/log/wtmp If there are no unsuccessful logins being returned from the "lastb" command, create /var/log/btmp: # touch /var/log/btmp
Check the pam_tally configuration. # more /etc/pam.d/login Confirm the following line is configured, before the "common-auth” file is included: auth required pam_tally.so deny=3 onerr=fail # more /etc/pam.d/sshd Confirm the following line is configured, before the "common-auth” file is included: auth required pam_tally.so deny=3 onerr=fail If no such line is found, this is a finding.
Edit /etc/pam.d/login and/or /etc/pam.d/sshd and add the following line, before the "common-auth" file is included: auth required pam_tally.so deny=3 onerr=fail
Check the value of the FAIL_DELAY variable and the ability to use it Procedure:. # grep FAIL_DELAY /etc/login.defs If the value does not exist, or is less than 4, this is a finding. Check for the use of pam_faildelay. # grep pam_faildelay /etc/pam.d/common-auth* If the pam_faildelay.so module is not listed, this is a finding.
Add the pam_faildelay module and set the FAIL_DELAY variable. Procedure: Edit /etc/login.defs and set the value of the FAIL_DELAY variable to 4 or more. Edit /etc/pam.d/common-auth and add a pam_faildelay entry if one does not exist, such as: auth optional pam_faildelay.so
If there is an application running on the system continuously in use (such as a network monitoring application), ask the SA what the name of the application is. Verify documentation exists for the requirement and justification of the application. If no documentation exists, this is a finding. Execute "ps -ef | more" to determine which user owns the process(es) associated with the application. If the owner is root, this is a finding.
Configure the system so the owner of a session requires a continuous screen display, such as a network management display, is not root. Ensure the display is also located in a secure, controlled access area. Document and justify this requirement and ensure the terminal and keyboard for the display (or workstation) are secure from all but authorized personnel by maintaining them in a secure area, in a locked cabinet where a swipe card, or other positive forms of identification, must be used to gain entry.
Verify the system will not log in accounts with blank passwords. # grep nullok /etc/pam.d/common-auth # grep nullok /etc/pam.d/common-account # grep nullok /etc/pam.d/common-password # grep nullok /etc/pam.d/common-session If an entry for nullok is found, this is a finding on Linux.
Edit /etc/pam.d/<configuration file> and remove the "nullok" setting. OR Use ‘pam-config’ to configure the affected module if it is supported by pam-config
Check the system for duplicate UID 0 assignments by listing all accounts assigned UID 0. Procedure: # cat /etc/passwd | awk -F":" '{print$1":"$3":"}' | grep ":0:" If any accounts other than root are assigned UID 0, this is a finding.
Remove or change the UID of accounts other than root that have UID 0.
Determine if root is assigned a home directory other than / by listing its home directory. Procedure: # grep "^root" /etc/passwd | awk -F":" '{print $6}' If the root user home directory is /, this is a finding.
The root home directory should be something other than / (such as /roothome). Procedure: # mkdir /rootdir # chown root /rootdir # chgrp root /rootdir # chmod 700 /rootdir # cp -r /.??* /rootdir/. Then, edit the passwd file and change the root home directory to /rootdir. The cp -r /.??* command copies all files and subdirectories of file names beginning with "." into the new root directory, which preserves the previous root environment. Ensure you are in the "/" directory when executing the "cp" command. _ OR Use the YaST ‘Security and Users’ > ‘User and Group Management’ module to update the home directory for root.
Check the mode of the root home directory. Procedure: # grep "^root" /etc/passwd | awk -F":" '{print $6}' # ls -ld <root home directory> If the mode of the directory is not equal to 0700, this is a finding. If the home directory is /, this check will be marked "Not Applicable".
The root home directory will have permissions of 0700. Do not change the protections of the / directory. Use the following command to change protections for the root home directory: # chmod 0700 /rootdir.
To view the root user's PATH, log in as the root user, and execute: # env | grep PATH OR # echo $PATH This variable is formatted as a colon-separated list of directories. If there is an empty entry, such as a leading or trailing colon, or two consecutive colons, this is a finding. If an entry starts with a character other than a slash (/), this is a finding. If directories beyond those in the vendor's default root path are present. This is a finding.
Edit the root user's local initialization files ~/.profile,~/.bashrc (assuming root shell is bash). Change any found PATH variable settings to the vendor's default path for the root user. Remove any empty path entries or references to relative paths.
Check for world-writable permissions on all directories in the root user's executable search path. Procedure: # ls -ld `echo $PATH | sed "s/:/ /g"` If any of the directories in the PATH variable are world-writable, this is a finding.
For each world-writable path in root's executable search path, do one of the following: 1. Remove the world-writable permission on the directory. Procedure: # chmod o-w <path> 2. Remove the world-writable directory from the executable search path. Procedure: Identify and edit the initialization file referencing the world-writable directory and remove it from the PATH variable.
Check /etc/securetty # more /etc/securetty If the file does not exist, or contains more than "console" or a single "tty" device this is a finding.
Create if needed and set the contents of /etc/securetty to a "console" or "tty" device. # echo console > /etc/securetty or # echo ttyS0 > /etc/securetty
Confirm all accounts with a GID of 499 and below are used by a system account. Procedure: List all the users with a GID of 0-499. # awk -F: '$4 <= 499 {printf "%15s:%4s\n", $1, $4}' /etc/passwd | sort -n -t: -k2 If a GID reserved for system accounts (0 - 499) is used by a non-system account, this is a finding.
Change the primary group GID numbers for non-system accounts with reserved primary group GIDs (those less or equal to 499).
Perform the following to ensure there are no GIDs referenced in /etc/passwd not defined in /etc/group: # pwck -r If GIDs referenced in /etc/passwd are not defined in /etc/group are returned, this is a finding.
Add a group to the system for each GID referenced without a corresponding group.
Ask the SA or IAO if a host-based intrusion detection application is loaded on the system. The preferred intrusion detection system is McAfee HBSS available through Cybercom. If another host-based intrusion detection application, such as SELinux, is used on the system, this is not a finding. Procedure: Examine the system to see if the Host Intrusion Prevention System (HIPS) is installed #rpm -qa | grep MFEhiplsm If the MFEhiplsm package is installed, HBSS is being used on the system. If another host-based intrusion detection system is loaded on the system # find / -name <daemon name> Where <daemon name> is the name of the primary application daemon to determine if the application is loaded on the system. Determine if the application is active on the system. Procedure: # ps -ef | grep <daemon name> If no host-based intrusion detection system is installed on the system, this is a finding.
Install a host-based intrusion detection tool.
Obtain the list of available package security updates from Novell. Check the available package updates have been installed on the system. Use the "rpm" command to list the packages installed on the system. Example: # rpm -qa --last If updated packages are available and applicable to the system and have not been installed, this is a finding.
Install the security patches or updated packages available from the vendor.
Check system directories for uneven file permissions. Procedure: # ls –lL /etc /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin Uneven file permissions exist if the file owner has less permissions than the group or other user classes. If any of the files in the above listed directories contain uneven file permissions, this is a finding.
Change the mode of files with uneven permissions so owners do not have less permission than group or world users.
Check the system for files with no assigned owner. Procedure: # find / -nouser If any files have no assigned owner, this is a finding. Caution should be used when centralized authorization is used because valid files may appear as unowned due to communication issues.
All directories and files (executable and data) will have an identifiable owner and group name. Either trace files to an authorized user, change the file’s owner to root, or delete them. Determine the legitimate owner of the files and use the chown command to set the owner and group to the correct value. If the legitimate owner cannot be determined, change the owner to root (but make sure none of the changed files remain executable because they could be Trojan horses or other malicious code). Examine the files to determine their origin and the reason for their lack of an owner/group.
Check the mode of network services daemons. # find /usr/sbin -type f -perm +022 -exec stat -c %a:%n {} \; This will return the octal permissions and name of all files that are group or world writable. If any network services daemon listed is world or group writable (either or both of the 2 lowest order digits contain a 2, 3 or 6), this is a finding. Note: Network daemons not residing in these directories (such as httpd or sshd) must also be checked for the correct permissions.
Change the mode of the network services daemon. # chmod go-w <path>
Check the mode of log files. Procedure: # ls -lL /var/log /var/log/syslog /var/adm With the exception of /var/log/wtmp, if any of the log files have modes more permissive than 0640, this is a finding.
Change the mode of the system log file(s) to 0640 or less permissive. Procedure: # chmod 0640 /path/to/system-log-file Note: Do not confuse system log files with audit logs.
Check skeleton files permissions. # ls -alL /etc/skel If a skeleton file has a mode more permissive than 0644, this is a finding.
Change the mode of skeleton files with incorrect mode: # chmod 0644 <skeleton file>
Perform the following to check NIS file ownership: # ls -la /var/yp/*; If the file ownership is not root, sys, or bin, this is a finding.
Change the ownership of NIS/NIS+/yp files to root, sys or bin. Procedure (example): # chown root <filename>
Perform the following to check the group ownership of NIS files: # ls -la /var/yp/* If the file group ownership is not root, sys, or bin, this is a finding.
Perform the following to change the group ownership of NIS files: # chgrp root /var/yp/*
Perform the following to check NIS file premissions. # ls -la /var/yp/*; If the file's mode is more permissive than 0755, this is a finding.
Change the mode of NIS/NIS+/yp command files to 0755 or less permissive. Procedure (example): # chmod 0755 <filename>
Check the mode of the manual page files. Procedure: # ls -lL /usr/share/man /usr/share/info /usr/share/man/man* If any of the manual page files have a mode more permissive than 0644, this is a finding.
Change the mode of manual page files to 0644 or less permissive. Procedure (example): # chmod 0644 /path/to/manpage
Check the mode of library files. Procedure: # DIRS="/usr/lib /usr/lib64 /lib /lib64";for DIR in $DIRS;do find $DIR -type f -perm +022 -exec stat -c %a:%n {} \;;done This will return the octal permissions and name of all group or world writable files. If any file listed is world or group writable (either or both of the 2 lowest order digits contain a 2, 3 or 6), this is a finding.
Change the mode of library files to 0755 or less permissive. Procedure (example): # chmod go-w </path/to/library-file> Note: Library files should have an extension of ".a" or a ".so" extension, possibly followed by a version number.
Check the permissions for files in /etc, /bin, /usr/bin, /usr/local/bin, /sbin, /usr/sbin and /usr/local/sbin. Procedure: # DIRS="/etc /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin";for DIR in $DIRS;do find $DIR -type f -perm +022 -exec stat -c %a:%n {} \;;done This will return the octal permissions and name of all group or world writable files. If any file listed is world or group writable (either or both of the 2 lowest order digits contain a 2, 3 or 6), this is a finding. Note: Elevate to Severity Code I if any file listed is world-writable.
Change the mode for system command files to 0755 or less permissive taking into account necessary GUID and SUID bits. Procedure: # chmod go-w <filename>
Check the ownership of system files, programs, and directories. Procedure: # ls -lLa /etc /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin If any of the system files, programs, or directories are not owned by a system account, this is a finding.
Change the owner of system files, programs, and directories to a system account. Procedure: # chown root /some/system/file (A different system user may be used in place of root.)
Check the group-ownership of system files, programs, and directories. Procedure: # ls –lLa /etc /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin If any system file, program, or directory is not owned by a system group, this is a finding.
Change the group-owner of system files to a system group. Procedure: # chgrp root /path/to/system/file (System groups other than root may be used.)
Check the ownership of the /etc/shadow file. # ls -lL /etc/shadow If the /etc/shadow file is not owned by root, this is a finding.
Change the ownership of the /etc/shadow (or equivalent) file. # chown root /etc/shadow
Check the mode of the /etc/passwd file. Procedure: # ls -lL /etc/passwd If /etc/passwd has a mode more permissive than 0644, this is a finding.
Change the mode of the passwd file to 0644. Procedure: # chmod 0644 /etc/passwd
Check the mode of the /etc/shadow file. # ls -lL /etc/shadow If the /etc/shadow file has a mode more permissive than 0400, this is a finding.
Change the mode of the /etc/shadow (or equivalent) file. # chmod 0400 /etc/shadow
If STIGID GEN000220 is satisfied, this is not a finding. List all setuid files on the system. Procedure: # find / -perm -4000 -exec ls -l {} \; | more Note: Executing these commands may result in large listings of files; the output may be redirected to a file for easier analysis. Ask the SA or IAO if files with the suid bit set have been documented. If any undocumented file has its suid bit set, this is a finding.
Document the files with the suid bit set or unset the suid bit on the executable.
List all setgid files on the system. Procedure: # find / -perm -2000 -exec ls -l {} \; | more Note: Executing these commands may result in large listings of files; the output may be redirected to a file for easier analysis. Ask the SA or IAO if files with the sgid bit set have been documented. If any undocumented file has its sgid bit set, this is a finding.
Document the files with the sgid bit set or unset the sgid bit on the executable.
Determine if a weekly automated or manual process is used to generate a list of suid files on the system and compare it with the prior list. If no such process is in place, this is a finding. NOTE: For MAC I systems, increase the frequency to daily.
Establish a weekly automated or manual process to generate a list of suid files on the system and compare it with the prior list. To create a list of suid files: # find / -perm -4000 > suid-file-list NOTE: For MAC I systems, increase the frequency to daily.
Determine if a weekly automated or manual process is used to generate a list of sgid files on the system and compare it with the prior list. If no such process is in place, this is a finding. NOTE: For MAC I systems, increase the frequency to daily.
Establish a weekly automated or manual process to generate a list of sgid files on the system and compare it with the prior list. To create a list of sgid files: # find / -perm -2000 > suid-file-list NOTE: For MAC I systems, increase the frequency to daily.
Check /etc/fstab and verify the "nosuid" mount option is used on file systems mounted from removable media, network shares, or any other file system not containing approved setuid or setgid files. If any of these files systems do not mount with the "nosuid" option, it is a finding.
Edit /etc/fstab and add the "nosuid" mount option to all file systems mounted from removable media or network shares, and any file system not containing approved setuid or setgid files.
Check all world-writable directories have the sticky bit set. Procedure: # find / -type d -perm -002 ! -perm -1000 > wwlist If the sticky bit is not set on a world-writable directory, this is a finding.
Set the sticky bit on all public directories. Procedure: # chmod 1777 /tmp (Replace /tmp with the public directory missing the sticky bit, if necessary.
Check the ownership of all public directories. Procedure: # find / -type d -perm -1002 -exec ls -ld {} \; If any public directory is not owned by root or an application user, this is a finding.
Change the owner of public directories to root or an application account. Procedure: # chown root /tmp (Replace root with an application user and/or /tmp with another public directory as necessary.)
Check global initialization files for the configured umask value. Procedure: # grep umask /etc/* Check local initialization files for the configured umask value. Procedure: # cut -d: -f6 /etc/passwd |xargs -n1 -IDIR find DIR -name ".*" -type f -maxdepth 1 -exec grep umask {} \; If the system and user default umask is not 077, this a finding. Note: If the default umask is 000 or allows for the creation of world-writable files this becomes a Severity Code I finding.
Edit local and global initialization files that contain "umask" and change them to use 077 instead of the current value.
Determine if default system accounts (such as those for sys, bin, uucp, nuucp, daemon, smtp) have been disabled. # cat /etc/shadow If an account's password field is "*", "*LK*", or is prefixed with a '!', the account is locked or disabled. If there are any unlocked default system accounts this is a finding.
Lock the default system account(s). # passwd -l <user>
Determine if auditing is enabled. # ps -ef |grep auditd If the auditd process is not found, this is a finding.
Start the auditd service and set it to start on boot. # service auditd start ; chkconfig auditd on
Perform the following to determine the location of audit logs and then check the ownership. Procedure: # (audit_log_file=$(grep "^log_file" /etc/audit/auditd.conf|sed s/^[^\/]*//) && if [ -f "${audit_log_file}" ] ; then printf "Log(s) found in "${audit_log_file%/*}":\n"; ls -l ${audit_log_file%/*}; else printf "audit log file(s) not found\n"; fi) If any audit log file is not owned by root, this is a finding.
Change the ownership of the audit log file(s). Procedure: # chown root <audit log file>
Perform the following to determine the location of audit logs and then check the mode of the files. Procedure: # grep "^log_file" /etc/audit/auditd.conf|sed s/^[^\/]*//|xargs stat -c %a:%n If any audit log file has a mode more permissive than 0640, this is a finding.
Change the mode of the audit log file(s). # chmod 0640 <audit log file>
Verify auditd is configured to audit failed file access attempts. There must be an audit rule for each of the access syscalls logging all failed accesses (-F success=0) or there must both an "-F exit=-EPERM" and "-F exit=-EACCES" for each access syscall. Procedure: # cat /etc/audit/audit.rules | grep -e "-a exit,always" | grep -e "-S creat" | grep -e "-F success=0" # cat /etc/audit/audit.rules | grep -e "-a exit,always" | grep -e "-S creat" | grep -e "-F exit=-EPERM" # cat /etc/audit/audit.rules | grep -e "-a exit,always" | grep -e "-S creat" | grep -e "-F exit=-EACCES" If an "-S creat" audit rule with "-F success" does not exist and no separate rules containing "-F exit=-EPERM" and "-F exit=-EACCES" for "creat" exist, then this is a finding.
Edit the audit.rules file and add the following line(s) to enable auditing of failed attempts to access files and programs: either: -a exit,always -F arch=<ARCH> -S creat -F success=0 or both: -a exit,always -F arch=<ARCH> -S creat -F exit=-EPERM -a exit,always -F arch=<ARCH> -S creat -S exit=-EACCES Restart the auditd service. # service auditd restart
Check the system audit configuration to determine if file and directory deletions are audited. # cat /etc/audit/audit.rules | grep -e "-a exit,always" | grep -i "unlink" If no results are returned, or the results do not contain "-S unlink", this is a finding.
Edit the audit.rules file and add the following line to enable auditing of deletions: -a exit,always -S unlink Restart the auditd service. # rcauditd restart OR# service auditd restart
Check the auditing configuration of the system. Procedure: # cat /etc/audit/audit.rules | grep -i "auditd.conf" If no results are returned, or the line does not start with "-w", this is a finding.
The "-F arch=<ARCH>"restriction is required on dual-architecture systems (such as x86_64). On dual-architecture systems, two separate rules must exist - one for each architecture supported. Use the generic architectures "b32" and "b64" for specifying these rules. On single architecture systems, the "-F arch=<ARCH>"restriction may be omitted, but if present must match either the architecture of the system or its corresponding generic architecture. The architecture of the system may be determined by running "uname -m". See the auditctl(8) manpage for additional details. Any restrictions (such as with "-F") beyond those provided in the example rules are not in strict compliance with this requirement, and are a finding unless justified and documented appropriately. The use of audit keys consistent with the provided example is encouraged to provide for uniform audit logs, however omitting the audit key or using an alternate audit key is not a finding. Procedure: Add the following lines to the audit.rules file to enable auditing of administrative, privileged, and security actions: -w /etc/audit/auditd.conf Restart the auditd service. # rcauditd restart OR # service auditd restart
The message types that are always recorded to /var/log/audit/audit.log include LOGIN,USER_LOGIN,USER_START,USER_END among others and do not need to be added to audit_rules. The log files /var/log/faillog and /var/log/lastlog must be protected from tampering of the login records. Procedure: # egrep "faillog|lastlog" /etc/audit/audit.rules|grep -e "-p (wa|aw)" If both /var/log/faillog and /var/log/lastlog entries do not exist, this is a finding.
Ensure logins Procedure: Modify /etc/audit/audit.rules to contain: -w /var/log/faillog -p wa -w /var/log/lastlog -p wa Restart the auditd service. # rcauditd restart OR # service auditd restart
Check the system's audit configuration. Procedure: # cat /etc/audit/audit.rules | grep -e "-a exit,always" | grep -i " chmod " If "-S chmod" is not in the result, this is a finding
The "-F arch=<ARCH>" restriction is required on dual-architecture systems (such as x86_64). On dual-architecture systems, two separate rules must exist - one for each architecture supported. Use the generic architectures "b32" and "b64" for specifying these rules. On single architecture systems, the "-F arch=<ARCH>" restriction may be omitted, but if present must match either the architecture of the system or its corresponding generic architecture. The architecture of the system may be determined by running "uname -m". See the auditctl(8) manpage for additional details. Any restrictions (such as with "-F") beyond those provided in the example rules are not in strict compliance with this requirement, and are a finding unless justified and documented appropriately. The use of audit keys consistent with the provided example is encouraged to provide for uniform audit logs, however omitting the audit key or using an alternate audit key is not a finding. Procedure: Edit the audit.rules file and add the following lines to enable auditing of discretionary access control permissions modifications. -a exit,always -F arch=<ARCH> -S chmod Restart the auditd service. # rcauditd restart OR # service auditd restart
Check the owner of the xinetd configuration files. Procedure: # ls -lL /etc/xinetd.conf # ls -laL /etc/xinetd.d This is a finding if any of the above files or directories are not owned by root or bin.
Change the owner of the xinetd configuration files. # chown root /etc/xinetd.conf /etc/xinetd.d/*
Check the mode of the xinetd configuration files. Procedure: # ls -lL /etc/xinetd.conf # ls -lL /etc/xinetd.d If the mode of the file(s) is more permissive than 0640, this is a finding.
Change the mode of the xinetd configuration files. # chmod 0640 /etc/xinetd.conf /etc/xinetd.d/*
Check the ownership of the services file. Procedure: # ls -lL /etc/services If the services file is not owned by root or bin, this is a finding.
Change the ownership of the services file to root or bin. Procedure: # chown root /etc/services
Check the mode of the services file. Procedure: # ls -lL /etc/services If the services file has a mode more permissive than 0644, this is a finding.
Change the mode of the services file to 0644 or less permissive. Procedure: # chmod 0644 /etc/services
Check global initialization files for the presence of "mesg -n" or "mesg n". Procedure: # grep "mesg" /etc/bash.bashrc /etc/csh.cshrc /etc/csh.login /etc/environment /etc/ksh.kshrc /etc/profile /etc/profile.d/* /etc/zshrc If no global initialization files contain "mesg -n" or "mesg n", this is a finding.
Edit /etc/profile or another global initialization script, and add the "mesg -n" command.
Look for the presence of a print service configuration file. Procedure: # find /etc -name hosts.lpd -print # find /etc -name Systems -print # find /etc -name printers.conf If none of the files are found, this check should be marked Not Applicable. Otherwise, examine the configuration file. Procedure: # more <print service file> Check for entries that contain a ‘+’ or ‘_’ character. If any are found, this is a finding. For the "cups" print service, verify remote host access is limited. # grep -i Listen /etc/cups/cupsd.conf The /etc/cups/cupsd.conf file must not contain a Listen *:<port> or equivalent line. If the network address of the "Listen" line is unrestricted. This is a finding. # grep -i "Allow From" /etc/cups/cupsd.conf The "Allow From" line within the "<Location />" element should limit access to the printers to @LOCAL and specific hosts. If the "Allow From" line contains "All" this is a finding.
Remove the '+' entries from the hosts.lpd (or equivalent) file. Configure cups to use only the localhost or specified remote hosts. Procedure: Modify the /etc/cups/cupsd.conf file to "Listen" only to the local machine or a known set of hosts (i.e., Listen localhost:631). Modify the /etc/cups/cupsd.conf file "<Location />" element to "Deny From All" and "Allow from 127.0.0.1" or allowed host addresses. Restart cups: # rccups restart
Check the ownership of the print service configuration file. Procedure: # find /etc -name hosts.lpd -print # find /etc -name Systems –print # find /etc –name printers.conf -print If no print service configuration file is found, this is not applicable. Check the ownership of the print service configuration file(s). # ls –lL <print service file> If the owner of the file is not root, this is a finding.
Change the owner of the /etc/hosts.lpd (or equivalent, such as /etc/lp/Systems) to root. Procedure: # chown root <print service file>
Locate any print service configuration file on the system. Consult vendor documentation for the name and location of print service configuration files. Procedure: # find /etc -name hosts.lpd -print # find /etc -name Systems –print # find /etc -name printers.conf -print Check the mode of the print service configuration file. # ls -lL <print service file> If no print service configuration file is found, this is not applicable. If the mode of the print service configuration file is more permissive than 0644, this is a finding.
Change the mode of the /etc/hosts.lpd file (or equivalent, such as /etc/lp/Systems) to 0644 or less permissive. Consult vendor documentation for the name and location of print service configuration files. Procedure: # chmod 0644 <print service file>
Check the ownership of the alias files. Procedure: for sendmail: # ls -lL /etc/aliases # ls -lL /etc/aliases.db If all the files are not owned by root, this is a finding. for postfix: Verify the location of the alias file. # postconf alias_maps This will return the location of the "aliases" file. # ls -lL <postfix aliases file> # ls -lL <postfix aliases.db file> If all the files are not owned by root, this is a finding.
Change the owner of the /etc/aliases file to root. Procedure: for sendmail: # chown root /etc/aliases # chown root /etc/aliases.db for postfix # chown root <postfix aliases file> # chown root <postfix aliases.db file>
Check the permissions of the alias file. Procedure: for sendmail: # ls -lL /etc/aliases /etc/aliases.db If an alias file has a mode more permissive than 0644, this is a finding. for postfix: Verify the location of the alias file. # postconf alias_maps This will return the location of the "aliases" file. # ls -lL <postfix aliases file> <postfix aliases.db file> If an alias file has a mode more permissive than 0644, this is a finding.
Change the mode of the alias files as needed to function. No higher than 0644. Procedure: for sendmail: # chmod 0644 /etc/aliases /etc/aliases.db for postfix: # chmod 0644 <postfix aliases file> <postfix aliases.db file>
Verify the ownership of files referenced within the sendmail aliases file. Procedure: # more /etc/aliases Examine the aliases file for any utilized directories or paths. # ls -lL <directory or file path> Check the owner for any paths referenced. Check if the file or parent directory is owned by root. If not, this is a finding.
Edit the /etc/aliases file (alternatively, /usr/lib/sendmail.cf). Locate the entries executing a program. They will appear similar to the following line: Aliasname: : /usr/local/bin/ls (or some other program name) Ensure root owns the programs and the directory(ies) they reside in by using the chown command to change owner to root. Procedure: # chown root <file or directory name>
If the “sendmail” package is not installed, this is not applicable. Examine the contents of the /etc/aliases file. Procedure: # more /etc/aliases Examine the aliases file for any utilized directories or paths. # ls -lL <file referenced from aliases> Check the permissions for any paths referenced. If any file referenced from the aliases file has a mode more permissive than 0755, this is a finding.
Use the chmod command to change the access permissions for files executed from the alias file. For example: # chmod 0755 filename.
If the “sendmail” package is not installed, this is not applicable. Check if the sendmail package is installed: # rpm –q sendmail If it is installed, the logging level must be set to level nine: Procedure: for sendmail: # grep "O L" /etc/mail/sendmail.cf OR # grep LogLevel /etc/mail/sendmail.cf If logging is set to less than nine, this is a finding. for Postfix: This rule is not applicable to postfix which does not use "log levels" in the same fashion as sendmail.
Edit the sendmail.conf file, locate the "O L" or "LogLevel" entry and change it to 9.
Check the syslog configuration file for mail.crit logging configuration. Procedure: # grep "mail\." /etc/rsyslog.conf If syslog is not configured to log critical sendmail messages ("mail.crit" or "mail.*"), this is a finding.
Edit the syslog configuration file and add a configuration line specifying an appropriate destination for "mail.crit" syslogs. For example: mail.* -/var/log/mail;RSYSLOG_TraditionalFileFormat
Locate any mail log files by checking the syslog configuration file. Procedure: # more /etc/rsyslog.conf The check procedure is the same for both sendmail and Postfix. Identify any log files configured for the "mail" service (excluding mail.none) at any severity level and check the ownership Procedure: # ls -lL <file location> If any mail log file is not owned by root, this is a finding.
Change the ownership of the sendmail log file. Procedure: The fix procedure is the same for both sendmail and Postfix. # chown root <sendmail log file>
Check the mode of the SMTP service log file. Procedure: # more /etc/rsyslog.conf Check the configuration to determine which log files contain logs for mail.crit, mail.debug, or *.crit. Procedure: # ls -lL <file location> The check procedure is the same for both sendmail and Postfix. Identify any log files configured for the "mail" service (excluding mail.none) at any severity level and check the permissions If the log file permissions are greater than 0644, this is a finding.
Change the mode of the SMTP service log file. Procedure: The fix procedure is the same for both sendmail and Postfix. # chmod 0644 <sendmail log file>
Check for the existence of the ftpusers file. Procedure: For gssftp: # ls -l /etc/ftpusers For vsftp: # ls -l /etc/vsftpd.ftpusers or # ls -l /etc/vsftpd/ftpusers If the appropriate ftpusers file for the running FTP service does not exist, this is a finding.
Create an ftpusers file appropriate for the running FTP service. For gssftp: Create an /etc/ftpusers file containing a list of accounts not authorized for FTP. For vsftp: Create an /etc/vfsftpd.ftpusers or /etc/vfsftpd/ftpusers (as appropriate) file containing a list of accounts not authorized for FTP.
Check the contents of the ftpusers file. For gssftp: # more /etc/ftpusers For vsftp: # more /etc/vsftpd.ftpusers /etc/vfsftpd/ftpusers If the system has accounts not allowed to use FTP and not listed in the ftpusers file, this is a finding.
For gssftp: Add accounts not allowed to use FTP to the /etc/ftpusers file. For vsftp: Add accounts not allowed to use FTP to the /etc/vfsftpd.ftpusers or /etc/vfsftpd/ftpusers file (as appropriate).
Check the ownership of the ftpusers file. Procedure: For gssftp: # ls -l /etc/ftpusers For vsftp: # ls -l /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers If the ftpusers file is not owned by root, this is a finding.
Change the owner of the ftpusers file to root. For gssftp: # chown root /etc/ftpusers For vsftp: # chown root /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers
Check the permissions of the ftpusers file. Procedure: For gssftp: # ls -l /etc/ftpusers For vsftp: # ls -l /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers If the ftpusers file has a mode more permissive than 0640, this is a finding.
Change the mode of the ftpusers file to 0640. Procedure: For gssftp: # chmod 0640 /etc/ftpusers For vsftp: # chmod 0640 /etc/vsftpd.ftpusers /etc/vsftpd/ftpusers
Find if logging is applied to the ftp daemon. The procedure depends on the implementation of ftpd used by the system. Procedures: For vsftpd: If vsftpd is started by xinetd: #grep vsftpd /etc/xinetd.d/* This will indicate the xinetd.d startup file #grep server_args <vsftpd xinetd.d startup file> This will indicate the vsftpd config file used when starting through xinetd. If the line is missing then "/etc/vsftpd.conf", the default config file, is used. #grep xferlog_enable <vsftpd config file> If "xferlog_enable" is missing or is not set to "yes", this is a finding. If vsftp is not started by xinetd: #grep xferlog_enable /etc/vsftpd.conf If "xferlog_enable" is missing or is not set to "yes", this is a finding. For gssftp: Find if the -l option will be applied when xinetd starts gssftp # grep server-args /etc/xinetd.d/gssftp If the line is missing or does not contain at least one -l, this is a finding.
Enable logging by changing ftpd startup or config files. Procedure: The procedure depends on the implementation of ftpd used by the system. For vsftpd: Ensure the server settings in "/etc/vsftpd.conf" (or other configuration file specified by the vaftpd xinetd.d startup file) contains: xferlog_enable = yes For gssftp: If the "disable" server setting is missing or set to "no" in "/etc/xinetd.d/gssftp" then ensure the server settings in "/etc/xinetd.d/gssftp" contains: server_args = -l The -l option may be added up to three times. Each -l will provide increasing verbosity on the log. Refer to the main page for ftpd for more information. For both if started using xinetd: If the "disable" server setting is missing or set to "no" in the /etc/xinetd.d startup file then ensure the server settings contains: log_on_success += DURATION USERID This will log the startup and shutdown of the daemon. log_on_failure += HOST USERID
Attempt to log into this host with a user name of anonymous and a password of guest (also try the password of guest@mail.com). If the logon is successful and the use of anonymous ftp has not been documented and approved by the IAO, this is a finding. Procedure: # ftp localhost Name: anonymous 530 Guest login not allowed on this machine.
Configure the FTP service to not permit anonymous logins.
# grep server_args /etc/xinetd.d/tftp If the "-s" parameter is not specified, this is a finding.
Edit /etc/xinetd.d/tftp file and specify the "-s" parameter in server_args.
Check the mode of the TFTP daemon. Procedure: # grep "server " /etc/xinetd.d/tftp # ls -lL <in.tftpd binary> If the mode of the file is more permissive than 0755, this is a finding.
Change the mode of the TFTP daemon. Procedure: # chmod 0755 <in.tftpd binary>
Check the /etc/passwd file to determine if TFTP is configured properly. Procedure: Check if TFTP if used. # grep disable /etc/xinetd.d/tftp If the file does not exist or the returned line indicates "yes", then this is not a finding. Otherwise, if the returned line indicates "no" then TFTP is enabled and must use a dedicated "tftp" user. # grep user /etc/xinetd.d/tftp If the returned line indicates a user other than the dedicated "tftp" user, this is a finding. # grep tftp /etc/passwd If a "tftp" user account does not exist and TFTP is active, this is a finding. Check the user shell for the "tftp" user. If it is not /bin/false or equivalent, this is a finding. Check the home directory assigned to the "tftp" user. If no home directory is set, or the directory specified is not dedicated to the use of the TFTP service, this is a finding.
Configure TFTP to use a dedicated "tftp" user. Procedure: Create a dedicated "tftp" user account if none exists. Assign a non-login shell to the "tftp" user account, such as /bin/false. Assign a home directory to the "tftp" user account. Edit /etc/xinetd.d/tftp to have "tftp" as the value of the "user" parameter.
Check if the ‘xorg-x11’ package is installed: # rpm –q xorg-x11 If the xorg-x11 package is not installed this finding does not apply. Check for .Xauthority or .xauth files being utilized by looking for such files in the home directory of a user. Procedure: Verify Xwindows is used on the system. # egrep "^x:5.*X11" /etc/inittab If no line is returned the boot process does not start Xwindows. If Xwindows is not configured to run, this rule is not applicable. Look for xauthority files in user home directory. # cd ~someuser # ls -la|egrep "(\.Xauthority|\.xauth) " If the .Xauthority or .xauth (followed by apparently random characters) files do not exist, ask the SA if the user is using Xwindows. If the user is utilizing Xwindows and none of these files exist, this is a finding.
The X Windows server package should not be needed on a System z virtual OE. It can be removed to close this finding: # rpm –e xorg-x11 If X Windows is required for some reason, ensure that the X Windows host is configured to write .Xauthority files into user home directories. Edit the Xaccess file. Ensure the line that writes the .Xauthority file is uncommented.
Perform the following to determine if NIS is active on the system: # ps -ef | grep ypbind If NIS is found active on the system, this is a finding.
Disable the use of NIS. Use as a replacement NIS+ or LDAP.
Use pwck to verify home directory assignments are present. # pwck If any user is not assigned a home directory, this is a finding.
Assign a home directory to any user without one. This can be accomplished using ‘/sbin/yast2 users’ > Edit > Details to modify the home directory of an existing user. Alternatively, the following command may be used: # usermod -d </home/directory> <username>
Use pwck to verify assigned home directories exist. # pwck If any user's assigned home directory does not exist, this is a finding.
If a user has no home directory, determine why. If possible, delete accounts without a home directory. If the account is valid, then create the home directory using the appropriate system administration utility or manually. For example: # /sbin/yast2 users (<select user> > Edit > Details) OR # mkdir </home/directory> # for i in $(ls -A /etc/skel); do cp -rp /etc/skel/$i </home/directory>; done # chown -R <user>:<group> </home/directory> Document all changes.
Check the home directory mode of each user in /etc/passwd. Procedure: # cut -d: -f6 /etc/passwd|sort|uniq|xargs -n1 ls -ld If a user home directory's mode is more permissive than 0750, this is a finding. Note: Application directories are allowed and may need 0755 permissions (or greater) for correct operation.
Change the mode of user home directories to 0750 or less permissive. Procedure (example): # chmod 0750 <home directory> Note: Application directories are allowed and may need 0755 permissions (or greater) for correct operation.
Check the ownership of each user home directory listed in the /etc/passwd file. Procedure: # cut -d : -f 6 /etc/passwd | xargs -n1 ls -ld If any user home directory is not owned by the assigned user, this is a finding.
Change the owner of a user's home directory to its assigned user. Procedure: # chown <user> <home directory>
Check the group ownership for each user in the /etc/passwd file. Procedure: # cut -d : -f 6 /etc/passwd | xargs -n1 ls -ld If any user home directory is not group-owned by the assigned user's primary group, this is a finding. Home directories for application accounts requiring different group ownership must be documented using site-defined procedures.
Change the group-owner for user home directories to the primary group of the assigned user. Procedure: Find the primary group of the user (GID) which is the fourth field of the user entry in /etc/passwd. # chgrp <GID> <user home directory> Document all changes.
Check the ownership of local initialization files. Procedure: # ls –a /<users home directory> | grep “^\.” | awk '{if ((!($1=="."))&&(!($1==".."))) print}' | xargs ls -ld If local initialization files are not owned by the home directory's user, this is a finding.
Change the ownership of the startup and login files in the user’s directory to the user or root, as appropriate. Examine each user’s home directory and verify all filenames beginning with “.” are owned by the owner of the directory or root. If they are not, use the chown command to change the owner to the user and research the reasons why the owners were not assigned as required. Procedure: # chown username .filename Document all changes.
Check the modes of local initialization files. Procedure: # for HOMEDIR in $(cut -d: -f6 /etc/passwd); do find ${HOMEDIR} ! -fstype nfs -type f -name '\.*' \( -perm -0002 -o -perm -0020 \); done If local initialization files are more permissive than 0740 or the .dt directory is more permissive than 0755 or the .dtprofile file is more permissive than 0755, this is a finding.
Ensure user startup files have permissions of 0740 or more restrictive. Examine each user’s home directory and verify all file names beginning with “.” have access permissions of 0740 or more restrictive. If they do not, use the chmod command to correct the vulnerability. Procedure: # chmod 0740 .filename Note: The period is part of the file name and is required. OR # for HOMEDIR in $(cut -d: -f6 /etc/passwd); do FILES=$(find ${HOMEDIR} ! -fstype nfs -type f -name '\.*' \( -perm -0002 -o -perm -0020 \) ); for INIFILE in ${FILES}; do chmod 600 ${INIFILE}; done; done
Check run control script modes. – # ls -lL /etc/rc* /etc/init.d If any run control script has a mode more permissive than 0755, this is a finding.
Ensure all system startup files have mode 0755 or less permissive. Examine the "rc" files, and all files in the rc1.d (rc2.d, and so on) directories, and in the /etc/init.d directory to ensure they are not world-writable. If they are world-writable, use the chmod command to correct the vulnerability and research why they are world-writable. Procedure: # chmod 755 <startup file>
Verify run control scripts' library search paths. # grep -r PATH /etc/rc* /etc/init.d This variable is formatted as a colon-separated list of directories. If there is an empty entry, such as a leading or trailing colon, or two consecutive colons, this is a finding. If an entry begins with a character other than a slash (/), this is a relative path, this is a finding.
Edit the run control script and remove the relative path entry from the executable search path variable.
Check the permissions on the files or scripts executed from system startup scripts to see if they are world-writable. Procedure: # more <startup script> # ls -lL <script or executable referenced by startup script> Alternatively, obtain a list of all world-writable files on the system and check system startup scripts to determine if any are referenced. Procedure: # find / -perm -0002 -type f | grep –v ‘^/proc’ > wwlist If any system startup script executes any file or script that is world-writable, this is a finding.
Remove the world-writable permission from programs or scripts executed by run control scripts. Procedure: # chmod o-w <program or script executed from run control script>
Check the system for the existence of any .netrc files. Procedure: # find / -name .netrc If any .netrc file exists, this is a finding.
Remove the .netrc file(s). Procedure: # find / -name .netrc # rm <.netrc file>
For each user in the /etc/passwd file, check for the presence of files and directories within the user's home directory not owned by the home directory owner. Procedure: # find /<usershomedirectory> ! -fstype nfs ! -user <username> ! \( -name .bashrc -o -name .bash_login -o -name .bash_logout -o -name .bash_profile -o -name .cshrc -o -name .kshrc -o -name .login -o -name .logout -o -name .profile -o -name .tcshrc -o -name .env -o -name .dtprofile -o -name .dispatch -o -name .emacs -o -name .exrc \) -exec ls -ld {} \; If user home directories contain files or directories not owned by the home directory owner, this is a finding.
Change the ownership of files and directories in user home directories to the owner of the home directory. Procedure: # chown accountowner filename
For each user in the /etc/passwd file, check for files and directories with a mode more permissive than 0750. Procedure: # find /<usershomedirectory> ! -fstype nfs ! \( -name .bashrc -o -name .bash_login -o -name .bash_logout -o -name .bash_profile -o -name .cshrc -o -name .kshrc -o -name .login -o -name .logout -o -name .profile -o -name .tcshrc -o -name .env -o -name .dtprofile -o -name .dispatch -o -name .emacs -o -name .exrc \) \( -perm -0001 -o -perm -0002 -o -perm -0004 -o -perm -0020 -o -perm -2000 -o -perm -4000 \) -exec ls -ld {} \; If user home directories contain files or directories more permissive than 0750, this is a finding.
Change the mode of files and directories within user home directories to 0750. Procedure: # chmod 0750 filename Document all changes.
Verify /etc/shells exists. # ls -l /etc/shells If the file does not exist, this is a finding.
Create a /etc/shells file containing a list of valid system shells. Consult vendor documentation for an appropriate list of system shells. Procedure: # echo "/bin/bash" >> /etc/shells # echo "/bin/csh" >> /etc/shells (Repeat as necessary for other shells.)
Confirm the login shells referenced in the /etc/passwd file are listed in the /etc/shells file. Procedure: # for USHELL in `cut -d: -f7 /etc/passwd`; do if [ $(grep -c "${USHELL}" /etc/shells) == 0 ]; then echo "${USHELL} not in /etc/shells"; fi; done The /usr/bin/false, /bin/false, /dev/null, /sbin/nologin, /bin/sync, /sbin/halt, /sbin/shutdown, (and equivalents), and sdshell will be considered valid shells for use in the /etc/passwd file, but will not be listed in the /etc/shells file. If a shell referenced in /etc/passwd is not listed in the shells file, excluding the above mentioned shells, this is a finding.
Use the YaST > Security and Users > User and Group Management module to change the default shell of any account in error to an acceptable shell. OR Use the "chsh" utility or edit the /etc/passwd file and correct the error by changing the default shell of the account in error to an acceptable shell name contained in the /etc/shells file.
Indications of inactive accounts are those that have no entries in the last log. Check the date in the last log to verify it is within the last 35 days or the maximum number of days set by the site if more restrictive. If an inactive account is not disabled via an entry in the password field in the /etc/passwd or /etc/shadow (or equivalent), check the /etc/passwd file to check if the account has a valid shell. If an inactive account is found not disabled, this is a finding. Procedure: Obtain a list of all active(not locked) accounts: # for ACCT in $(cut -d: -f1 /etc/passwd) do if [ "$(passwd -S ${ACCT}| awk '{print $2}')" != "LK" ] then lastlog -u ${ACCT} | awk '{ if(NR>1) printf "%-23s %3s %2s %4s\n", $1, $4, $5, $8}' fi done Obtain a list of all accounts that have logged in during the past 35 days: # lastlog -t 35 | awk '{if(NR>1) printf "%-23s %3s %2s %4s\n", $1, $4, $5, $8}’ Compare the results of the two commands. Any account listed by the first command that is not also listed by the second command has been inactive for 35 days.
All inactive accounts that have not been documented as exceptions will have /bin/false or /sbin/nologin as the default shell in the /etc/passwd file and have the password locked. Examine the user accounts using the lastlog command. Note the date of last login for each account. If any (other than system and application accounts) exceed 35 days or the maximum number of days set by the site, not to exceed 35 days, then lock the account and place a shell field of /bin/false or /sbin/nologin in the passwd file entry for the account. Procedure: # passwd -l <inactive_account> # chsh -s /bin/false <inactive_account>
Check the ownership of the system shells. # cat /etc/shells | xargs -n1 ls -l If any shell is not owned by root or bin, this is a finding.
Change the ownership of the shell with incorrect ownership. # chown root <shell>
If /etc/shells exists, check the group ownership of each shell referenced. # cat /etc/shells | xargs -n1 ls -l Otherwise, check any shells found on the system. # find / -name "*sh" | xargs -n1 ls -l If a shell has a mode more permissive than 0755, this is a finding.
Change the mode of the shell. # chmod 0755 <shell>
Check the system for an automated job, or check with the SA, to determine if the system is checked for extraneous device files on a weekly basis. If no automated or manual process is in place, this is a finding.
Establish a weekly automated or manual process to create a list of device files on the system and determine if any files have been added, moved, or deleted since the last list was generated. A list of device files can be generated with this command: # find / -type b -o -type c > device-file-list
Find all world-writable device files existing anywhere on the system. Procedure: # find / -perm -2 -a \( -type b -o -type c \) > devicelist Check the permissions on the directories above subdirectories containing device files. If any of the device files or their parent directories are world-writable, excepting device files specifically intended to be world-writable such as /dev/null, this is a finding.
Remove the world-writable permission from the device file(s). Procedure: # chmod o-w <device file> Document all changes.
Check the system for world-writable device files. Procedure: # find / -perm -2 -a \( -type b -o -type c \) -exec ls -ld {} \; If any device file(s) used for backup are writable by users other than root, this is a finding.
Use the chmod command to remove the world-writable bit from the backup device files. Procedure: # chmod o-w <back device filename> Document all changes.
Check the owner of the exports file. Example: # ls -lL /etc/exports If the export configuration file is not owned by root, this is a finding.
Change the owner of the exports file to root. Example: # chown root /etc/exports
# ls -lL /etc/exports If the file has a mode more permissive than 0644, this is a finding.
# chmod 0644 /etc/exports
Check if the nfs-kernel-server package is installed. It contains the exportfs command as well as the nfsserver process itself. # rpm –q nfs-kernel-server If the package is not installed, this check does not apply. If it is installed, check for NFS exported file systems. Procedure: # cat /etc/exports For each file system displayed, check the ownership. # ls -lLa <exported file system path> If the files and directories are not owned by root, this is a finding.
Change the ownership of exported file systems not owned by root. Procedure: # chown root <path>
Check if the nfs-kernel-server package is installed. It contains the exportfs command as well as the nfsserver process itself. # rpm –q nfs-kernel-server If the package is not installed, this check does not apply. If it is installed, check if the 'anonuid' and 'anongid' options are set correctly for exported file systems. List exported filesystems: # exportfs -v Each of the exported file systems should include an entry for the 'anonuid=' and 'anongid=' options set to "-1" or an equivalent (60001, 65534, or 65535). If appropriate values for 'anonuid' or 'anongid' are not set, this is a finding.
Edit "/etc/exports" and set the "anonuid=-1" and "anongid=-1" options for exports lacking it. Re-export the filesystems.
Check if the nfs-kernel-server package is installed. It contains the exportfs command as well as the nfsserver process itself. # rpm –q nfs-kernel-server If the package is not installed, this check does not apply. If it is installed, check the permissions on exported NFS file systems. Procedure: # exportfs -v If the exported file systems do not contain the ‘rw’ or ‘ro’ options specifying a list of hosts or networks, this is a finding.
Edit /etc/exports and add ro and/or rw options (as appropriate) specifying a list of hosts or networks which are permitted access. Re-export the file systems.
List the exports. # cat /etc/exports If any export contains "no_root_squash" or does not contain "root_squash" or "all_squash", this is a finding.
Edit the "/etc/exports" file and add "root_squash" (or "all_squash") and remove "no_root_squash".
Check the system for NFS mounts not using the "nosuid" option. Procedure: # mount -v | grep " type nfs " | egrep -v "nosuid" If the mounted file systems do not have the "nosuid" option, this is a finding.
Edit "/etc/fstab" and add the "nosuid" option for all NFS file systems. Remount the NFS file systems to make the change take effect.
The tcp_wrappers package is provided with the SLES mainframe distribution. Other access control programs may be available but will need to be checked manually. Determine if tcp_wrappers (i.e. TCPd) is installed. # rpm -qa | grep tcpd If no package is listed, this is a finding.
Install and configure the tcp_wrappers(i.e. tcpd) package.
The tcp_wrappers package (i.e. tcpd) is provided with the SLES mainframe distribution. Other access control programs may be available but will need to be checked manually. Normally, tcpd logs to the mail facility in "/etc/syslog.conf". Determine if syslog is configured to log events by tcpd. Procedure: # more /etc/syslog.conf Look for entries similar to the following: mail.debug /var/adm/maillog mail.none /var/adm/maillog mail.* /var/log/mail authpriv.info /var/log/messages The above entries would indicate mail alerts are being logged. If no entries for mail exist, then tcpd is not logging this is a finding. If an alternate access control program is used and it does not provide logging of access attempts, this is a finding.
Configure the access restriction program to log every access attempt. Ensure the implementation instructions for tcp_wrappers (i.e. tcpd) are followed so system access attempts are recorded to the system log files. If an alternate application is used, it must support this function.
Check for the existence of the cron.allow and cron.deny files. # ls -lL /etc/cron.allow # ls -lL /etc/cron.deny If neither file exists, this is a finding.
Create /etc/cron.allow and/or /etc/cron.deny with appropriate content.
Check mode of the cron.allow file. Procedure: # ls -lL /etc/cron.allow If the file has a mode more permissive than 0600, this is a finding.
Change the mode of the cron.allow file to 0600. Procedure: # chmod 0600 /etc/cron.allow
List all cronjobs on the system. Procedure: # ls /var/spool/cron /var/spool/cron/tabs # ls /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls /etc/cron*|grep -v deny If cron jobs exist under any of the above directories, use the following command to search for programs executed by cron: # more <cron job file> Perform a long listing of each program file found in the cron file to determine if the file is group-writable or world-writable. # ls -la <cron program file> If cron executes group-writable or world-writable files, this is a finding.
Remove the world-writable and group-writable permissions from the cron program file(s) identified. # chmod go-w <cron program file>
List all cronjobs on the system. Procedure: # ls /var/spool/cron /var/spool/cron/tabs # ls /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls /etc/cron*|grep -v deny If cron jobs exist under any of the above directories, use the following command to search for programs executed by at: # more <cron job file> Perform a long listing of each directory containing program files found in the cron file to determine if the directory is world-writable. # ls -ld <cron program directory> If cron executes programs in world-writable directories, this is a finding.
Remove the world-writable permission from the cron program directories identified. Procedure: # chmod o-w <cron program directory>
Check the mode of the crontab files. # ls -lL /etc/crontab /var/spool/cron/ /var/spool/cron/tabs/ If any crontab file has a mode more permissive than 0600, this is a finding.
Change the mode of the crontab files. # chmod 0600 /var/spool/cron/* /etc/cron.d/* /etc/crontab # chmod 0600 /etc/crontab /var/spool/cron/* /var/spool/cron/tabs/*
Check the mode of the crontab directories. Procedure: # ls -ld /var/spool/cron /var/spool/cron/tabs ls -ld /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls -ld /etc/cron*|grep -v deny If the mode of any of the crontab directories is more permissive than 0755, this is a finding.
Change the mode of the crontab directories. # chmod 0755 <crontab directory>
Check the owner of the crontab directories. Procedure: # ls -ld /var/spool/cron /var/spool/cron/tabs ls -ld /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls -ld /etc/cron*|grep -v deny If the owner of any of the crontab directories is not root or bin, this is a finding.
Change the mode of the crontab directories. # chown root <crontab directory>
Check the group owner of cron and crontab directories. Procedure: # ls -ld /var/spool/cron /var/spool/cron/tabs ls -ld /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls -ld /etc/cron*|grep -v deny If a directory is not group-owned by root, sys, bin, or cron, this is a finding.
Change the group owner of cron and crontab directories. # chgrp root <crontab directory>
By default, rsyslog includes configuration files found in the /etc/rsyslog.d directory. Check for the include directive” $IncludeConfig /etc/rsyslog.d/*.conf” in /etc/rsyslog.conf and then for the cron log configuration file. # grep rsyslog.d /etc/rsyslog.conf # grep cron /etc/rsyslog.d/*.conf OR # grep cron /etc/rsyslog.conf If cron logging is not configured, this is a finding. Check the configured cron log file found in the cron entry of /etc/syslog (normally /var/log/cron). # ls -lL /var/log/cron If this file does not exist, or is older than the last cron job, this is a finding.
Edit or create /etc/rsyslog.d/cron.conf and setup cron logging.
Check the mode of the cron log file. Procedure: Check the configured cron log file found in the cron entry of the rsyslog configuration (normally /var/log/cron). # grep cron /etc/rsyslog.conf /etc/rsyslog.d/*.conf # ls -lL /var/log/cron If the mode is more permissive than 0600, this is a finding.
Change the mode of the cron log file. # chmod 0600 /var/log/cron
If the “at” package is not installed, this is not applicable. Check for the existence of at.allow and at.deny files. # ls -lL /etc/at.allow # ls -lL /etc/at.deny If neither file exists, this is a finding.
Create at.allow and/or at.deny files containing appropriate lists of users to be allowed or denied access to the "at" daemon.
# more /etc/at.deny If the at.deny file exists and is empty, this is a finding.
Add appropriate users to the at.deny file, or remove the empty at.deny file if an at.allow file exists.
# more /etc/at.allow If default accounts (such as bin, sys, adm, and others) are listed in the at.allow file, this is a finding.
Remove the default accounts (such as bin, sys, adm, and others traditionally UID less than 500) from the at.allow file.
Check the mode of the at.allow file. # ls -lL /etc/at.allow If the at.allow file has a mode more permissive than 0600, this is a finding.
Change the mode of the at.allow file. # chmod 0600 /etc/at.allow
List the "at" jobs on the system. Procedure: # ls -la /var/spool/at /var/spool/atjobs For each "at" job file, determine which programs are executed. Procedure: # more <at job file> Check the each program executed by "at" for group- or world-writable permissions. Procedure: # ls -la <at program file> If "at" executes group or world-writable programs, this is a finding.
Remove group-write and world-write permissions from files executed by at jobs. Procedure: # chmod go-w <file>
List any "at" jobs on the system. Procedure: # ls /var/spool/at /var/spool/atjobs For each "at" job, determine which programs are executed by "at." Procedure: # more <at job file> Check the directory containing each program executed by "at" for world-writable permissions. Procedure: # ls -la <at program file directory> If "at" executes programs in world-writable directories, this is a finding.
Remove the world-writable permission from directories containing programs executed by "at". Procedure: # chmod o-w <at program directory>
Check the SNMP configuration for default passwords. Procedure: Examine the default install location /etc/snmp/snmpd.conf or: # find / -name snmpd.conf # more <snmpd.conf file> Identify any community names or user password configuration. If any community name or password is set to a default value such as "public", "private", "snmp-trap", or "password", or any value which does not meet DISA password requirements, this is a finding.
Change the default passwords. To change them, locate the file snmpd.conf. Edit the file. Locate the line system-group-read-community which has a default password of “public” and make the password something more secure and less guessable. Do the same for the lines reading system-group-write-community, read-community, write-community, trap and trap-community. Read the information in the file carefully. The trap is defining who to send traps to, for instance, by default. It is not a password, but the name of a host.
Check the mode of the SNMP daemon configuration file. Procedure: Examine the default install location /etc/snmp/snmpd.conf or: # find / -name snmpd.conf # ls -lL <snmpd.conf file> If the snmpd.conf file has a mode more permissive than 0600, this is a finding.
Change the mode of the SNMP daemon configuration file to 0600. Procedure: # chmod 0600 <snmpd.conf>
Check the modes for all Management Information Base (MIB) files on the system. Procedure: # find / -name *mib* -o -name *MIB* | xargs ls -lL Any file returned with a mode 0640 or less permissive is a finding.
Change the mode of MIB files to 0640. Procedure: # chmod 0640 <mib file>
Check the system for world-writable files. Procedure: # find / -perm -2 -a \( -type d -o -type f \) -exec ls -ld {} \; If any world-writable files are located, except those required for system operation such as /tmp and /dev/null, this is a finding.
Remove or change the mode for any world-writable file on the system not required to be world-writable. Procedure: # chmod o-w <file> Document all changes
The /etc/xinetd.conf file and each file in the /etc/xinetd.d directory file should be examined for the following: Procedure: log_type = SYSLOG authpriv log_on_success = HOST PID USERID EXIT log_on_failure = HOST USERID If xinetd is running and logging is not enabled, this is a finding.
Edit each file in the /etc/xinetd.d directory and the /etc/xinetd.conf file to contain: log_type = SYSLOG authpriv log_on_success = HOST PID USERID EXIT log_on_failure = HOST USERID The /etc/xinetd.conf file contains default values that will hold true for all services unless individually modified in the service's xinetd.d file.
# ps -ef | egrep "innd|nntpd" If an Internet Network News server is running, this is a finding.
Disable the INN server.
Check access configuration ownership: # ls -lL /etc/security/access.conf If this file exists and is not owned by root, this is a finding.
Follow the correct configuration parameters for access configuration file. Use the chown command to configure it properly. (for example: # chown root /etc/security/access.conf).
SWAT is a tool for configuring Samba and should only be found on a system with a requirement for Samba. If SWAT is used, it must be utilized with SSH to ensure a secure connection between the client and the server. Procedure: # grep -H "bin/swat" /etc/xinetd.d/*|cut -d: -f1 |xargs grep "only_from" If the value of the "only_from" line in the "xinetd.d" file which starts with "/usr/sbin/swat" does not contain "localhost" or the equivalent, this is a finding.
Disable SWAT or require that SWAT is only accessed via SSH. Procedure: If SWAT is required, but not at all times, disable it when it is not needed. Modify the /etc/xinetd.d file for "swat" to contain a "disable = yes" line. To access using SSH: Follow vendor configuration documentation to create an stunnel for SWAT.
Check the ownership of the /etc/samba/smb.conf file. Procedure: # ls -l /etc/samba/smb.conf If an smb.conf file is not owned by root, this is a finding.
Change the ownership of the smb.conf file. Procedure: # chown root smb.conf
Check the mode of the smb.conf file. Procedure: # ls -lL /etc/samba/smb.conf If the "smb.conf" has a mode more permissive than 0644, this is a finding.
Change the mode of the smb.conf file to 0644 or less permissive.
Check the ownership of the "smbpasswd" file. # ls -l /etc/samba/passdb.tdb /etc/samba/secrets.tdb If the "smbpasswd" file is not owned by root, this is a finding.
Use the chown command to configure the files maintained by smbpasswd. For instance: # chown root /etc/samba/passdb.tdb /etc/samba/secrets.tdb
Examine the "smb.conf" file. # more /etc/samba/smb.conf If the "hosts" option is not present to restrict access to a list of authorized hosts and networks, this is a finding.
Edit the "/etc/samba/smb.conf" file and set the "hosts" option to permit only authorized hosts to access Samba.
Check the minimum time period between password changes for each user account is 1 day. # cat /etc/shadow | cut -d ':' -f 4 | grep -v 1 If any results are returned, this is a finding.
Change the minimum time period between password changes for each user account to 1 day. # passwd -n 1 <user name>
Determine if root has logged in over an unencrypted network connection. First determine if root has logged in over a network. Procedure: # last | grep "^root " | egrep -v "reboot| |ttyS0" | more If root has logged in over the network, this is a finding.
Enable SSH on the system and authenticate with a userid/password that has “su” privileges to attain root access.
Determine if the SSH daemon is configured to permit root logins. Procedure: # grep -v "^#" /etc/ssh/sshd_config | grep -i permitrootlogin If the PermitRootLogin entry is not found or is not set to "no", this is a finding.
Edit the sshd_config file and set the PermitRootLogin option to "no".
Check access configuration group ownership: # ls -lL /etc/security/access.conf If this file exists and has a group-owner that is not a privileged user, this is a finding.
Use the chgrp command to ensure the group owner is root, sys, or bin. For example: # chgrp root /etc/security/access.conf
Check access configuration mode: # ls -lL /etc/security/access.conf If this file exists and has a mode more permissive than 0640, this is a finding.
Use the chmod command to set the permissions to 0640. (for example: # chmod 0640 /etc/security/access.conf
Check the group ownership of the "smb.conf" file. Procedure: # ls -lL /etc/samba/smb.conf If the "smb.conf" file is not group-owned by root, bin, sys, or system, this is a finding.
Change the group owner of the smb.conf file. Procedure: # chgrp root smb.conf
Check "smbpasswd" ownership: # ls -lL /etc/samba/passdb.tdb /etc/samba/secrets.tdb If the "smbpasswd" file is not group-owned by root, this is a finding.
Use the chgrp command to ensure that the group owner of the smbpasswd file is root. For instance: # chgrp root /etc/samba/passdb.tdb /etc/samba/secrets.tdb
Check the mode of files maintained using "smbpasswd". Procedure: # ls -lL /etc/samba/passdb.tdb /etc/samba/secrets.tdb If a "smbpasswd" maintained file has a mode more permissive than 0600, this is a finding.
Change the mode of the files maintained through smbpasswd to 0600. Procedure: # chmod 0600 /etc/samba/passdb.tdb /etc/samba/secrets.tdb
Determine if roots shell executable resides on a dedicated file system. Procedure: Find the location of the root users shell # grep "^root" /etc/passwd|cut -d: -f7|cut -d/ -f2 The result is the top level directory under / where the shell resides (ie. usr) Check if it is on a dedicated file system. # grep /<top level directory> /etc/fstab If /<top level directory> is on a dedicated file system, this is a finding.
Change the root account's shell to one present on the / file system. Procedure: Edit /etc/passwd and change the shell for the root account to one present on the / file system (such as /bin/sh, assuming /bin is not on a separate file system). If the system does not store shell configuration in the /etc/passwd file, consult vendor documentation for the correct procedure for the system.
# pam-config -q --pwhistory If the result is not’ password: remember=5’ or higher, then this is a finding. # ls /etc/security/opasswd If /etc/security/opasswd does not exist, then this is a finding. # grep password /etc/pam.d/common-password| grep pam_pwhistory.so | grep remember If the "remember" option in /etc/pam.d/common-password is not 5 or greater, this is a finding.
Create the password history file. # touch /etc/security/opasswd # chown root:root /etc/security/opasswd # chmod 0600 /etc/security/opasswd Configure pam to use password history. # pam-config -a --pwhistory # pam-config -a --pwhistory-remember=5
Check local initialization files for any executed world-writable programs or scripts and scripts executing from world writable directories. Procedure: For each home directory on the system make a list of files referenced within any local initialization script. Show the mode for each file and its parent directory. # FILES=".bashrc .bash_login .bash_logout .bash_profile .cshrc .kshrc .login .logout .profile .tcshrc .env .dtprofile .dispatch .emacs .exrc"; # for HOMEDIR in `cut -d: -f6 /etc/passwd|sort|uniq`;do for INIFILE in $FILES;do REFLIST=`egrep " [\"~]?/" ${HOMEDIR}/${INIFILE} 2>/dev/null|sed "s/.*\([~ \"]\/[\.0-9A-Za-z_\/\-]*\).*/\1/"`;for REFFILE in $REFLIST;do FULLREF=`echo $REFFILE|sed "s:\~:${HOMEDIR}:g"|sed "s:^\s*::g"`;dirname $FULLREF|xargs stat -c "dir:%a:%n";stat -c "file:%:%n" $FULLREF;done;done; done|sort|uniq If any local initialization file executes a world-writable program or script or a script from a world-writable directory, this is a finding.
Remove the world-writable permission of files referenced by local initialization scripts, or remove the references to these files in the local initialization scripts.
Check run control scripts' ownership. # ls -lL /etc/rc* /etc/init.d Alternatively: # find /etc -name "[SK][0-9]*"|xargs stat -L -c %U:%n If any run control script is not owned by root or bin, this is a finding.
Change the ownership of the run control script(s) with incorrect ownership. # find /etc -name "[SK][0-9]*"|xargs stat -L -c %U:%n|egrep -v "^root:"|cut -d: -f2|xargs chown root
Check run control scripts' group ownership. Procedure: # ls -lL /etc/rc* /etc/init.d Alternatively: # find /etc -name "[SK][0-9]*"|xargs stat -L -c %G:%n|egrep -v "^(root|sys|bin|other):" If any run control script is not group-owned by root, sys, bin, or other system groups, this is a finding.
Change the group ownership of the run control script(s) with incorrect group ownership. Procedure: # chgrp root <run control script> # find /etc -name "[SK][0-9]*"|xargs stat -L -c %G:%n|egrep -v "^(root|sys|bin|other):"|cut -d: -f2|xargs chgrp root
Determine the programs executed by system start-up files. Determine the ownership of the executed programs. # cat /etc/rc*/* /etc/init.d/* | more # ls -l <executed program> Alternatively: # for FILE in `egrep -r "/" /etc/rc.* /etc/init.d|awk '/^.*[^\/][0-9A-Za-z_\/]*/{print $2}'|egrep "^/"|sort|uniq`;do if [ -e $FILE ]; then stat -L -c '%U:%n' $FILE;fi;done This provides a list of files referenced by initialization scripts and their associated UIDs. If any file is run by an initialization file and is not owned by root, sys, bin, or in rare cases, an application account, this is a finding.
Change the ownership of the file executed from system startup scripts to root, bin, sys, or other. # chown root <executed file>
Check /etc/zipl.conf permissions: # ls –lL /etc/zipl.conf If /etc/zipl.conf has a mode more permissive than 0600, then this is a finding.
Change the mode of the zipl.conf file to 0600. # chmod 0600 /etc/zipl.conf
Perform the following to check for unnecessary privileged accounts: # grep "^shutdown" /etc/passwd # grep "^halt" /etc/passwd # grep "^reboot" /etc/passwd If any unnecessary privileged accounts exist this is a finding.
Remove any special privilege accounts, such as shutdown and halt, from the /etc/passwd and /etc/shadow files using the "userdel" or "system-config-users" commands.
Check the system for unnecessary user accounts. Procedure: # more /etc/passwd If any unnecessary accounts are found, this is a finding.
Remove all unnecessary accounts from the /etc/passwd file before connecting a system to the network. Other accounts that are associated with a service not in use should also be removed.
SUSE ships the InternetNewsDaemon (innd) news server. The file corresponding to "/etc/news/hosts.nntp" is "/etc/news/incoming.conf". Check the permissions for "/etc/news/incoming.conf". # ls -lL /etc/news/incoming.conf If "/etc/news/incoming.conf" has a mode more permissive than 0600, this is a finding.
Change the mode of the "/etc/news/incoming.conf" file to 0600. # chmod 0600 /etc/news/incoming/conf
SUSE ships the InternetNewsDaemon (innd) news server. The file that corresponds to "/etc/news/hosts.nntp.nolimit" is "/etc/news/innfeed.conf". Check the permissions for "/etc/news/innfeed.conf". # ls -lL /etc/news/innfeed.conf If "/etc/news/innfeed.conf" has a mode more permissive than 0600, this is a finding.
Change the mode of "/etc/news/innfeed.conf" to 0600. # chmod 0600 /etc/news/infeed.conf
Check the permissions for "/etc/news/readers.conf". # ls -lL /etc/news/readers.conf If /etc/news/readers.conf has a mode more permissive than 0600, this is a finding.
Change the mode of the /etc/news/readers.conf file to 0600. # chmod 0600 /etc/news/readers.conf
Check "/etc/news/passwd.nntp" permissions: # ls -lL /etc/news/passwd.nntp If "/etc/news/passwd.nntp" has a mode more permissive than 0600, this is a finding.
Change the mode of the "/etc/news/passwd.nntp" file. # chmod 0600 /etc/news/passwd.nntp
Check the ownership of the files in "/etc/news". Procedure: # ls -al /etc/news If any files are not owned by root or news, this is a finding.
Change the ownership of the files in "/etc/news" to root or news. Procedure: # chown root /etc/news/*
Check "/etc/news" files group ownership: Procedure: # ls -al /etc/news If "/etc/news" files are not group-owned by root or news, this is a finding.
Change the group-owner of the files in "/etc/news" to root or news. Procedure: # chgrp root /etc/news/*
Locate the sshd_config file: # more /etc/ssh/sshd_config Examine the file. If the variables 'Protocol 2,1’ or ‘Protocol 1’ are defined on a line without a leading comment, this is a finding.
Edit the sshd_config file and set the "Protocol" setting to "2". Restart the SSH daemon. # /sbin/service sshd restart
Check /etc/securetty # more /etc/securetty If the file does not exist, or contains more than "console" or a single "tty" device this is a finding.
Create if needed and set the contents of /etc/securetty to a "console" or "tty" device. # echo console > /etc/securetty or # echo ttyS0 > /etc/securetty
Check if NTP running: # ps -ef | egrep "xntpd|ntpd" Check if "ntpd -qg" is scheduled to run: # grep "ntpd -qg" /var/spool/cron/* # grep "ntpd -qg" /var/spool/cron/tabs/* # grep "ntpd -qg" /etc/cron.d/* # grep "ntpd -qg" /etc/cron.daily/* # grep "ntpd -qg" /etc/cron.hourly/* # grep "ntpd -qg" /etc/cron.monthly/* # grep "ntpd -qg" /etc/cron.weekly/* If NTP is running or "ntpd -qg" is found: # more /etc/ntp.conf Confirm the timeservers and peers or multicast client (as applicable) are local or authoritative U.S. DoD sources appropriate for the level of classification which the network operates. If a non-local/non-authoritative time-server is used, this is a finding.
Use an authoritative time server operated by the U.S. government. Ensure all systems in the facility feed from one or more local time servers feed from the authoritative time server.
Logging should be enabled for those types of file systems not turning on logging by default. Procedure: # mount JFS, VXFS, HFS, XFS, reiserfs, EXT3 and EXT4 all turn logging on by default and will not be a finding. The ZFS file system uses other mechanisms to provide for file system consistency, and will not be a finding. For other file systems types, if the root file system does not support journaling this is a finding. If the ‘nolog’ option is set on the root file system that does support journaling, this is a finding.
Implement file system journaling for the root file system, or use a file system with other mechanisms to ensure file system consistency. If the root file system supports journaling, enable it. If the file system does not support journaling or another mechanism to ensure file system consistency, a migration to a different file system will be necessary.
Check the system for a running Samba server. Procedure: # ps -ef |grep smbd If the Samba server is running, ask the SA if the Samba server is operationally required. If it is not, this is a finding.
If there is no functional need for Samba and the daemon is running, disable the daemon by killing the process ID as noted from the output of ps -ef |grep smbd. The samba package should also be removed or not installed if there is no functional requirement. Procedure: rpm -qa |grep samba This will show if "samba" is installed. Packages that start with “yast2-samba” are NOT part of the Samba software suite. To remove: rpm -e samba SuSEconfig
Check /etc/sysctl.conf ownership. # ls -lL /etc/sysctl.conf If /etc/sysctl.conf is not owned by root, this is a finding.
Use the chown command to change the owner of /etc/sysctl.conf to root: # chown root /etc/sysctl.conf
Check /etc/sysctl.conf group ownership: # ls -lL /etc/sysctl.conf If /etc/sysctl.conf is not group-owned by root, this is a finding.
Use the chgrp command to change the group owner of /etc/sysctl.conf to root: # chgrp root /etc/sysctl.conf
Check /etc/sysctl.conf permissions: # ls -lL /etc/sysctl.conf If /etc/sysctl.conf has a mode more permissive than 0600, this is a finding.
Use the chmod command to change the mode of the /etc/sysctl.conf file. # chmod 0600 /etc/sysctl.conf
Determine if an NFS server is running on the system by: # ps -ef |grep nfsd If an NFS server is running, confirm it is not configured with the insecure_locks option by: # exportfs -v The example below would be a finding: /misc/export speedy.example.com(rw,insecure_locks)
Remove the "insecure_locks" option from all NFS exports on the system.
Ensure the pam_console.so module is not configured in any files in /etc/pam.d by: # cd /etc/pam.d # grep pam_console.so * Or # ls –la /etc/security/console.perms If either the pam_console.so entry or the file /etc/security/console.perms is found then this is a finding.
Ensure PAM is not configured to grant sole access of administrative privileges to the first user logged in at the console. Remove the console.perms file if it exists: # rm /etc/security/console.perms
Check for any crontab entries that rotate audit logs. Procedure: # crontab -l If such a cron job is found, this is not a finding. Otherwise, query the SA. If there is a process automatically rotating audit logs, this is not a finding. If the SA manually rotates audit logs, this is a finding, because if the SA is not there, it will not be accomplished. If the audit output is not archived daily, to tape or disk, this is a finding. This can be ascertained by looking at the audit log directory and, if more than one file is there, or if the file does not have today’s date, this is a finding.
Configure a cron job or other automated process to rotate the audit logs on a daily basis.
Check the mode of the cron.deny file. # ls -lL /etc/cron.deny If the cron.deny file does not exist this is not a finding. If the cron.deny file exists and the mode is more permissive than 0600, this is a finding.
Change the mode of the cron.deny file. # chmod 0600 /etc/cron.deny
Determine if there are any crontabs by viewing a long listing of the directory. If there are crontabs, examine them to determine what cron jobs exist. Check for any programs specifying an umask more permissive than 077: Procedure: # ls -lL /var/spool/cron /var/spool/cron/tabs # ls -lL /etc/crontab /etc/cron.{d,daily,hourly,monthly,weekly} or # ls -lL /etc/cron.*|grep -v deny # cat <crontab file> # grep umask <cron program> If there are no cron jobs present, this vulnerability is not applicable. If any cron job contains an umask more permissive than 077, this is a finding.
Edit cron script files and modify the umask to 077.
# ls -lL /etc/cron.allow If the cron.allow file is not owned by root, sys, or bin, this is a finding.
# chown root /etc/cron.allow
Check the mode of the "at" directory. Procedure: # ls -ld /var/spool/at /var/spool/atjobs If the directory mode is more permissive than 0755, this is a finding.
Change the mode of the "at" directory to 0755. Procedure: # chmod 0755 <at directory>
Check the ownership of the "at" directory: Procedure: # ls -ld /var/spool/atjobs If the directory is not owned by root, bin, daemon, or at, this is a finding.
Change the owner of the "atjobs" directory to root, bin, daemon or at. Procedure: # chown <root|bin|daemon|at> <"atjobs" directory>
Determine what "at" jobs exist on the system. Procedure: # ls /var/spool/at /var/spool/atjobs If there are no "at" jobs present, this is not applicable. Determine if any of the "at" jobs or any scripts referenced execute the "umask" command. Check for any umask setting more permissive than 077. # grep umask <at job or referenced script> If any "at" job or referenced script sets umask to a value more permissive than 077, this is a finding.
Edit "at" jobs or referenced scripts to remove "umask" commands that set umask to a value less restrictive than 077.
# ls -lL /etc/at.allow If the at.allow file is not owned by root, sys, or bin, this is a finding.
Change the owner of the at.allow file. # chown root /etc/at.allow
# ls -lL /etc/at.deny If the at.deny file is not owned by root, sys, or bin, this is a finding.
Change the owner of the at.deny file. # chown root /etc/at.deny
# ls -lL /usr/sbin/traceroute If the traceroute command is not owned by root, this is a finding.
Change the owner of the traceroute command to root. Example: # chown root /usr/sbin/traceroute
Check the group ownership of the traceroute file. Procedure: # ls -lL /usr/sbin/traceroute If the traceroute command is not group-owned by root, sys, bin, or system, this is a finding.
Change the group-owner of the traceroute command to root. Procedure: # chgrp root /usr/sbin/traceroute
# ls -lL /usr/sbin/traceroute If the traceroute command has a mode more permissive than 0700, this is a finding.
Change the mode of the traceroute command. # chmod 0700 /usr/sbin/traceroute
Interview the SA to determine if a site-defined policy exists which requires administrative accounts to use web browsers only for local service administration. If a site-defined policy does not exist this is a finding.
Enforce a site-defined policy requiring administrative accounts use web browsers only for local service administration.
To check for the version of either sendmail or Postfix being displayed in the greeting: # telnet localhost 25 If a version number is displayed, this is a finding.
Ensure sendmail or Postfix has been configured to mask the version information. Procedure for sendmail: Edit the /etc/mail/sendmail.mc file to mask the veresion number by editing the line with "dnl" as follows: define(`confSMTP_LOGIN_MSG', ` Mail Server Ready ; $b')dnl rebuild the sendmail.cf file. for Postfix: Examine the "smtpd_banner" line of /etc/postfix/main.conf and remove any "$mail_version" entry on it or comment the entire "smtpd_banner" line to use the default value which does not display the version information.
Determine if sendmail is installed # rpm -qa | grep -i sendmail This check only applies to systems that have the sendmail package installed. Check forwarding capability from sendmail. Procedure: grep "0 ForwardPath" /etc/mail/sendmail.cf If the entry contains a file path, this is a finding. Search for any .forward in users home directories on the system by: # for pwline in `cut -d: -f1,6 /etc/passwd`; do homedir=`echo ${pwline}|cut -d: -f2`;username=`echo ${pwline} | cut -d: -f1`;echo $username `stat -c %n $homedir/.forward 2>/dev/null`; done|egrep "\.forward" If any users have a .forward file in their home directory, this is a finding.
Disable forwarding for sendmail and remove .forward files from the system Procedure: Edit the /etc/mail/sendmail.mc file to change the ForwardPath entry to a null path by adding the line define(`confFORWARD_PATH`,`') rebuild the sendmail.cf file. Remove all .forward files on the system # find / -name .forward -delete
Check the shell for the anonymous FTP account. Procedure: # grep "^ftp" /etc/passwd This is a finding if the seventh field is empty (the entry ends with a ':') or if the seventh field does not contain one of the following: /bin/false /dev/null /usr/bin/false /bin/true /sbin/nologin
Configure anonymous FTP accounts to use a non-functional shell. The Yast ‘Security and Users’ > ‘User and Group Management’ module can be used to configure the account. Or if necessary, edit the /etc/passwd file to remove any functioning shells associated with the ftp account and replace them with non-functioning shells, such as /bin/false.
For vsftp: The FTP anonymous user is, by default, chrooted to the ftp users home directory as defined in the /etc/passwd file. This is integral to the server and may not be disabled.
There is no fix associated with this vulnerability.
Ask the SA if this is an NMS server. If it is an NMS server, then ask what other applications run on it. If there is anything other than network management software and DBMS software used only for the storage and inquiry of NMS data, this is a finding.
Ensure only authorized software is loaded on a designated NMS server. Authorized software is limited to the NMS software itself, a database management system for the NMS server if necessary, and network management software.
Check /etc/rsyslog.conf ownership: # ls –lL /etc/rsyslog* If any rsyslog configuration file is not owned by root, this is a finding.
Use the chown command to set the owner to root. # chown root <rsyslog configuration file>
Check /etc/rsyslog.conf group ownership. Procedure: # ls -lL /etc/rsyslog* If any rsyslog.conf file is not group owned by root, sys, bin, or system, this is a finding.
Change the group-owner of the /etc/rsyslog.conf file to root, bin, sys, or system. Procedure: # chgrp root <rsyslog configuration file>
Examine the rsyslog.conf file for any references to remote log hosts. # grep -v "^#" /etc/rsyslog* | grep '@' # grep -v "^#" /etc/rsyslog.d/* | grep '@' Destination locations beginning with an '@' represent log hosts. If the log host name is a local alias such as "loghost", consult the /etc/hosts or other name databases as necessary to obtain the canonical name or address for the log host. Determine if the host referenced is a log host documented using site-defined procedures. If an undocumented log host is referenced, this is a finding.
Remove or document the referenced undocumented log host.
Check the system for an IPv4 default route Procedure: # netstat -r |grep default If a default route is not defined, this is a finding.
Set a default gateway for IPv4.
If the system is a VM host and acts as a router solely for the benefit of its client systems, then this rule is not applicable. Ask the SA if the system is a designated router. If it is not, this is not applicable. Check the system for non-routing network services. Procedure: # netstat -a | grep -i listen # ps -ef If non-routing services, including Web servers, file servers, DNS servers, or applications servers, but excluding management services such as SSH and SNMP, are running on the system, this is a finding.
Ensure only authorized software is loaded on a designated router. Authorized software will be limited to the most current version of routing protocols and SSH for system administration purposes.
If the system does not use NIS or NIS+, this is not applicable. Check if NIS or NIS+ is implemented using UDP. Procedure: # rpcinfo -p | grep yp | grep udp If NIS or NIS+ is implemented using UDP, this is a finding.
Configure the system to not use UDP for NIS and NIS+. Consult vendor documentation for the required procedure.
Locate and examine all r-commands access control files. Procedure: # find / -name .rhosts # more /<directorylocation>/.rhosts # find / -name .shosts # more /<directorylocation>/.shosts # find / -name hosts.equiv # more /<directorylocation>/hosts.equiv # find / -name shosts.equiv # more /<directorylocation>/shosts.equiv If any .rhosts, .shosts, hosts.equiv, or shosts.equiv file contains other than host-user pairs, this is a finding.
If possible, remove the .rhosts, .shosts, hosts.equiv, and shosts.equiv files. If the files are required, remove any content from the files except for necessary host-user pairs.
Procedure: # ls -l /etc/hosts.equiv # ls -l /etc/ssh/shosts.equiv # find / -name .rhosts # ls -al <home directory>/.rhosts # find / -name .shosts # ls -al <home directory>/.shosts # find / -name .netrc # ls -al <home directory>/.netrc If the .rhosts, .shosts, hosts.equiv, or shosts.equiv files have permissions greater than 600, then this is a finding. If the /etc/hosts.equiv, or /etc/ssh/shosts.equiv files are not owned by root, this is a finding. Any .rhosts, .shosts and .netrc files outside of home directories have no meaning and are not subject to this rule If the ~/.rhosts or ~/.shosts are not owned by the owner of the home directory where they are immediately located or by root, this is a finding.
Ensure the permission for these files is set to 600 or more restrictive and their owner is root or the same as the owner of the home directory in which they reside. Procedure: # chmod 600 /etc/hosts.equiv # chmod 600 /etc/ssh/shosts.equiv # chown root /etc/hosts.equiv # chown root /etc/ssh/shosts.equiv # find / -name .rhosts # chmod 600 /<home directory>/.rhosts # chown <home directory owner> <home directory>/.rhosts # find / -name .shosts # chmod 600 <directory location>/.shosts # chown <home directory owner> <home directory>/.shosts # find / -name .netrc # chmod 600 <directory location>/.netrc # chown <home directory owner> <home directory>/.netrc
# ls -lL /etc/cron.deny If the cron.deny file is not owned by root, sys, or bin, this is a finding.
# chown root /etc/cron.deny
Check to see if rshd is configured to run on startup. Procedure: # grep disable /etc/xinetd.d/rsh If /etc/xinetd.d/rsh exists and rsh is found to be enabled, this is a finding.
Edit /etc/xinetd.d/rsh and set "disable=yes".
# grep disable /etc/xinetd.d/rexec If the service file exists and is not disabled, this is a finding.
Edit /etc/xinetd.d/rexec and set "disable=yes"
Determine the version of the SMTP service software. Procedure: #rpm -q sendmail SUSE sendmail 8.14.3-50.20.1is the latest required version. If SUSE sendmail is installed and the version is not at least8.14.3.-50.20.1, this is a finding. #rpm -q postfix SUSE postfix-2.5.6-5.8.1 is the latest required version. If postfix is installed and the version is not at least2.5.6-5.8.1, this is a finding.
Obtain and install a newer version of the SMTP service software (sendmail or Postfix) fromNovell.
Check for an enabled "debug" command provided by the SMTP service. Procedure: # telnet localhost 25 debug If the command does not return a 500 error code of "command unrecognized", this is a finding. The SLES mainframe distribution ships with sendmail Version 8.14.3.-50.20.1 which is not vulnerable. This should never be a finding.
Obtain and install a newer version of the SMTP service software (sendmail or Postfix) fromNovell.
Check the SMTP service for an active "decode" command. Procedure: # telnet localhost 25 decode If the command does not return a 500 error code of "command unrecognized", this is a finding.
Disable mail aliases for decode and uudecode. If the /etc/aliases or /usr/lib/aliases (mail alias) file contains entries for these programs, remove them or disable them by placing “#” at the beginning of the line, and then executing the new aliases command. For more information on mail aliases, refer to the man page for aliases. Disabled aliases would be similar to these examples: # decode: |/usr/bin/uudecode # uudecode: |/usr/bin/uuencode -d
This vulnerability is applicable only to sendmail. If Postfix is the SMTP service for the system this will never be a finding. Procedure: Determine if EXPN is disabled. # grep -v "^#" /etc/mail/sendmail.cf |grep -i PrivacyOptions If nothing is returned or the returned line does not contain "noexpn", this is a finding.
Rebuild /etc/mail/sendmail.cf with the "noexpn" Privacy Flag set. Procedure: Edit /etc/mail/sendmail.mc resetting the Privacy Flags to the default: define('confPRIVACYFLAGS', 'authwarnings,novrfy,noexpn,restrictqrun')dnl Rebuild the sendmail.cf file with: # make -C /etc/mail Restart the sendmail service. # service sendmail restart
Determine if VRFY is disabled. Procedure: for sendmail: # telnet localhost 25 vrfy root If the command does not return a 500 error code of "command unrecognized", this is a finding. or: # grep -v "^#" /etc/mail/sendmail.cf |grep -i vrfy Verify the VRFY command is disabled with an entry in the sendmail.cf file. The entry could be any one of "Opnovrfy", "novrfy", or "goaway", which could also have other options included, such as "noexpn". The "goaway" argument encompasses many things, such as "novrfy" and "noexpn". If no setting to disable VRFY is found, this is a finding. For Postfix: Check if the VRFY command has been disabled: # postconf disable_vrfy_command If the command output is not “disable_vrfy_command = yes”, this is a finding.
For sendmail: Add the "novrfy" flag to your sendmail in /etc/mail/sendmail.cf. Procedure: Edit the definition of "confPRIVACY_FLAGS" in /etc/mail/sendmail.mc to include "novrfy". Rebuild the sendmail.cf file with: # make -C /etc/mail Restart the sendmail service. # service sendmail restart for Postfix: Use the postconf utility to disable the VRFY command: # postconf -ev disable_vrfy_command=yes Restart the postfix service: # rcpostfix restart
Log into the sendmail server with telnet and test the "wiz" commmand" Procedure: # telnet localhost 25 Trying 127.0.0.1... Connected to locahost.localdomain (127.0.0.1). Escape character ... Once the telnet greeting is complete type: wiz If you do not get a "Command unrecognized: " message, this is a finding.
If the WIZ command exists on sendmail then the version of sendmail is archaic and should be replaced with the latest version fromNovell. If the WIZ command is enabled on sendmail, it should be disabled by adding this line to the sendmail.cf configuration file (note that it must be typed in uppercase): OW* For the change to take effect, kill the sendmail process, refreeze the sendmail.cf file, and restart the sendmail process.