From f72a3f5562590e569ab87f2abd2088c11098c2fe Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Tue, 17 Oct 2023 18:52:57 +0300 Subject: [PATCH] Add the 'kernel.kptr_restrict' check --- kernel_hardening_checker/checks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel_hardening_checker/checks.py b/kernel_hardening_checker/checks.py index 7476fde..56d2f74 100644 --- a/kernel_hardening_checker/checks.py +++ b/kernel_hardening_checker/checks.py @@ -578,7 +578,6 @@ def normalize_cmdline_options(option, value): # TODO: draft of security hardening sysctls: -# kernel.kptr_restrict=2 (or 1?) # kernel.yama.ptrace_scope=3 # what about bpf_jit_enable? # vm.unprivileged_userfaultfd=0 @@ -615,3 +614,4 @@ def add_sysctl_checks(l, arch): l += [SysctlCheck('cut_attack_surface', 'kspp', 'user.max_user_namespaces', '0')] l += [SysctlCheck('cut_attack_surface', 'kspp', 'dev.tty.ldisc_autoload', '0')] l += [SysctlCheck('cut_attack_surface', 'kspp', 'kernel.unprivileged_bpf_disabled', '1')] + l += [SysctlCheck('cut_attack_surface', 'kspp', 'kernel.kptr_restrict', '2')] -- 2.31.1