Add the 'kernel.yama.ptrace_scope' check
authorAlexander Popov <alex.popov@linux.com>
Tue, 17 Oct 2023 15:53:32 +0000 (18:53 +0300)
committerAlexander Popov <alex.popov@linux.com>
Tue, 17 Oct 2023 15:53:32 +0000 (18:53 +0300)
kernel_hardening_checker/checks.py

index 56d2f7499368d6ce6ca591eb5de97aaece137e9e..b7f2db50710fe33e183fbf1a1d61f68db41622b9 100644 (file)
@@ -578,7 +578,6 @@ def normalize_cmdline_options(option, value):
 
 
 # TODO: draft of security hardening sysctls:
-#    kernel.yama.ptrace_scope=3
 #    what about bpf_jit_enable?
 #    vm.unprivileged_userfaultfd=0
 #        (at first, it disabled unprivileged userfaultfd,
@@ -615,3 +614,4 @@ def add_sysctl_checks(l, arch):
     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')]
+    l += [SysctlCheck('cut_attack_surface', 'kspp', 'kernel.yama.ptrace_scope', '3')]