Skip to content
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ configuration file and significant hardening is applied to a myriad of component

- Disable TCP timestamps as they can allow detecting the system time.

- Disable reuse of `TIME_WAIT` sockets for new outgoing connections as the above
setting disables TCP timestamps.

- Optional - Log packets with impossible source or destination addresses to
enable further inspection and analysis.

Expand Down
10 changes: 10 additions & 0 deletions usr/lib/sysctl.d/990-security-misc.conf#security-misc-shared
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,16 @@ net.ipv6.conf.*.accept_ra=0
##
net.ipv4.tcp_timestamps=0

## Disable reuse of TIME_WAIT sockets for new outgoing connections.
## The safety of reusing of TIME_WAIT sockets requires enabling TCP timestamps.
## The kernel uses timestamps to verify a new connection is not a duplicate segment from an older connection.
## Hence TIME-WAIT sockets should wait the full timeout period before being made available again.
## Can lead to port exhaustion on high-traffic networks with numerous short-lived connections.
##
## https://vincent.bernat.ch/en/blog/2014-tcp-time-wait-state-linux
##
net.ipv4.tcp_tw_reuse=0

## Enable logging of packets with impossible source or destination addresses.
## Martian and unroutable packets may be used for malicious purposes.
## Recommended to keep a (kernel dmesg) log of these to identify suspicious packets.
Expand Down