Skip to content

Commit 83c9ee0

Browse files
committed
Replace lockdown with hardening-runtime
1 parent 56d280d commit 83c9ee0

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

modules/ocf/manifests/browser_sandbox.pp

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# defense in depth, but not critical. See
1414
# <https://www.morbo.org/2018/05/linux-sandboxing-improvements-in_10.html>.
1515
'kernel.unprivileged_userns_clone':
16-
value => '1';
16+
ensure => absent;
1717
# Enable ptrace protection. Only allow ptrace from a parent process to its
18-
# children or via CAP_SYS_PTRACE.
18+
# children or via CAP_SYS_PTRACE. This is also set by hardening-runtime.
1919
'kernel.yama.ptrace_scope':
2020
value => '1';
2121
}

modules/ocf/manifests/packages/kernel.pp

+21-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
class ocf::packages::kernel {
22
if $::lsbdistcodename != 'stretch' {
3-
# Disable some kernel features: module loading after boot, kexec,
4-
# Berkeley Packet Filter (BPF). Not to be confused with the lockdown
5-
# security module introduced with Linux 5.4, which imposes similar
6-
# restrictions.
7-
package { 'lockdown': }
3+
# Harden kernel using kernel command line options and sysctl settings
4+
# recommended by the Kernel Self Protection Project:
5+
# https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
6+
# Tails makes similar changes:
7+
# https://tails.boum.org/contribute/design/kernel_hardening/
8+
# kernel command line changes - potential performance impact:
9+
# * always enable kernel address space layout randomization (KASLR)
10+
# * always enable kernel page-table isolation (PTI, formerly KAISER)
11+
# * wipe slab and page allocations and enable sanity checks
12+
# * disable simultaneous multithreading (SMT) aka hyperthreading (HT)
13+
# sysctl changes:
14+
# * disable kexec
15+
# * restrict ptrace access to parent processes
16+
# * disable user namespaces
17+
# currently breaks systemd services specifying PrivateUsers=yes,
18+
# such as upower on bullseye, see
19+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=959884
20+
# * disable unprivileged Berkeley Packet Filter (BPF) access
21+
# For bullseye, also consider enabling the lockdown security module
22+
# introduced with Linux 5.4.
23+
package { 'hardening-runtime': }
824

925
if $::is_virtual {
1026
# Install cloud kernel image which removes some hardware support.

0 commit comments

Comments
 (0)