From 2923fc96ef9ee96a3149c8b2f781402c65e106b9 Mon Sep 17 00:00:00 2001 From: madaidan <50278627+madaidan@users.noreply.github.com> Date: Mon, 6 May 2019 15:45:53 +0000 Subject: [PATCH] Create tcp_hardening.conf --- etc/sysctl.d/tcp_hardening.conf | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 etc/sysctl.d/tcp_hardening.conf diff --git a/etc/sysctl.d/tcp_hardening.conf b/etc/sysctl.d/tcp_hardening.conf new file mode 100644 index 0000000..dcc8afb --- /dev/null +++ b/etc/sysctl.d/tcp_hardening.conf @@ -0,0 +1,23 @@ +## TCP/IP stack hardening + +# Protects against time-wait assassination. It drops RST packets for sockets in the time-wait state. +net.ipv4.tcp_rfc1337=1 + +# Enables source validation of packets and protects against IP spoofing methods. +net.ipv4.conf.default.rp_filter=1 +net.ipv4.conf.all.rp_filter=1 + +# Disables ICMP redirect acceptance. +net.ipv4.conf.all.accept_redirects=0 +net.ipv4.conf.default.accept_redirects=0 +net.ipv4.conf.all.secure_redirects=0 +net.ipv4.conf.default.secure_redirects=0 +net.ipv6.conf.all.accept_redirects=0 +net.ipv6.conf.default.accept_redirects=0 + +# Disables ICMP redirect sending. +net.ipv4.conf.all.send_redirects=0 +net.ipv4.conf.default.send_redirects=0 + +# Ignores ICMP requests +net.ipv4.icmp_echo_ignore_all=1