Skip to content

Commit 37f1827

Browse files
committed
Drop setting vm.heap_stack_gap and net.ipv4 sysctl flags
These are now set via the securedrop-grsec metapackage (see <freedomofpress/kernel-builder#55>). Tests are left in to verify the migration works properly. Refs #7323.
1 parent eb39e65 commit 37f1827

File tree

6 files changed

+3
-51
lines changed

6 files changed

+3
-51
lines changed

install_files/ansible-base/roles/common/defaults/main.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,6 @@ disabled_kernel_modules:
55
- iwlmvm
66
- iwlwifi
77

8-
sysctl_flags:
9-
- name: "net.ipv4.tcp_max_syn_backlog"
10-
value: "4096"
11-
- name: "net.ipv4.tcp_syncookies"
12-
value: "1"
13-
- name: "net.ipv4.conf.all.rp_filter"
14-
value: "1"
15-
- name: "net.ipv4.conf.all.accept_source_route"
16-
value: "0"
17-
- name: "net.ipv4.conf.all.accept_redirects"
18-
value: "0"
19-
- name: "net.ipv4.conf.all.secure_redirects"
20-
value: "0"
21-
- name: "net.ipv4.conf.default.rp_filter"
22-
value: "1"
23-
- name: "net.ipv4.conf.default.accept_source_route"
24-
value: "0"
25-
- name: "net.ipv4.conf.default.accept_redirects"
26-
value: "0"
27-
- name: "net.ipv4.conf.default.secure_redirects"
28-
value: "0"
29-
- name: "net.ipv4.icmp_echo_ignore_broadcasts"
30-
value: "1"
31-
- name: "net.ipv4.ip_forward"
32-
value: "0"
33-
- name: "net.ipv4.conf.all.send_redirects"
34-
value: "0"
35-
- name: "net.ipv4.conf.default.send_redirects"
36-
value: "0"
37-
388
unused_packages:
399
- libiw30
4010
- wireless-tools

install_files/ansible-base/roles/common/tasks/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
- include_tasks: remove_unused_packages.yml
2424

25-
- include_tasks: sysctl.yml
26-
2725
- include_tasks: disable_swap.yml
2826

2927
- include_tasks: remove_kernel_modules.yml

install_files/ansible-base/roles/common/tasks/sysctl.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

install_files/ansible-base/roles/grsecurity/defaults/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ grsec_sysctl_flags:
66
# rest will not be applied
77
- name: "kernel.grsecurity.grsec_lock"
88
value: "1"
9-
# Stack clash mitigation, increasing main stack gap to 1MB.
10-
# Storing as part of grsecurity vars, because sysctl option won't
11-
# exist otherwise.
12-
- name: "vm.heap_stack_gap"
13-
value: "1048576"

molecule/testinfra/common/test_grsecurity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def test_grsecurity_kernel_is_running(host):
8181
[
8282
("kernel.grsecurity.grsec_lock", 1),
8383
("kernel.grsecurity.rwxmap_logging", 0),
84+
# set via securedrop-grsec (in kernel-builder)
8485
("vm.heap_stack_gap", 1048576),
8586
],
8687
)

molecule/testinfra/common/test_system_hardening.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def test_sysctl_options(host, sysctl_opt):
3030
"""
3131
Ensure sysctl flags are set correctly. Most of these checks
3232
are hardening IPv4, which is appropriate due to the heavy use of Tor.
33+
34+
These are all set via securedrop-grsec (in kernel-builder).
3335
"""
3436
with host.sudo():
3537
assert host.sysctl(sysctl_opt[0]) == sysctl_opt[1]

0 commit comments

Comments
 (0)