Skip to content

Fix repeated incomplete-handshake false positives - #78

Merged
awlx merged 1 commit into
mainfrom
awlx-fix-handshake-false-positives
Aug 9, 2026
Merged

Fix repeated incomplete-handshake false positives#78
awlx merged 1 commit into
mainfrom
awlx-fix-handshake-false-positives

Conversation

@awlx

@awlx awlx commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • expire pending TCP handshakes after a 3-second monotonic timeout and consume each stale map entry exactly once
  • use two-phase eBPF map iteration/deletion for both IPv4 and IPv6, avoiding unsafe deletion during hash-map iteration
  • emit evidence only when cleanup successfully consumes the entry, so a concurrently completed handshake is not reported
  • preserve per-poll rate semantics and include the timeout and observation window in signal metadata
  • prevent aggregate snapshots from training per-connection timing, ASN baselines, clock skew, or entropy while retaining them as detection/reputation evidence

Root cause

A SYN whose final ACK was not observed remained in pending_handshakes indefinitely. The collector emitted that same entry on every one-second map poll, and the analyzer interpreted the polling cadence as client connection timing. Repeated snapshots therefore produced incomplete_handshake + timing_pattern detections for ordinary traffic and mechanically raised confidence.

Safety

The change is symmetric for IPv4 and IPv6. It does not make enforcement stricter, alter dry-run behavior, or change eBPF programs. Deploy in dry-run first and confirm the repeated signature collapses before considering enforcement.

Validation

  • go test -race ./pkg/collector ./pkg/analyzer ./pkg/patterns
  • make portable-test
  • make analyzer
  • make yeetctl
  • git diff --check

Linux CI is still required for collector/eBPF build, verifier/runtime, and HAProxy end-to-end coverage because the local host is macOS.

@awlx
awlx merged commit c39ea14 into main Aug 9, 2026
4 checks passed
awlx added a commit that referenced this pull request Aug 9, 2026
Fix repeated incomplete-handshake false positives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant