awesome-everything RU
↑ Back to the climb

Networking & Protocols

Network security: config and log reading

Crux Read real config, a distributed rate-limiter snippet, an HTTP/2 server setting, and a WAF log line — predict the security behaviour and pick the highest-leverage fix.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Security incidents are diagnosed in config files, limiter code, and log lines — not in slide decks. Read each artifact, predict how it behaves under attack, and choose the fix a senior engineer would make first.

Goal

Practise the loop you run in every incident: read the artifact, find the gap between what it does and what the operator assumed, and reach for the highest-leverage change.

Snippet 1 — the SYN-flood sysctl

# /etc/sysctl.d/hardening.conf
net.ipv4.tcp_max_syn_backlog = 4096
net.core.somaxconn          = 4096
net.ipv4.tcp_synack_retries = 5
net.ipv4.tcp_syncookies     = 0   # disabled
Quiz

An ops engineer 'hardened' the host by growing the SYN backlog to 4096 and left tcp_syncookies=0. Under a spoofed SYN flood, what happens, and what is the highest-leverage fix?

Snippet 2 — the distributed token bucket

-- per-request limiter, called on every API hit
local count = redis.call("INCR", key)
if count == 1 then
  redis.call("EXPIRE", key, window_seconds)
end
if count > limit then
  return DENY
end
return ALLOW
Quiz

This Redis-backed limiter runs on every request across a fleet of app servers. Under a 100k req/sec attack, what is the operational problem, and what is the standard mitigation?

Snippet 3 — the HTTP/2 server config

http2_max_concurrent_streams 128;
# no limit on the rate of stream creation / reset
keepalive_requests 100000;
Quiz

This config caps concurrent streams at 128 but never limits the rate of stream creation. Why does it stay vulnerable to HTTP/2 Rapid Reset (CVE-2023-44487)?

Snippet 4 — the WAF anomaly-score log

14:23 | req=45000/s  | score-p50=0.5 | score-p99=8.1  | threshold=5
14:24 | req=120000/s | score-p50=6.1 | score-p99=28.5 | threshold=5
14:25 | req=450000/s | score-p50=12.3| score-p99=32.1 | threshold=5
14:26 | blocked=380000 allowed=70000 | threshold=5
Quiz

Reading this WAF anomaly-scoring timeline (block when score ≥ threshold=5), which reading is correct?

Recap

Every defense is read in config and logs. A bigger SYN backlog is linear headroom; SYN cookies are the structural fix. A Redis limiter is correct but every decision is a round-trip — mitigate with a local fast path plus periodic sync. Concurrency caps do not stop Rapid Reset; you must bound stream-creation rate including resets. And a WAF anomaly log tells you, at a glance, whether the score distribution has shifted into attack territory and whether your threshold is letting traffic through. Read the artifact, find the gap between intent and behavior, fix the highest-leverage one first.

Continue the climb ↑Network security: survive a layered DDoS
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.