1 |
On 1/3/20 3:46 PM, Rich Freeman wrote: |
2 |
> If OpenRC contains a vulnerability wouldn't it make more sense to set |
3 |
> this as part of OpenRC, |
4 |
Indeed. |
5 |
|
6 |
Furthermore there's a nifty page https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings |
7 |
which yields for me to this /etc/sysctl.d/local.conf : |
8 |
|
9 |
|
10 |
# Restrict potential illegal access via links |
11 |
# |
12 |
fs.protected_hardlinks = 1 |
13 |
fs.protected_symlinks = 1 |
14 |
|
15 |
# |
16 |
# https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project#CONFIGs |
17 |
# |
18 |
|
19 |
# Try to keep kernel address exposures out of various /proc files (kallsyms, modules, etc). |
20 |
kernel.kptr_restrict = 1 |
21 |
|
22 |
# Avoid kernel memory address exposures via dmesg. |
23 |
kernel.dmesg_restrict = 1 |
24 |
|
25 |
# Block non-uid-0 profiling (needs distro patch, otherwise this is the same as "= 2") |
26 |
kernel.perf_event_paranoid = 3 |
27 |
|
28 |
# Turn off kexec, even if it's built in. |
29 |
kernel.kexec_load_disabled = 1 |
30 |
|
31 |
# Avoid non-ancestor ptrace access to running processes and their credentials. |
32 |
kernel.yama.ptrace_scope = 1 |
33 |
|
34 |
# Disable User Namespaces, as it opens up a large attack surface to unprivileged users. |
35 |
user.max_user_namespaces = 0 |
36 |
|
37 |
# Turn off unprivileged eBPF access. |
38 |
kernel.unprivileged_bpf_disabled = 1 |
39 |
|
40 |
# Turn on BPF JIT hardening, if the JIT is enabled. |
41 |
net.core.bpf_jit_harden = 2 |
42 |
|
43 |
|
44 |
-- |
45 |
Toralf |
46 |
PGP 23217DA7 9B888F45 |