Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set net.ipv4 sysctl flags via server metapackage #55

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions debian/securedrop-grsec/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ start_paxctld() {
sleep 1
}

cleanup_sysctld() {
# Remove settings previously set by ansible that are now set via
# our sysctl.d/30-securedrop.conf file
sed -i '/^vm\.heap_stack_gap/d' /etc/sysctld.conf
sed -i '/^net\.ipv4\./d' /etc/sysctld.conf
}

case "$1" in
configure)
# Configure paxctld, required before update-grub runs
start_paxctld
# Ensure latest grsec kernel is used on every boot.
set_grub_default
# Remove sysctld configuration
cleanup_sysctld
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
15 changes: 15 additions & 0 deletions debian/securedrop-grsec/etc/sysctl.d/30-securedrop.conf
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
vm.heap_stack_gap=1048576

net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0