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
At the command line, run the following command: # auditctl -l | grep -E "(useradd|groupadd)" Expected result: -w /usr/sbin/useradd -p x -k useradd -w /usr/sbin/groupadd -p x -k groupadd If either "useradd" or "groupadd" are not listed with a permissions filter of at least "x", this is a finding. Note: This check depends on the "auditd" service to be in a running state for accurate results. The "auditd" service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add or update the following lines: -w /usr/sbin/useradd -p x -k useradd -w /usr/sbin/groupadd -p x -k groupadd At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist and may reference older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following commands: # grep pam_tally2 /etc/pam.d/system-auth Expected result: auth required pam_tally2.so deny=3 onerr=fail audit even_deny_root unlock_time=900 root_unlock_time=300 # grep pam_tally2 /etc/pam.d/system-account Expected result: account required pam_tally2.so onerr=fail audit If the output does not list the "pam_tally2" options as configured in the expected results, this is a finding.
Navigate to and open: /etc/pam.d/system-auth Remove any existing "pam_tally2.so" line and add the following line after the "pam_unix.so" statement: auth required pam_tally2.so deny=3 onerr=fail audit even_deny_root unlock_time=900 root_unlock_time=300 Navigate to and open: /etc/pam.d/system-account Remove any existing "pam_tally2.so" line and add the following line after the "pam_unix.so" statement: account required pam_tally2.so onerr=fail audit Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # sshd -T|&grep -i Banner Expected result: banner /etc/issue If the output does not match the expected result, this is a finding. Open "/etc/issue" with a text editor. If the file does not contain the Standard Mandatory DOD Notice and Consent Banner, this is a finding. Standard Mandatory DOD Notice and Consent Banner: "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."
Navigate to and open: /etc/ssh/sshd_config Ensure the "Banner" line is uncommented and set to the following: Banner /etc/issue Navigate to and open: /etc/issue Ensure the file contains the Standard Mandatory DOD Notice and Consent Banner. "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." At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # grep "^[^#].*maxlogins.*" /etc/security/limits.conf Expected result: * hard maxlogins 10 If the output does not match the expected result, this is a finding. Note: The expected result may be repeated multiple times.
At the command line, run the following command: # echo '* hard maxlogins 10' >> /etc/security/limits.conf
At the command line, run the following command: # cat /etc/profile.d/tmout.sh Expected result: TMOUT=900 readonly TMOUT export TMOUT mesg n 2>/dev/null If the file "tmout.sh" does not exist or the output does not look like the expected result, this is a finding.
Navigate to and open: /etc/profile.d/tmout.sh Set its content to the following: TMOUT=900 readonly TMOUT export TMOUT mesg n 2>/dev/null
At the command line, run the following command: # sshd -T|&grep -i SyslogFacility Expected result: syslogfacility AUTHPRIV If there is no output or if the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "SyslogFacility" line is uncommented and set to the following: SyslogFacility AUTHPRIV At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # grep "^authpriv" /etc/rsyslog.conf Expected result should be similar to the following: authpriv.* /var/log/auth.log If "authpriv" is not configured to be logged, this is a finding.
Navigate to and open: /etc/rsyslog.conf Add the following line: authpriv.* /var/log/auth.log Note: The path can be substituted for another suitable log destination. At the command line, run the following command: # systemctl restart rsyslog.service
At the command line, run the following command: # sshd -T|&grep -i LogLevel Expected result: LogLevel INFO If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "LogLevel" line is uncommented and set to the following: LogLevel INFO At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i FipsMode Expected result: FipsMode yes If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "FipsMode" line is uncommented and set to the following: FipsMode yes At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # grep "^write_logs" /etc/audit/auditd.conf Expected result: write_logs = yes If there is no output, this is not a finding. If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the "write_logs" line is uncommented and set to the following: write_logs = yes At the command line, run the following command: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # grep "^log_format" /etc/audit/auditd.conf Expected result: log_format = RAW If there is no output, this is not a finding. If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the "log_format" line is uncommented and set to the following: log_format = RAW At the command line, run the following command: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # auditctl -l | grep execve Expected result: -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -F key=execpriv -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -F key=execpriv -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -F key=execpriv -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -F key=execpriv If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. Enabling the auditd service is done in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -a always,exit -F arch=b32 -S execve -C uid!=euid -F euid=0 -F key=execpriv -a always,exit -F arch=b64 -S execve -C uid!=euid -F euid=0 -F key=execpriv -a always,exit -F arch=b32 -S execve -C gid!=egid -F egid=0 -F key=execpriv -a always,exit -F arch=b64 -S execve -C gid!=egid -F egid=0 -F key=execpriv At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # systemctl status auditd If the service is not running, this is a finding.
At the command line, run the following commands: # systemctl enable auditd # systemctl start auditd
At the command line, run the following command: # grep "^space_left_action" /etc/audit/auditd.conf Expected result: space_left_action = SYSLOG If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the "space_left_action" line is uncommented and set to the following: space_left_action = SYSLOG At the command line, run the following commands: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # grep -E "^disk_full_action|^disk_error_action|^admin_space_left_action" /etc/audit/auditd.conf If any of the above parameters are not set to "SYSLOG" or are missing, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the following lines are present, not duplicated, and not commented: disk_full_action = SYSLOG disk_error_action = SYSLOG admin_space_left_action = SYSLOG At the command line, run the following commands: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # (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"; stat -c "%n permissions are %a" ${audit_log_file%}*; else printf "audit log file(s) not found\n"; fi) If the permissions on any audit log file are more permissive than "0600", this is a finding.
At the command line, run the following command: # chmod 0600 <audit log file> Replace <audit log file> with the log files more permissive than 0600.
At the command line, run the following command: # (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"; stat -c "%n is owned by %U" ${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.
At the command line, run the following command: # chown root:root <audit log file> Replace <audit log file> with the log files not owned by root.
At the command line, run the following command: # (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"; stat -c "%n is group owned by %G" ${audit_log_file%}*; else printf "audit log file(s) not found\n"; fi) If any audit log file is not group owned by root, this is a finding.
At the command line, run the following command: # chown root:root <audit log file> Replace <audit log file> with the log files not group owned by root.
At the command line, run the following command: # find /etc/audit/* -type f -exec stat -c "%n permissions are %a" {} $1\; If the permissions of any files are more permissive than "640", this is a finding.
At the command line, run the following command: # chmod 640 <file> Replace <file> with any file with incorrect permissions.
At the command line, run the following command: # auditctl -l | grep chmod Expected result: -a always,exit -F arch=b64 -S chmod,fchmod,chown,fchown,fchownat,fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod -a always,exit -F arch=b64 -S chmod,fchmod,chown,fchown,lchown,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr,fchownat,fchmodat -F key=perm_mod -a always,exit -F arch=b32 -S chmod,fchmod,fchown,chown,fchownat,fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod -a always,exit -F arch=b32 -S chmod,lchown,fchmod,fchown,chown,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr,fchownat,fchmodat -F key=perm_mod If the output does not match the expected result, this is a finding. Note: The auid!= parameter may display as 4294967295 or -1, which are equivalent. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -a always,exit -F arch=b64 -S chmod,fchmod,chown,fchown,fchownat,fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod -a always,exit -F arch=b64 -S chmod,fchmod,chown,fchown,lchown,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr,fchownat,fchmodat -F key=perm_mod -a always,exit -F arch=b32 -S chmod,fchmod,fchown,chown,fchownat,fchmodat -F auid>=1000 -F auid!=4294967295 -F key=perm_mod -a always,exit -F arch=b32 -S chmod,lchown,fchmod,fchown,chown,setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr,fchownat,fchmodat -F key=perm_mod At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "ucredit=.." Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include ucredit= <= -1, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "lcredit=.." Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include lcredit= <= -1, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "dcredit=.." Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include dcredit= <= -1, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "difok=." Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include difok >= 4, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep SHA512 /etc/login.defs|grep -v "#" Expected result: ENCRYPT_METHOD SHA512 If there is no output or if the output does match the expected result, this is a finding.
Navigate to and open: /etc/login.defs Add or replace the ENCRYPT_METHOD line as follows: ENCRYPT_METHOD SHA512
At the command line, run the following command: # rpm -qa|grep openssh If there is no output or openssh is not >= version 7.4, this is a finding.
Installing openssh manually is not supported by VMware for appliances. Revert to a previous backup or redeploy the appliance.
At the command line, run the following command: # grep "^PASS_MIN_DAYS" /etc/login.defs If "PASS_MIN_DAYS" is not set to "1", this is a finding.
Navigate to and open: /etc/login.defs Modify the "PASS_MIN_DAYS" line to the following: PASS_MIN_DAYS 1
At the command line, run the following command: # grep "^PASS_MAX_DAYS" /etc/login.defs If the value of "PASS_MAX_DAYS" is greater than "90", this is a finding.
Navigate to and open: /etc/login.def Modify the "PASS_MAX_DAYS" line to the following: PASS_MAX_DAYS 90
At the command line, run the following command: # grep pam_pwhistory /etc/pam.d/system-password|grep --color=always "remember=." Expected result: password requisite pam_pwhistory.so enforce_for_root use_authtok remember=5 retry=3 If the output does not include the "remember=5" setting as shown in the expected result, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following line after the "password requisite pam_cracklib.so" statement: password requisite pam_pwhistory.so enforce_for_root use_authtok remember=5 retry=3 Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "minlen=.." Example result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include minlen >= 8, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep -i ^password_pbkdf2 /boot/grub2/grub.cfg If there is not output, this is a finding. If the output does not begin with "password_pbkdf2 root", this is a finding.
At the command line, run the following command: # grub2-mkpasswd-pbkdf2 Enter a secure password and ensure this password is stored for break-glass situations. The vCenter root account cannot be recovered without knowing this separate password. Copy the resulting encrypted string. An example string is below: grub.pbkdf2.sha512.10000.983A13DF3C51BB2B5130F0B86DDBF0DEA1AAF766BD1F16B7840F79CE3E35494C4B99F505C99C150071E563DF1D7FE1F45456D5960C4C79DAB6C49298B02A5558.5B2C49E12D43CC5A876F6738462DE4EFC24939D4BE486CDB72CFBCD87FDE93FBAFCB817E01B90F23E53C2502C3230502BC3113BE4F80B0AFC0EE956E735F7F86 Navigate to and open: /boot/grub2/grub.cfg Find the line that begins with "set rootpartition". Below this line, paste the following on its own line: set superusers="root" Below this, paste the following, substituting the encrypted string from the steps above: password_pbkdf2 root <YOUR-LONG-STRING-FROM-ABOVE> Photon ships with one menuentry block by default. Copy that entire block and paste it right below itself. Example: menuentry "Photon" { linux "/"$photon_linux root=$rootpartition net.ifnames=0 $photon_cmdline coredump_filter=0x37 consoleblank=0 if [ "$photon_initrd" ]; then initrd "/"$photon_initrd fi } menuentry "Photon" { linux "/"$photon_linux root=$rootpartition net.ifnames=0 $photon_cmdline coredump_filter=0x37 consoleblank=0 if [ "$photon_initrd" ]; then initrd "/"$photon_initrd fi } Modify the first menuentry block to add the "--unrestricted" option as follows: menuentry "Photon" --unrestricted { Modify the second menuentry block to add the allowed user as follows: menuentry "Recover Photon" --users root { This concludes the fix. To verify, here is an example grub.cfg snippet: ... set rootpartition=PARTUUID=326e5b0f-42fb-471a-8209-18964c4a2ed3 set superusers="root" password_pbkdf2 root grub.pbkdf2.sha512.10000.983A13DF3C51BB2B5130F0B86DDBF0DEA1AAF766BD1F16B7840F79CE3E35494C4B99F505C99C150071E563DF1D7FE1F45456D5960C4C79DAB6C49298B02A5558.5B2C49E12D43CC5A876F6738462DE4EFC24939D4BE486CDB72CFBCD87FDE93FBAFCB817E01B90F23E53C2502C3230502BC3113BE4F80B0AFC0EE956E735F7F86 menuentry "Photon" --unrestricted { linux "/"$photon_linux root=$rootpartition net.ifnames=0 $photon_cmdline coredump_filter=0x37 consoleblank=0 if [ "$photon_initrd" ]; then initrd "/"$photon_initrd fi } menuentry "Recover Photon" --users root { linux "/"$photon_linux root=$rootpartition net.ifnames=0 $photon_cmdline coredump_filter=0x37 consoleblank=0 if [ "$photon_initrd" ]; then initrd "/"$photon_initrd fi }
At the command line, run the following command: # modprobe --showconfig | grep "^install" | grep "/bin" Expected result: install sctp /bin/false install dccp /bin/false install dccp_ipv4 /bin/false install dccp_ipv6 /bin/false install ipx /bin/false install appletalk /bin/false install decnet /bin/false install rds /bin/false install tipc /bin/false install bluetooth /bin/false install usb_storage /bin/false install ieee1394 /bin/false install cramfs /bin/false install freevxfs /bin/false install jffs2 /bin/false install hfs /bin/false install hfsplus /bin/false install squashfs /bin/false install udf /bin/false The output may include other statements outside of the expected result. If the output does not include at least every statement in the expected result, this is a finding.
Navigate to and open: /etc/modprobe.d/modprobe.conf Set the contents as follows: install sctp /bin/false install dccp /bin/false install dccp_ipv4 /bin/false install dccp_ipv6 /bin/false install ipx /bin/false install appletalk /bin/false install decnet /bin/false install rds /bin/false install tipc /bin/false install bluetooth /bin/false install usb_storage /bin/false install ieee1394 /bin/false install cramfs /bin/false install freevxfs /bin/false install jffs2 /bin/false install hfs /bin/false install hfsplus /bin/false install squashfs /bin/false install udf /bin/false
At the command line, run the following command: # awk -F ":" 'list[$3]++{print $1, $3}' /etc/passwd If any lines are returned, this is a finding.
Navigate to and open: /etc/passwd Configure each user account that has a duplicate UID with a unique UID.
At the command line, run the following command: # grep INACTIVE /etc/default/useradd Expected result: INACTIVE=0 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/default/useradd Remove an existing "INACTIVE" line and add the following line: INACTIVE=0
At the command line, run the following command: # /sbin/sysctl -a --pattern tcp_syncookies Expected result: net.ipv4.tcp_syncookies = 1 If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # sed -i -e "/^net.ipv4.tcp_syncookies/d" /etc/sysctl.conf # echo net.ipv4.tcp_syncookies=1>>/etc/sysctl.conf # /sbin/sysctl --load
At the command line, run the following command: # sshd -T|&grep -i ClientAliveInterval Expected result: ClientAliveInterval 900 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "ClientAliveInterval" line is uncommented and set to the following: ClientAliveInterval 900 At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i ClientAliveCountMax Expected result: ClientAliveCountMax 0 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "ClientAliveCountMax" line is uncommented and set to the following: ClientAliveCountMax 0 At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # stat -c "%n is owned by %U and group owned by %G" /var/log If the "/var/log directory" is not owned by root, this is a finding.
At the command line, run the following command: # chown root:root /var/log
At the command line, run the following command: # stat -c "%n is owned by %U and group owned by %G with %a permissions" /var/log/messages If the "/var/log/messages" directory is not owned by root or not group owned by root, or the file permissions are more permission than "640", this is a finding.
At the command line, run the following commands: # chown root:root /var/log/messages # chmod 0640 /var/log/messages
At the command line, run the following command: # auditctl -l | grep -E "(usermod|groupmod)" Expected result: -w /usr/sbin/usermod -p x -k usermod -w /usr/sbin/groupmod -p x -k groupmod If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /usr/sbin/usermod -p x -k usermod -w /usr/sbin/groupmod -p x -k groupmod At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep -E "(/etc/passwd|/etc/shadow|/etc/group|/etc/gshadow)" Expected result: -w /etc/passwd -p wa -k passwd -w /etc/shadow -p wa -k shadow -w /etc/group -p wa -k group -w /etc/gshadow -p wa -k gshadow If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /etc/passwd -p wa -k passwd -w /etc/shadow -p wa -k shadow -w /etc/group -p wa -k group -w /etc/gshadow -p wa -k gshadow At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep "w /usr/bin/passwd" Expected result: -w /usr/bin/passwd -p x -k passwd If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /usr/bin/passwd -p x -k passwd At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep -E "(userdel|groupdel)" Expected result: -w /usr/sbin/userdel -p x -k userdel -w /usr/sbin/groupdel -p x -k groupdel If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. Enabling the auditd service is done in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /usr/sbin/userdel -p x -k userdel -w /usr/sbin/groupdel -p x -k groupdel At the command line, run the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # grep "audit=1" /proc/cmdline If no results are returned, this is a finding.
Navigate to and open: /boot/grub2/grub.cfg Locate the boot command line arguments. An example follows: linux /$photon_linux root=$rootpartition $photon_cmdline $systemd_cmdline Add "audit=1" to the end of the line so it reads as follows: linux /$photon_linux root=$rootpartition $photon_cmdline $systemd_cmdline audit=1 Note: Do not copy/paste in this example argument line. This may change in future releases. Find the similar line and append "audit=1" to it. Reboot the system for the change to take effect.
At the command line, run the following command: # stat -c "%n is owned by %U and group owned by %G" /etc/audit/auditd.conf If "auditd.conf" is not owned by root and group owned by root, this is a finding.
At the command line, run the following command: # chown root:root /etc/audit/auditd.conf
At the command line, run the following command: # stat -c "%n is owned by %U and group owned by %G and permissions are %a" /usr/sbin/auditctl /usr/sbin/auditd /usr/sbin/aureport /usr/sbin/ausearch /usr/sbin/autrace If any file is not owned by root or group-owned by root or permissions are more permissive than "750", this is a finding.
At the command line, run the following command for each file returned for user and group ownership: # chown root:root <file> At the command line, run the following command for each file returned for file permissions: # chmod 750 <file>
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "ocredit=.." Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include ocredit= <= -1, this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
Use the verification capability of rpm to check the MD5 hashes of the audit files on disk versus the expected ones from the installation package. At the command line, run the following command: # rpm -V audit | grep "^..5" | grep -v "^...........c" If there is any output, this is a finding.
If the audit system binaries have been altered, the system must be taken offline and the information system security manager (ISSM) notified immediately. Reinstalling the audit tools is not supported. The appliance should be restored from a backup or redeployed once the root cause is remediated.
At the command line, run the following command to obtain a list of setuid files: # find / -xdev -path /var/lib/containerd -prune -o \( -perm -4000 -type f -o -perm -2000 \) -type f -print | sort Run the following command for each setuid file found in the first command: # auditctl -l | grep <setuid_path> Replace <setuid_path> with each path found in the first command. If each <setuid_path> does not have a corresponding line in the audit rules, this is a finding. A typical corresponding line will look like the following: -a always,exit -S all -F path=<setuid_path> -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged Note: The auid!= parameter may display as 4294967295 or -1, which are equivalent. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
At the command line, run the following command to obtain a list of setuid files: # find / -xdev -perm -4000 -type f -o -perm -2000 -type f | sort Execute the following for each setuid file found in the first command that does not have a corresponding line in the audit rules: Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following line: -a always,exit -F path=<setuid_path> -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged Execute the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # grep "^num_logs" /etc/audit/auditd.conf Expected result: num_logs = 5 If the output of the command does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Add or change the "num_logs" line as follows: num_logs = 5 At the command line, run the following commands: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # grep "^max_log_file_action" /etc/audit/auditd.conf Example result: max_log_file_action = IGNORE If logs are rotated outside of auditd with a tool such as logrotated, and this setting is not set to "IGNORE", this is a finding. If logs are NOT rotated outside of auditd, and this setting is not set to "ROTATE", this is a finding.
Navigate to and open: /etc/audit/auditd.conf Add or change the "max_log_file_action" line as follows: max_log_file_action = IGNORE Note: This can also be set to "ROTATE" if another tool is not used to rotate auditd logs. At the command line, run the following commands: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # grep "^space_left " /etc/audit/auditd.conf Expected result: space_left = 75 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the "space_left" line is uncommented and set to the following: space_left = 75 At the command line, run the following commands: # killproc auditd -TERM # systemctl start auditd
At the command line, run the following command: # grep -s nosignature /usr/lib/rpm/rpmrc /etc/rpmrc ~root/.rpmrc If the command returns any output, this is a finding.
Open the file containing "nosignature" with a text editor and remove the option.
At the command line, run the following command: # grep "^gpgcheck" /etc/tdnf/tdnf.conf If "gpgcheck" is not set to "1", this is a finding.
Navigate to and open: /etc/tdnf/tdnf.conf Remove any existing "gpgcheck" setting and add the following line: gpgcheck=1
At the command line, run the following command: # grep gpgcheck /etc/yum.repos.d/* If "gpgcheck" is not set to "1" in any returned file, this is a finding.
Open the file where "gpgcheck" is not set to "1" with a text editor. Remove any existing "gpgcheck" setting and add the following line at the end of the file: gpgcheck=1
At the command line, run the following commands: # grep -ihs nopasswd /etc/sudoers /etc/sudoers.d/*|grep -v "^#"|grep -v "^%"|awk '{print $1}' # awk -F: '($2 != "x" && $2 != "!") {print $1}' /etc/shadow If any account listed in the first output is also listed in the second output and is not documented, this is a finding.
Check the configuration of the "/etc/sudoers" and "/etc/sudoers.d/*" files with the following command: # visudo OR # visudo -f /etc/sudoers.d/<file name> Remove any occurrences of "NOPASSWD" tags associated with user accounts with a password hash.
At the command line, run the following command: # sshd -T|&grep -i Ciphers Expected result: ciphers aes128-ctr,aes128-gcm@openssh.com,aes192-ctr,aes256-gcm@openssh.com,aes256-ctr If the output matches the ciphers in the expected result or a subset thereof, this is not a finding. If the ciphers in the output contain any ciphers not listed in the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "Ciphers" line is uncommented and set to the following: Ciphers aes128-ctr,aes128-gcm@openssh.com,aes192-ctr,aes256-gcm@openssh.com,aes256-ctr At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # cat /proc/sys/kernel/randomize_va_space If the value of "randomize_va_space" is not "2", this is a finding.
Navigate to and open: /etc/sysctl.d/50-security-hardening.conf Ensure the "randomize_va_space" is uncommented and set to the following: kernel.randomize_va_space=2 At the command line, run the following command: # sysctl --system
At the command line, run the following command: # grep -i "^clean_requirements_on_remove" /etc/tdnf/tdnf.conf Expected result: clean_requirements_on_remove=true If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/tdnf/tdnf.conf Remove any existing "clean_requirements_on_remove" line and ensure the following line is present: clean_requirements_on_remove=true
At the command line, run the following command: # auditctl -l | grep sudo Expected result: -a always,exit -S all -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=-1 -F key=privileged If the output does not match the expected result, this is a finding. Note: The auid!= parameter may display as 4294967295 or -1, which are equivalent. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following line: -a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -F key=privileged Execute the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep -E "faillog|lastlog|tallylog" Expected result: -w /var/log/faillog -p wa -w /var/log/lastlog -p wa -w /var/log/tallylog -p wa If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /var/log/faillog -p wa -w /var/log/lastlog -p wa -w /var/log/tallylog -p wa Execute the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep "/sbin/insmod" Expected result: -w /sbin/insmod -p x If the output does not match the expected result, this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following lines: -w /sbin/insmod -p x Execute the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # auditctl -l | grep -E /etc/security/opasswd If any of these are not listed with a permissions filter of at least "w", this is a finding. Note: This check depends on the auditd service to be in a running state for accurate results. The auditd service is enabled in control PHTN-30-000013.
Navigate to and open: /etc/audit/rules.d/audit.STIG.rules Add the following line: -w /etc/security/opasswd -p wa -k opasswd Execute the following command to load the new audit rules: # /sbin/augenrules --load Note: A new "audit.STIG.rules" file is provided for placement in "/etc/audit/rules.d" that contains all rules needed for auditd. Note: An older "audit.STIG.rules" may exist if the file exists and references older "GEN" SRG IDs. This file can be removed and replaced as necessary with an updated one.
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password If the output does not return at least "password requisite pam_cracklib.so", this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep FAIL_DELAY /etc/login.defs Expected result: FAIL_DELAY 4 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/login.defs Add the following line after the last auth statement: FAIL_DELAY 4
At the command line, run the following command: # grep pam_faildelay /etc/pam.d/system-auth|grep --color=always "delay=" Expected result: auth optional pam_faildelay.so delay=4000000 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/pam.d/system-auth Remove any existing "pam_faildelay" line and add the following line at the end of the file: auth optional pam_faildelay.so delay=4000000 Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # grep -E "freq|flush" /etc/audit/auditd.conf Expected result: flush = INCREMENTAL_ASYNC freq = 50 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/audit/auditd.conf Ensure the following line is present and any existing "flush" and "freq" settings are removed: flush = INCREMENTAL_ASYNC freq = 50
At the command line, run the following command: # grep -i "^create_home" /etc/login.defs If there is no output or the output does not equal "CREATE_HOME yes", this is a finding.
Navigate to and open: /etc/login.defs Ensure the following is present and any existing "CREATE_HOME" line is removed: CREATE_HOME yes
At the command line, run the following command: # systemctl status debug-shell.service|grep -E --color=always disabled If the debug-shell service is not disabled, this is a finding.
At the command line, run the following commands: # systemctl stop debug-shell.service # systemctl disable debug-shell.service Reboot for changes to take effect.
At the command line, run the following command: # sshd -T|&grep -i GSSAPIAuthentication Expected result: GSSAPIAuthentication no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "GSSAPIAuthentication" line is uncommented and set to the following: GSSAPIAuthentication no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: sshd -T|&grep -i PermitUserEnvironment Expected result: PermitUserEnvironment no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "PermitUserEnvironment" line is uncommented and set to the following: PermitUserEnvironment no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i X11Forwarding Expected result: X11Forwarding no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "X11Forwarding" line is uncommented and set to the following: X11Forwarding no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i StrictModes Expected result: StrictModes yes If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "StrictModes" line is uncommented and set to the following: StrictModes yes At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i KerberosAuthentication Expected result: KerberosAuthentication no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "KerberosAuthentication" line is uncommented and set to the following: KerberosAuthentication no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i PermitEmptyPasswords Expected result: PermitEmptyPasswords no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "PermitEmptyPasswords" line is uncommented and set to the following: PermitEmptyPasswords no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i Compression Expected result: Compression no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "Compression" line is uncommented and set to the following: Compression no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i PrintLastLog Expected result: PrintLastLog yes If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "PrintLastLog" line is uncommented and set to the following: PrintLastLog yes At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i IgnoreRhosts Expected result: IgnoreRhosts yes If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "IgnoreRhosts" line is uncommented and set to the following: IgnoreRhosts yes At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i IgnoreUserKnownHosts Expected result: IgnoreUserKnownHosts yes If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "IgnoreUserKnownHosts" line is uncommented and set to the following: IgnoreUserKnownHosts yes At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i MaxAuthTries Expected result: MaxAuthTries 6 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "MaxAuthTries" line is uncommented and set to the following: MaxAuthTries 6 At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # systemctl status ctrl-alt-del.target Expected result: ctrl-alt-del.target Loaded: masked (Reason: Unit ctrl-alt-del.target is masked.) Active: inactive (dead) If the "ctrl-alt-del.target" is not "inactive" and "masked", this is a finding.
At the command line, run the following command: # systemctl mask ctrl-alt-del.target
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/skel/.[^.]* Expected result: /etc/skel/.bash_logout permissions are 750 and owned by root:root /etc/skel/.bash_profile permissions are 644 and owned by root:root /etc/skel/.bashrc permissions are 750 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # chmod 750 /etc/skel/.bash_logout # chmod 644 /etc/skel/.bash_profile # chmod 750 /etc/skel/.bashrc # chown root:root /etc/skel/.bash_logout # chown root:root /etc/skel/.bash_profile # chown root:root /etc/skel/.bashrc
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /root Expected result: /root permissions are 700 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # chmod 700 /root # chown root:root /root
At the command line, run the following command: # find /etc/bash.bashrc /etc/profile /etc/profile.d/ -xdev -type f -a '(' -perm -002 -o -not -user root -o -not -group root ')' -exec ls -ld {} \; If any files are returned, this is a finding.
At the command line, run the following commands for each returned file: # chmod o-w <file> # chown root:root <file>
At the command line, run the following command: # find /etc/rc.d/* -xdev -type f -a '(' -perm -002 -o -not -user root -o -not -group root ')' -exec ls -ld {} \; If any files are returned, this is a finding.
At the command line, run the following commands for each returned file: # chmod o-w <file> # chown root:root <file>
At the command line, run the following command: # find / -fstype ext4 -nouser -o -nogroup -exec ls -ld {} \; 2>/dev/null If any files are returned, this is a finding.
At the command line, run the following command for each returned file: # chown root:root <file>
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/cron.allow Expected result: /etc/cron.allow permissions are 600 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # chmod 600 /etc/cron.allow # chown root:root /etc/cron.allow
At the command line, run the following command: # find /etc/cron.d/ /etc/cron.daily/ /etc/cron.hourly/ /etc/cron.monthly/ /etc/cron.weekly/ -xdev -type f -a '(' -perm -022 -o -not -user root ')' -exec ls -ld {} \; If any files are returned, this is a finding.
At the command line, run the following commands for each returned file: # chmod 644 <file> # chown root <file>
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly Expected result: /etc/cron.d permissions are 755 and owned by root:root /etc/cron.daily permissions are 755 and owned by root:root /etc/cron.hourly permissions are 755 and owned by root:root /etc/cron.monthly permissions are 755 and owned by root:root /etc/cron.weekly permissions are 755 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands for each returned file: # chmod 755 <path> # chown root:root <path>
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv[4|6].conf.(all|default|eth.*).accept_source_route" Expected result: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.conf.eth0.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 net.ipv6.conf.eth0.accept_source_route = 0 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "0".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv[4|6].conf.(all|default|eth.*).accept_source_route"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=0>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern ignore_broadcasts Expected result: net.ipv4.icmp_echo_ignore_broadcasts = 1 If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # sed -i -e "/^net.ipv4.icmp_echo_ignore_broadcasts/d" /etc/sysctl.conf # echo net.ipv4.icmp_echo_ignore_broadcasts=1>>/etc/sysctl.conf # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.conf.(all|default|eth.*).accept_redirects" Expected result: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.conf.eth0.accept_redirects = 0 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "0".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv4.conf.(all|default|eth.*).accept_redirects"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=0>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.conf.(all|default|eth.*).secure_redirects" Expected result: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 net.ipv4.conf.eth0.secure_redirects = 0 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "0".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv4.conf.(all|default|eth.*).secure_redirects"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=0>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.conf.(all|default|eth.*).send_redirects" Expected result: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.conf.eth0.send_redirects = 0 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "0".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv4.conf.(all|default|eth.*).send_redirects"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=0>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.conf.(all|default|eth.*).log_martians" Expected result: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 net.ipv4.conf.eth0.log_martians = 1 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "1".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv4.conf.(all|default|eth.*).log_martians"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=1>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.conf.(all|default|eth.*)\.rp_filter" Expected result: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.eth0.rp_filter = 1 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "1".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv4.conf.(all|default|eth.*)\.rp_filter"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=1>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv[4|6].conf.(all|default|eth.*).mc_forwarding" Expected result: net.ipv4.conf.all.mc_forwarding = 0 net.ipv4.conf.default.mc_forwarding = 0 net.ipv4.conf.eth0.mc_forwarding = 0 net.ipv6.conf.all.mc_forwarding = 0 net.ipv6.conf.default.mc_forwarding = 0 net.ipv6.conf.eth0.mc_forwarding = 0 If the output does not match the expected result, this is a finding. Note: The number of "ethx" lines returned is dependent on the number of interfaces. Every "ethx" entry must be set to "0".
At the command line, run the following command: # for SETTING in $(/sbin/sysctl -aN --pattern "net.ipv[4|6].conf.(all|default|eth.*).mc_forwarding"); do sed -i -e "/^${SETTING}/d" /etc/sysctl.conf;echo $SETTING=0>>/etc/sysctl.conf; done # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.ip_forward$" Expected result: net.ipv4.ip_forward = 0 If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # sed -i -e "/^net.ipv4.ip_forward/d" /etc/sysctl.conf # echo net.ipv4.ip_forward=0>>/etc/sysctl.conf # /sbin/sysctl --load
At the command line, run the following command: # /sbin/sysctl -a --pattern "net.ipv4.tcp_timestamps$" Expected result: net.ipv4.tcp_timestamps = 1 If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # sed -i -e "/^net.ipv4.tcp_timestamps/d" /etc/sysctl.conf # echo net.ipv4.tcp_timestamps=1>>/etc/sysctl.conf # /sbin/sysctl --load
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/ssh/*key.pub Expected result: /etc/ssh/ssh_host_ecdsa_key.pub permissions are 644 and owned by root:root /etc/ssh/ssh_host_ed25519_key.pub permissions are 644 and owned by root:root /etc/ssh/ssh_host_rsa_key.pub permissions are 644 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands for each returned file: # chmod 644 <file> # chown root:root <file>
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/ssh/*key Expected result: /etc/ssh/ssh_host_dsa_key permissions are 600 and owned by root:root /etc/ssh/ssh_host_ecdsa_key permissions are 600 and owned by root:root /etc/ssh/ssh_host_ed25519_key permissions are 600 and owned by root:root /etc/ssh/ssh_host_rsa_key permissions are 600 and owned by root:root If any key file listed is not owned by root or not group owned by root or does not have permissions of "0600", this is a finding.
At the command line, run the following commands for each returned file: # chmod 600 <file> # chown root:root <file>
At the command line, run the following command: # grep pam_cracklib /etc/pam.d/system-password|grep --color=always "enforce_for_root" Expected result: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root If the output does not include "enforce_for_root", this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the following, replacing any existing "pam_cracklib.so" line: password requisite pam_cracklib.so dcredit=-1 ucredit=-1 lcredit=-1 ocredit=-1 minlen=8 minclass=4 difok=4 retry=3 maxsequence=0 enforce_for_root Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # find /boot/*.cfg -xdev -type f -a '(' -perm -002 -o -not -user root -o -not -group root ')' -exec ls -ld {} \; If any files are returned, this is a finding.
At the command line, run the following commands for each returned file: # chmod 644 <file> # chown root:root <file>
At the command line, run the following command: # stat -c "%n permissions are %a and owned by %U:%G" /etc/ssh/sshd_config Expected result: /etc/ssh/sshd_config permissions are 600 and owned by root:root If the output does not match the expected result, this is a finding.
At the command line, run the following commands: # chmod 600 /etc/ssh/sshd_config # chown root:root /etc/ssh/sshd_config
At the command line, run the following command: # find /etc/sysctl.conf /etc/sysctl.d/* -xdev -type f -a '(' -perm -002 -o -not -user root -o -not -group root ')' -exec ls -ld {} \; If any files are returned, this is a finding.
At the command line, run the following commands for each returned file: # chmod 600 <file> # chown root:root <file>
At the command line, run the following command: # grep ^UMASK /etc/login.defs Example result: UMASK 077 If "UMASK" is not configured to "077", this a finding. Note: "UMASK" should only be specified once in login.defs.
Navigate to and open: /etc/login.defs Ensure the "UMASK" line is uncommented and set to the following: UMASK 077
At the command line, run the following command: # sshd -T|&grep -i HostbasedAuthentication Expected result: hostbasedauthentication no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "HostbasedAuthentication" line is uncommented and set to the following: HostbasedAuthentication no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # grep password /etc/pam.d/system-password|grep --color=always "sha512" If the output does not include "sha512", this is a finding.
Navigate to and open: /etc/pam.d/system-password Add the argument "sha512" to the "password" line: password required pam_unix.so sha512 shadow try_first_pass Note: On vCenter appliances, the equivalent file must be edited under "/etc/applmgmt/appliance", if one exists, for the changes to persist after a reboot.
At the command line, run the following command: # ls -al /etc/security/opasswd If "/etc/security/opasswd" does not exist, this is a finding.
At the command line, run the following commands: # touch /etc/security/opasswd # chown root:root /etc/security/opasswd # chmod 0600 /etc/security/opasswd
At the command line, run the following command: # sshd -T|&grep -i AllowTcpForwarding Expected result: allowtcpforwarding no If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "AllowTcpForwarding" line is uncommented and set to the following: AllowTcpForwarding no At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # sshd -T|&grep -i LoginGraceTime Expected result: logingracetime 30 If the output does not match the expected result, this is a finding.
Navigate to and open: /etc/ssh/sshd_config Ensure the "LoginGraceTime" line is uncommented and set to the following: LoginGraceTime 30 At the command line, run the following command: # systemctl restart sshd.service
At the command line, run the following command: # cat /proc/sys/crypto/fips_enabled If a value of "1" is not returned, this is a finding.
Navigate to and open: /boot/grub2/grub.cfg Locate the kernel command line, which will start with "linux", and add "fips=1" to the end. For example: linux /$photon_linux audit=1 root=$rootpartition $photon_cmdline coredump_filter=0x37 consoleblank=0 $systemd_cmdline fips=1 Reboot the system for the change to take effect. Note: The "fipsify" package must be installed for FIPS mode to work properly.
At the command line, run the following command: # resolvectl status | grep 'Fallback DNS' If the output indicates that fallback DNS servers are configured, this is a finding.
Navigate to and open: /etc/systemd/resolved.conf Add or update the "FallbackDNS" entry to the following: FallbackDNS= Restart the systemd resolved service by running the following command: # systemctl restart systemd-resolved Note: If this option is not given, a compiled-in list of DNS servers is used instead, which is undesirable.