{"description": "To set the runtime status of the <code>kernel.perf_event_paranoid</code> kernel parameter, run the following command: <pre>$ sudo sysctl -w kernel.perf_event_paranoid=2</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.perf_event_paranoid = 2</pre>", "rationale": "Kernel profiling can reveal sensitive information about kernel behaviour.", "severity": "low", "references": {"nist": ["AC-6"], "ospp": ["FMT_SMF_EXT.1"], "srg": ["SRG-OS-000132-GPOS-00067", "SRG-OS-000138-GPOS-00069", "SRG-APP-000243-CTR-000600"], "anssi": ["R9"]}, "control_references": {"anssi": ["R9"]}, "components": [], "identifiers": {}, "ocil_clause": "the correct value is not returned", "ocil": "The runtime status of the <code>kernel.perf_event_paranoid</code> kernel parameter can be queried\nby running the following command:\n<pre>$ sysctl kernel.perf_event_paranoid</pre>\n<code>2</code>.\n", "oval_external_content": null, "fixtext": "Configure Ubuntu 22.04 to only allow root to do kernel profiling.\nAdd or edit the following line in a system configuration file in the \"/etc/sysctl.d/\" directory:\nkernel.perf_event_paranoid = 2\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 kernel profiling by unprivileged users.", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 must prevent kernel profiling by nonprivileged users.", "vuldiscussion": "Preventing unauthorized information transfers mitigates the risk of information, including encrypted representations of information, produced by the actions of prior users/roles (or the actions of processes acting on behalf of prior users/roles) from being available to any current users/roles (or current processes) that obtain access to shared system resources (e.g., registers, main memory, hard disks) after those resources have been released back to information systems. The control of information in shared resources is also commonly referred to as object reuse and residual information protection.\n\nThis requirement generally applies to the design of an information technology product, but it can also apply to the configuration of particular information system components that are, or use, such products. This can be verified by acceptance/validation processes in DOD or other government agencies.\n\nThere may be shared resources with configurable protections (e.g., files in storage) that may be assessed on specific information system components.\n\nSetting the kernel.perf_event_paranoid kernel parameter to \"2\" prevents attackers from gaining additional system information as a nonprivileged user.", "checktext": "Verify Ubuntu 22.04 is configured to prevent kernel profiling by nonprivileged users with the following commands:\n\nCheck the status of the kernel.perf_event_paranoid kernel parameter.\n\n$ sysctl kernel.perf_event_paranoid\n\nkernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\" or is missing, this is a finding.\n\nCheck that the configuration files are present to enable this kernel parameter.\n\n$ sudo /usr/lib/systemd/systemd-sysctl --cat-config  | egrep -v '^(#|;)' | grep -F kernel.perf_event_paranoid | tail -1\n\nkernel.perf_event_paranoid = 2\n\nIf \"kernel.perf_event_paranoid\" is not set to \"2\" or is missing, this is a finding.", "fixtext": "Configure Ubuntu 22.04 to prevent kernel profiling by nonprivileged users.\n\nAdd or edit the following line in a system configuration file, in the \"/etc/sysctl.d/\" directory:\n\nkernel.perf_event_paranoid = 2\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_perf_event_paranoid.sh", "relative_path": "ubuntu2204/checks/sce/sysctl_kernel_perf_event_paranoid.sh"}, "inherited_platforms": [], "cpe_platform_names": ["system_with_kernel"], "inherited_cpe_platform_names": [], "bash_conditional": null, "fixes": {}, "title": "Disallow kernel profiling by unprivileged users", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/system/permissions/restrictions/sysctl_kernel_perf_event_paranoid/rule.yml", "template": {"name": "sysctl", "vars": {"sysctlvar": "kernel.perf_event_paranoid", "sysctlval": "2", "datatype": "int"}, "backends": {}}}