Interview Prep/Linux/Security, hardening and incident response

You need to apply kernel network hardening settings to all servers. Which sysctls and how?

IntermediateScenarioSecurity, hardening and incident response
Answer

Situation read → Persistent sysctl drop-in.

What I'd do → /etc/sysctl.d/60-net-hardening.conf:

net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.all.log_martians = 1
kernel.kptr_restrict = 2
kernel.dmesg_restrict = 1

Apply with sudo sysctl --system.

Why → These stop spoofing, ICMP redirect attacks and SYN floods, and hide kernel pointers.

Interview tip → Don't disable ip_forward on Kubernetes nodes or routers; know your host's role.

All Linux questions Roadmap: Linux

More on Security, hardening and incident response