{"description": "SSH server private keys - files that match the <code>/etc/ssh/*_key</code> glob, have to have restricted permissions.\nIf those files are owned by the <code>root</code> user and the <code>root</code> group, they have to have the <code>0600</code> permission or stricter.", "rationale": "If an unauthorized user obtains the private SSH host key file, the host could be\nimpersonated.", "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.13", "3.13.10"], "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-17(a)", "CM-6(a)", "AC-6(1)"], "nist-csf": ["PR.AC-4", "PR.DS-5"], "pcidss": ["Req-2.2.4"], "srg": ["SRG-OS-000480-GPOS-00227"], "anssi": ["R50"], "cis": ["5.1.2"], "ism": ["1449"], "pcidss4": ["2.2.6", "2.2"]}, "control_references": {"anssi": ["R50"], "cis": ["5.1.2"], "ism": ["1449"], "pcidss4": ["2.2.6", "2.2"]}, "components": [], "identifiers": {}, "ocil_clause": "/etc/ssh/*_key does not have unix mode -rw-------", "ocil": "To check the permissions of <code>/etc/ssh/*_key</code>,\nrun the command:\n<pre>$ ls -l /etc/ssh/*_key</pre>\nIf properly configured, the output should indicate the following permissions:\n<code>-rw-------</code>", "oval_external_content": null, "fixtext": " The Ubuntu 22.04 /etc/ssh/*_key file must have mode 0600 or less permissive to prevent unauthorized access.", "checktext": "", "vuldiscussion": "", "srg_requirement": "The  SSH private host key files must have mode 0600 or less permissive.", "warnings": [{"general": "Remediation is not possible at bootable container build time because SSH host\nkeys are generated post-deployment."}], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 SSH private host key files must have mode 0640 or less permissive.", "vuldiscussion": "If an unauthorized user obtains the private SSH host key file, the host could be impersonated.", "checktext": "Verify the SSH private host key files have a mode of \"0640\" or less permissive with the following command:\n\n$ stat -c \"%a %n\" /etc/ssh/*_key\n\n640 /etc/ssh/ssh_host_dsa_key\n640 /etc/ssh/ssh_host_ecdsa_key\n640 /etc/ssh/ssh_host_ed25519_key\n640 /etc/ssh/ssh_host_rsa_key\n\nIf any private host key file has a mode more permissive than \"0640\", this is a finding.", "fixtext": "Configure the mode of SSH private host key files under \"/etc/ssh\" to \"0640\" with the following command:\n\n$ sudo chmod 0640 /etc/ssh/ssh_host*key\n\nRestart the SSH daemon for the changes to take effect:\n\n$ sudo systemctl restart sshd.service"}}, "platform": "system_with_kernel", "platforms": ["system_with_kernel"], "sce_metadata": {}, "inherited_platforms": [], "cpe_platform_names": ["system_with_kernel"], "inherited_cpe_platform_names": [], "bash_conditional": null, "fixes": {}, "title": "Verify Permissions on SSH Server Private *_key Key Files", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/services/ssh/file_permissions_sshd_private_key/rule.yml", "template": null}