Skip to content

Commit e6fd450

Browse files
committed
Add kernel.randomize_va_space = 2
Signed-off-by: Tommy <[email protected]>
1 parent b9c7b89 commit e6fd450

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

etc/sysctl.d/99-server.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ kernel.unprivileged_userns_clone = 0
5151
# Needed for gVisor, which is used on almost all of my servers.
5252
kernel.yama.ptrace_scope = 1
5353

54+
# https://www.kernel.org/doc/Documentation/sysctl/kernel.txt
55+
# Use strongest ALSR mode
56+
kernel.randomize_va_space = 2
57+
5458
# https://madaidans-insecurities.github.io/guides/linux-hardening.html#sysctl
5559
# Restrict performance events from unprivileged users as much as possible.
5660
# We are using 4 here, since Ubuntu supports such a level.

etc/sysctl.d/99-workstation.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ kernel.unprivileged_userns_clone = 1
4545
# Disable ptrace. Not needed on workstations.
4646
kernel.yama.ptrace_scope = 3
4747

48+
# https://www.kernel.org/doc/Documentation/sysctl/kernel.txt
49+
# Use strongest ALSR mode
50+
kernel.randomize_va_space = 2
51+
4852
# https://madaidans-insecurities.github.io/guides/linux-hardening.html#sysctl
4953
# Restrict performance events from unprivileged users as much as possible.
5054
# We are using 4 here, since Ubuntu supports such a level.

0 commit comments

Comments
 (0)