Commit a070b72
committed
security: fix remaining CodeQL insecure TLS configuration alerts
Address the final 3 CodeQL security alerts for 'Insecure TLS configuration':
**Root Cause**:
CodeQL detected that setting or
would result in , which is insecure
(TLS version 0).
**Security Fix**:
- When or is specified, don't set
the TLS version at all - let Go use its secure defaults
- Only set explicit TLS versions when they are >= TLS 1.2 (secure)
- Applied fix consistently across all client types
**Files Fixed**:
- options.go (lines 609, 620) - Single client
- osscluster.go (lines 336, 350) - Cluster client
- sentinel.go (lines 446, 460) - Sentinel client
**Security Behavior**:
- → Don't set MinVersion (Go default: secure)
- → Error: insecure, minimum TLS 1.2 required
- → Set explicit secure version
- Same logic applies to
**Test Coverage**:
- Added test case for behavior
- Verified all security validation tests pass
- Confirmed no regression in functionality
This resolves all remaining CodeQL security alerts while maintaining
secure defaults and clear error messages for insecure configurations.1 parent 85cfa2d commit a070b72
4 files changed
+39
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
602 | 602 | | |
603 | 603 | | |
604 | 604 | | |
605 | | - | |
606 | | - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
607 | 609 | | |
| 610 | + | |
| 611 | + | |
608 | 612 | | |
609 | | - | |
610 | 613 | | |
611 | 614 | | |
612 | 615 | | |
613 | 616 | | |
614 | 617 | | |
615 | 618 | | |
616 | | - | |
617 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
618 | 623 | | |
| 624 | + | |
| 625 | + | |
619 | 626 | | |
620 | | - | |
621 | 627 | | |
622 | 628 | | |
623 | 629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
334 | 336 | | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | | - | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
343 | | - | |
344 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
345 | 350 | | |
| 351 | + | |
| 352 | + | |
346 | 353 | | |
347 | | - | |
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
444 | 446 | | |
| 447 | + | |
| 448 | + | |
445 | 449 | | |
446 | | - | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
452 | 455 | | |
453 | | - | |
454 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
455 | 460 | | |
| 461 | + | |
| 462 | + | |
456 | 463 | | |
457 | | - | |
458 | 464 | | |
459 | 465 | | |
460 | 466 | | |
| |||
0 commit comments