Files
google-labs-jules[bot] 45d1bae2fd Mitigate DoS by limiting concurrent handshakes
This commit introduces mechanism to limit the number of concurrent SSH
handshakes to prevent resource exhaustion (goroutines/memory) during a
SYN flood or connection flood attack.

1.  **Global Limit:** A semaphore limits total concurrent handshakes to 20.
    This applies backpressure to the `Accept` loop.
2.  **Per-IP Limit:** Using `github.com/sethvargo/go-limiter`, we now
    limit the rate of connection attempts per IP to 3 per second.
3.  **Timeout:** The initial handshake timeout is reduced from 20s to 10s.

The global semaphore is acquired before the handshake and released
immediately after the handshake completes (or fails), ensuring that
long-lived sessions do not consume a handshake slot.
2025-12-01 20:00:37 +00:00
..
2022-01-06 09:09:51 -05:00
2019-02-24 09:40:47 -06:00
2022-01-06 09:09:51 -05:00
2020-04-12 12:37:55 -04:00