π‘οΈ Sentinel: Limit concurrent socket connections to prevent DoS#95
π‘οΈ Sentinel: Limit concurrent socket connections to prevent DoS#95
Conversation
Implements a semaphore to limit the number of concurrent connections handled by the daemon's Unix socket listener. This prevents local attackers from exhausting system resources (goroutines, memory) by opening a large number of connections. Limits concurrency to 50 active handlers. Clients beyond this limit will be queued by the OS socket backlog until a slot becomes available. Co-authored-by: minibota <1483356+minibota@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π Issue: The daemon's Unix socket listener (
startSocketListener) accepted an unlimited number of concurrent connections, spawning a new goroutine for each one. A local attacker could exploit this to exhaust system resources (Goroutines, memory), leading to a Denial of Service (DoS).π§ Risk: High. A malicious local user or a compromised process could crash the agent or make it unresponsive, preventing legitimate cron jobs from reporting their status or receiving updates.
π οΈ Fix: Introduced a semaphore (buffered channel) to limit the number of concurrent active socket handlers to 50 (
maxConcurrentConnections).π§ͺ Tests: Added
TestBoundedConcurrencyincmd/security_concurrency_test.go.π Notes: This PR was created by an automated nightly security task.
PR created automatically by Jules for task 618719565753858636 started by @minibota