{"description": "To set the runtime status of the <code>kernel.kexec_load_disabled</code> kernel parameter, run the following command: <pre>$ sudo sysctl -w kernel.kexec_load_disabled=1</pre>\nTo make sure that the setting is persistent, add the following line to a file in the directory <tt>/etc/sysctl.d</tt>: <pre>kernel.kexec_load_disabled = 1</pre>", "rationale": "Disabling kexec_load allows greater control of the kernel memory.\nIt makes it impossible to load another kernel image after it has been disabled.\n", "severity": "medium", "references": {"nist": ["CM-6"], "ospp": ["FMT_SMF_EXT.1"], "srg": ["SRG-OS-000480-GPOS-00227", "SRG-OS-000366-GPOS-00153"], "ism": ["1409"]}, "control_references": {"ism": ["1409"]}, "components": [], "identifiers": {}, "ocil_clause": "the correct value is not returned", "ocil": "The runtime status of the <code>kernel.kexec_load_disabled</code> kernel parameter can be queried\nby running the following command:\n<pre>$ sysctl kernel.kexec_load_disabled</pre>\n<code>1</code>.\n", "oval_external_content": null, "fixtext": "Add or edit the following line in a system configuration file in the \"/etc/sysctl.d/\" directory:\nkernel.kexec_load_disabled = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system", "checktext": "", "vuldiscussion": "", "srg_requirement": "Ubuntu 22.04 must prevent the loading of a new kernel for later execution.", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 must prevent the loading of a new kernel for later execution.", "vuldiscussion": "Changes to any software components can have significant effects on the overall security of the operating system. This requirement ensures the software has not been tampered with and that it has been provided by a trusted vendor.\n\nDisabling kexec_load prevents an unsigned kernel image (that could be a windows kernel or modified vulnerable kernel) from being loaded. Kexec can be used subvert the entire secureboot process and should be avoided at all costs especially since it can load unsigned kernel images.", "checktext": "Verify Ubuntu 22.04 is configured to disable kernel image loading.\n\nCheck the status of the kernel.kexec_load_disabled kernel parameter with the following command:\n\n$ sudo sysctl kernel.kexec_load_disabled\n\nkernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter with the following command:\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config | egrep -v '^(#|;)' | grep -F kernel.kexec_load_disabled | tail -1\n\nkernel.kexec_load_disabled = 1\n\nIf \"kernel.kexec_load_disabled\" is not set to \"1\" or is missing, this is a finding.", "fixtext": "Add or edit the following line in a system configuration file in the \"/etc/sysctl.d/\" directory:\n\nkernel.kexec_load_disabled = 1\n\nLoad settings from all system configuration files with the following command:\n\n$ sudo sysctl --system"}}, "platform": "system_with_kernel", "platforms": ["system_with_kernel"], "sce_metadata": {"check-import": "stdout", "platform": ["multi_platform_all"], "environment": "any", "filename": "sysctl_kernel_kexec_load_disabled.sh", "relative_path": "ubuntu2204/checks/sce/sysctl_kernel_kexec_load_disabled.sh"}, "inherited_platforms": [], "cpe_platform_names": ["system_with_kernel"], "inherited_cpe_platform_names": [], "bash_conditional": null, "fixes": {}, "title": "Disable Kernel Image Loading", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/system/permissions/restrictions/sysctl_kernel_kexec_load_disabled/rule.yml", "template": {"name": "sysctl", "vars": {"sysctlvar": "kernel.kexec_load_disabled", "sysctlval": "1", "datatype": "int"}, "backends": {}}}