Files
homelab/config/sysctl/99-security.conf
Arpad Krejczinger 5e714f4e45 Add SSH hardening and kernel security configurations
- config/ssh/sshd_config_hardening: Enhanced SSH security settings
- config/ssh/banner: Legal warning banner for SSH connections
- config/sysctl/99-security.conf: Kernel network and memory protection parameters
- Includes deployment instructions for system-level hardening
2025-09-12 20:38:21 +02:00

36 lines
1.1 KiB
Plaintext

# Kernel Security Parameters for Homelab
# Deploy to: /etc/sysctl.d/99-security.conf
#
# Setup commands:
# sudo cp config/sysctl/99-security.conf /etc/sysctl.d/
# sudo sysctl -p /etc/sysctl.d/99-security.conf
# Network security
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
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.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_syn_retries = 3
net.ipv4.tcp_synack_retries = 3
# IPv6 security (if enabled)
net.ipv6.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
# Memory protection
kernel.dmesg_restrict = 1
kernel.kptr_restrict = 1
kernel.yama.ptrace_scope = 1