Problem
Several CLI commands use http.DefaultClient with no timeout. If snare.sh is unreachable, the CLI hangs forever. Affects snare events, snare test, snare status, and the arm/disarm registration calls.
Fix
Replace http.DefaultClient with a client that has a 15-30s timeout, or use context.WithTimeout on all outbound requests.
client := &http.Client{Timeout: 15 * time.Second}
Affected files
internal/cli/cli.go
internal/serve/serve.go
Problem
Several CLI commands use
http.DefaultClientwith no timeout. If snare.sh is unreachable, the CLI hangs forever. Affectssnare events,snare test,snare status, and the arm/disarm registration calls.Fix
Replace
http.DefaultClientwith a client that has a 15-30s timeout, or usecontext.WithTimeouton all outbound requests.Affected files
internal/cli/cli.gointernal/serve/serve.go