{"description": "SSHs <tt>StrictModes</tt> option checks file and ownership permissions in\nthe user's home directory <tt>.ssh</tt> folder before accepting login. If world-\nwritable permissions are found, logon is rejected.\n<br/>\nThe default SSH configuration has <tt>StrictModes</tt> enabled. The appropriate\nconfiguration is used if no value is set for <tt>StrictModes</tt>.\n<br/>\nTo explicitly enable <tt>StrictModes</tt> in SSH, add or correct the following line in\n\n\n<tt>/etc/ssh/sshd_config.d/00-complianceascode-hardening.conf</tt>:\n\n<pre>StrictModes yes</pre>", "rationale": "If other users have access to modify user-specific SSH configuration files, they\nmay be able to log into the system as another user.", "severity": "medium", "references": {"cis-csc": ["12", "13", "14", "15", "16", "18", "3", "5"], "cobit5": ["APO01.06", "DSS05.04", "DSS05.07", "DSS06.02"], "cui": ["3.1.12"], "hipaa": ["164.308(a)(4)(i)", "164.308(b)(1)", "164.308(b)(3)", "164.310(b)", "164.312(e)(1)", "164.312(e)(2)(ii)"], "isa-62443-2009": ["4.3.3.7.3"], "isa-62443-2013": ["SR 2.1", "SR 5.2"], "iso27001-2013": ["A.10.1.1", "A.11.1.4", "A.11.1.5", "A.11.2.1", "A.13.1.1", "A.13.1.3", "A.13.2.1", "A.13.2.3", "A.13.2.4", "A.14.1.2", "A.14.1.3", "A.6.1.2", "A.7.1.1", "A.7.1.2", "A.7.3.1", "A.8.2.2", "A.8.2.3", "A.9.1.1", "A.9.1.2", "A.9.2.3", "A.9.4.1", "A.9.4.4", "A.9.4.5"], "nerc-cip": ["CIP-003-8 R5.1.1", "CIP-003-8 R5.3", "CIP-004-6 R2.3", "CIP-007-3 R2.1", "CIP-007-3 R2.2", "CIP-007-3 R2.3", "CIP-007-3 R5.1", "CIP-007-3 R5.1.1", "CIP-007-3 R5.1.2"], "nist": ["AC-6", "AC-17(a)", "CM-6(a)"], "nist-csf": ["PR.AC-4", "PR.DS-5"], "srg": ["SRG-OS-000480-GPOS-00227"], "ism": ["1409"]}, "control_references": {"ism": ["1409"]}, "components": [], "identifiers": {}, "ocil_clause": "the required value is not set", "ocil": "To determine how the SSH daemon's <tt>StrictModes</tt> option is set, run the following command:\n\n<pre>$ sudo grep -i StrictModes /etc/ssh/sshd_config.d/00-complianceascode-hardening.conf</pre>\n<pre>$ sudo grep -i StrictModes /etc/ssh/sshd_config.d/01-complianceascode-reinforce-os-defaults.conf</pre>\n\nIf a line indicating <tt>yes</tt> is returned, then the required value is set.\n", "oval_external_content": null, "fixtext": "To configure the system add or modify the following line in \"/etc/ssh/sshd_config.d/00-complianceascode-hardening.conf\".\nStrictModes yes\nRestart the SSH daemon for the settings to take effect:\n$ sudo systemctl restart sshd.service", "checktext": "", "vuldiscussion": "", "srg_requirement": "The Ubuntu 22.04 SSH daemon must perform strict mode checking of home directory configuration files.", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 SSH daemon must perform strict mode checking of home directory configuration files.", "vuldiscussion": "If other users have access to modify user-specific SSH configuration files, they may be able to log into the system as another user.", "checktext": "Verify the SSH daemon performs strict mode checking of home directory configuration files with the following command:\n\n$ sudo /usr/sbin/sshd -dd 2&gt;&1 | awk '/filename/ {print $4}' | tr -d '\\r' | tr '\\n' ' ' | xargs sudo grep -iH '^\\s*strictmodes'\n\nStrictModes yes\n\nIf the \"StrictModes\" keyword is set to \"no\", the returned line is commented out, or no output is returned, this is a finding.", "fixtext": "Configure the SSH daemon to perform strict mode checking of home directory configuration files.\n\nAdd the following line to \"/etc/ssh/sshd_config\" or to a file in \"/etc/ssh/sshd_config.d\", or uncomment the line and set the value to \"yes\":\n\nStrictModes yes\n\nThe SSH service must be restarted for changes to take effect:\n\n$ sudo systemctl restart sshd.service"}}, "platform": null, "platforms": [], "sce_metadata": {}, "inherited_platforms": ["system_with_kernel"], "cpe_platform_names": [], "inherited_cpe_platform_names": ["system_with_kernel"], "bash_conditional": null, "fixes": {}, "title": "Enable Use of Strict Mode Checking", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/services/ssh/ssh_server/sshd_enable_strictmodes/rule.yml", "template": {"name": "sshd_lineinfile", "vars": {"parameter": "StrictModes", "value": "yes", "datatype": "string", "is_default_value": "true"}, "backends": {}}}