Server-Hardening/sysctl.conf

92 lines
3.1 KiB
Plaintext
Raw Permalink Normal View History

#-kernel.sched_energy_aware = 0
dev.tty.ldisc_autoload = 0
fs.binfmt_misc.status = 0
fs.file-max = 2097152
fs.protected_fifos = 2
fs.protected_regular = 2
kernel.io_uring_disabled = 1
kernel.io_uring_group = 2000
kernel.kexec_load_disabled = 1
kernel.kptr_restrict = 2
kernel.panic = -1
kernel.panic_on_oops = 1
kernel.unprivileged_bpf_disabled = 1
kernel.unprivileged_userns_clone = 0
kernel.yama.ptrace_scope = 2
net.core.bpf_jit_harden = 2
net.core.netdev_max_backlog = 5000
net.core.optmem_max = 40960
net.core.rmem_default = 262144
net.core.rmem_max = 16777216
net.core.somaxconn = 1024
net.core.wmem_default = 262144
net.core.wmem_max = 16777216
net.ipv4.conf.*.accept_redirects = 0
net.ipv4.conf.*.rp_filter = 0
net.ipv4.conf.*.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.log_martians = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.neigh.default.gc_thresh1 = 1024
net.ipv4.neigh.default.gc_thresh2 = 2048
net.ipv4.neigh.default.gc_thresh3 = 4096
net.ipv4.tcp_ecn = 1
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_mem = 50576 64768 98152
net.ipv4.tcp_notsent_lowat = 131072
net.ipv4.tcp_orphan_retries = 6
net.ipv4.tcp_retries2 = 8
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_shrink_window = 1
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_syn_retries = 4
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_synack_retries = 3
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv6.bindv6only = 1
net.ipv6.conf.*.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.all.log_martians = 1
net.ipv6.conf.all.rp_filter = 1
net.ipv6.conf.default.accept_redirects = 0
net.ipv6.conf.default.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0
net.ipv6.conf.default.log_martians = 1
net.ipv6.conf.default.rp_filter = 1
net.mptcp.enabled = 0
net.netfilter.nf_conntrack_expect_max = 1
net.netfilter.nf_conntrack_max = 262144
net.netfilter.nf_conntrack_tcp_loose = 0
net.netfilter.nf_conntrack_tcp_timeout_established = 14400
net.netfilter.nf_conntrack_tcp_timeout_established = 1800
net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 15
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 31
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 60
net.netfilter.nf_conntrack_udp_timeout = 15
net.netfilter.nf_conntrack_udp_timeout_stream = 15
vm.mmap_rnd_bits = 32
vm.mmap_rnd_compat_bits = 16