Why this matters
Controlled timeouts improve availability and detectability, aligning with SOC 2 availability criteria.
Use context.WithTimeout for HTTP and DB calls; log request deadlines and results; treat timeouts as audit-worthy events.
Controlled timeouts improve availability and detectability, aligning with SOC 2 availability criteria.
Side-by-side examples engineers can pattern-match during review.
resp, _ := http.DefaultClient.Get(url)ctx, cancel := context.WithTimeout(r.Context(), 5time.Second); defer cancel(); req = req.WithContext(ctx); resp, err := client.Do(req)context.WithTimeout(ctx, 5time.Second)context.Background()From the same buckets as this rule.
Public services must require TLSv1.2 or higher and set HSTS (max-age ≥ 15552000, includeSubDomains). Reject plaintext HTTP and weak ciphers; cookies must be Secure and HttpOnly with SameSite set.