PRELINKING=noNext, run the following command to return binaries to a normal, non-prelinked state:
# /sbin/prelink -ua
gpgcheck=1
gpgcheck=1A value of
gpgcheck=0
gpgcheck=0A value of
# yum install aide
# /usr/sbin/aide --initBy default, the database will be written to the file
# cp /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gzTo initiate a manual check, run the following command:
# /usr/sbin/aide --checkIf this check produces any unexpected output, investigate.
05 4 * * * root /usr/sbin/aide --checkAIDE can be executed periodically through other means; this is merely one example.
# grep aide /etc/crontab
# rpm -qVaSee the man page for
# rpm -qf FILENAMENext, run the following command to reset its permissions to the correct values:
# rpm --setperms PACKAGENAME
# rpm -Va | grep '^.M'
# rpm -Va | grep '^..5'A "c" in the second column indicates that a file is a configuration file, which may appropriately be expected to change. If the file was not expected to change, investigate the cause of the change using audit logs or other means. The package can then be reinstalled to restore the file. Run the following command to determine which package owns the file:
# rpm -qf FILENAMEThe package can be reinstalled from a yum repository using the command:
yum reinstall PACKAGENAMEAlternatively, the package can be reinstalled from trusted media using the command:
rpm -Uvh PACKAGENAME
# rpm -Va | awk '$1 ~ /..5/ && $2 != "c"'
# /etc/init.d/nails status
# cd /opt/NAI/LinuxShield/engine/dat # ls -la avvscan.dat avvnames.dat avvclean.dat
/lib /lib64 /usr/lib /usr/lib64Kernel modules, which can be added to the kernel during runtime, are stored in
# chmod go-w FILE
/lib /lib64 /usr/lib /usr/lib64Kernel modules, which can be added to the kernel during runtime, are also stored in
# chown root FILE
/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbinAll files in these directories should not be group-writable or world-writable. If any file FILE in these directories is found to be group-writable or world-writable, correct its permission with the following command:
# chmod go-w FILE
/bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbinAll files in these directories should be owned by the
# chown root FILE
echo > /etc/securetty
cat /etc/securettyIf any output is returned, this is a finding.
vc/1 vc/2 vc/3 vc/4
# grep ^vc/[0-9] /etc/securettyIf any output is returned, then root logins over virtual console devices is permitted.
ttyS0 ttyS1
# grep ^ttyS/[0-9] /etc/securettyIf any output is returned, then root login over serial ports is permitted.
# usermod -s /sbin/nologin SYSACCT
$ awk -F: '{print $1 ":" $3 ":" $7}' /etc/passwdIdentify the system accounts from this listing. These will primarily be the accounts with UID numbers less than 500, other than root.
# awk -F: '($3 == "0") {print}' /etc/passwdThis should print only one line, for the user root.
~/.profile
~/.bashrcChange any
# env | grep PATHIf correctly configured, the
# grep nullok /etc/pam.d/system-authIf this produces any output, it may be possible to log into accounts with empty passwords.
# awk -F: '($2 != "x") {print}' /etc/passwdIf it produces any output, then a password hash is stored in
# pwck -qrThere should be no output.
# find /home -xdev -name .netrc
# chage -M 180 -m 7 -W 7 USER
PASS_MIN_LEN LENGTHand correct it to have the form of:
PASS_MIN_LEN
$ grep PASS_MIN_LEN /etc/login.defsPasswords of length
PASS_MIN_DAYS DAYSand correct it to have the form of:
PASS_MIN_DAYS
$ grep PASS_MIN_DAYS /etc/login.defsA value greater than 1 day is considered to be sufficient for many environments.
PASS_MAX_DAYS DAYSand correct it to have the form of:
PASS_MAX_DAYS
$ grep PASS_MAX_DAYS /etc/login.defsA value less than 180 days is sufficient for many environments.
PASS_WARN_AGE DAYSand correct it to have the form of:
PASS_WARN_AGE
$ grep PASS_WARN_AGE /etc/login.defsA value of 7 days would be nowadays considered to be a standard.
$ sudo ls -lL /boot/grub2/grub.cfgIf properly configured, the output should indicate the following permissions:
$ grub2-mkpasswd-pbkdf2When prompted, enter the password that was selected and insert the returned password hash into the appropriate grub2 configuration file(s) under
password_pbkdf2 superusers-account password-hashNOTE: It is recommended not to use common administrator account names like root, admin, or administrator for the grub2 superuser account.
grub2-mkconfig -o /boot/grub2/grub.cfgNOTE: Do NOT manually add the superuser account and password to the
sudo grep -A1 "superusers\|password" /etc/grub2.cfgThe output should show the following:
set superusers="superusers-account" password_pbkdf2 superusers-account password-hash
SINGLE=/sbin/sulogin
$ grep SINGLE /etc/sysconfig/initThe output should be the following:
SINGLE=/sbin/sulogin
exec /sbin/shutdown -r now "Control-Alt-Delete pressed"
exec /usr/bin/logger -p security.info "Control-Alt-Delete pressed"
exec /usr/bin/logger -p security.info "Control-Alt-Delete pressed"
PROMPT=noThe
$ grep PROMPT /etc/sysconfig/initIf interactive boot is disabled, the output will show:
PROMPT=no
# gconftool-2 \ --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type int \ --set /apps/gnome-screensaver/idle_delay 15
$ gconftool-2 -g /apps/gnome-screensaver/idle_delayIf properly configured, the output should be
# gconftool-2 --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type bool \ --set /apps/gnome-screensaver/idle_activation_enabled true
$ gconftool-2 -g /apps/gnome-screensaver/idle_activation_enabledIf properly configured, the output should be
# gconftool-2 --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type bool \ --set /apps/gnome-screensaver/lock_enabled true
$ gconftool-2 -g /apps/gnome-screensaver/lock_enabledIf properly configured, the output should be
# gconftool-2 --direct \ --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \ --type string \ --set /apps/gnome-screensaver/mode blank-only
$ gconftool-2 -g /apps/gnome-screensaver/modeIf properly configured, the output should be
# yum install screenInstruct users to begin new terminal sessions with the following command:
$ screenThe console can now be locked with the following key combination:
ctrl+a x
server ntpserverThis instructs the NTP software to contact that remote server to obtain time data.
PermitRootLogin no
PermitEmptyPasswords noAny accounts with empty passwords should be disabled immediately, and PAM configuration should prevent users from being able to assign themselves empty passwords.
ClientAliveInterval INTERVALand correct it to have the form of:
ClientAliveIntervalThe timeout INTERVAL is given in seconds. To have a timeout of 15 minutes, set INTERVAL to 900.
ClientAliveCountMax 0
# yum install vsftpd
xferlog_enable=YES xferlog_std_format=NO log_ftp_protocol=YES
# grep vsftpd /etc/xinetd.d/*
# grep server_args vsftpd xinetd.d startup fileThis will indicate the vsftpd config file used when starting through xinetd. If the server_args line is missing or does not include the vsftpd configuration file, then the default config file (/etc/vsftpd/vsftpd.conf) is used.
# grep xferlog_enable vsftpd config file
banner_file=/etc/issue
grep "banner_file" /etc/vsftpd/vsftpd.confThe output should show the value of
# grep "banner_file" /etc/vsftpd/vsftpd.conf banner_file=/etc/issue
local_enable=NOIf non-anonymous FTP logins are necessary, follow the guidance in the remainder of this section to secure these logins as much as possible.
userlist_enable=YES userlist_file=/etc/vsftp.ftpusers userlist_deny=NOEdit the file
USERNAMEIf anonymous access is also required, add the anonymous usernames to
anonymous ftp
write_enable=NOIf FTP uploads are necessary, follow the guidance in the remainder of this section to secure these transactions as much as possible.
IPTABLES_MODULES="ip_conntrack_ftp"
# service snmpd restart
# grep 'rocommunity\|rwcommunity\|com2sec' /etc/snmp/snmpd.conf | grep -v "^#"There should be no output.
# service snmpd restart
# grep -v "^#" /etc/snmp/snmpd.conf| grep publicThere should be no output.
# mount -t nfs,nfs4,smbfs,cifs,ncpfsIf the command did not return any output then disable netfs.
LOCKD_TCPPORT=lockd-portWhere
LOCKD_UDPPORT=lockd-portWhere
STATD_PORT=statd-portWhere
MOUNTD_PORT=statd-portWhere
anonuid=-1 anongid=-1
$ service nfs statusIf the service is stopped or disabled, it will return the following:
rpc.svcgssd is stopped rpc.mountd is stopped nfsd is stopped rpc.rquotad is stoppedTo verify that the
$ chkconfig --list nfsIf properly configured, the output should look like:
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
$ mount | grep nfsAll NFS mounts should show the
$ mount | grep nfsAll NFS mounts should show the
/DIR host1(opt1,opt2) host2(opt3)where
# grep insecure_locks /etc/exports