Bottlerocket
TMA-BOTTLEROCKET-3.2.7
Ensure TCP SYN Cookies is enabled
Description
When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. The audit reads the running value from /proc/sys. Run tmaegis on the host through the admin container root shell (sudo sheltie).
How it is checked
Audit method: Shell command
bad=0
chk() { f=/proc/sys/$(printf %s "$1" | tr . /); v=$(cat "$f" 2>/dev/null) || { echo "$1: not readable"; bad=1; return; }; [ "$v" = "$2" ] || { echo "$1 = $v (expected $2)"; bad=1; }; }
chk net.ipv4.tcp_syncookies 1
[ "$bad" -eq 0 ] && echo compliant- Expected output
compliant
How it is fixed
Fix method: Guidance or infrastructure patch
Run the following command to set the active kernel parameter and persist the setting: # apiclient apply <<EOF [settings.kernel.sysctl] "net.ipv4.tcp_syncookies" = "1" EOF Run the following command to flush the routing cache: # sysctl -w net.ipv4.route.flush=1
Properties
- Operating systems
- Any
- Tags
- bottlerocketnetwork
- Reference
- CIS Bottlerocket Benchmark v1.0.0 - 3.2.7 Ensure TCP SYN Cookies is enabled
Check this host
Run this on a machine you are allowed to audit. The scan is read-only.
tmaegis scan --target bottlerocket