fix(lint): re-enable the gosec G402 rule - #15540
Open
Coder-in-a-shell wants to merge 1 commit into
Open
Conversation
`G402: TLS MinVersion too low` was excluded in linkerd#9693 to work around a gosec false positive, with the exclusion documented as temporary until golangci-lint moved past v1.50.1 (gosec v2.13.1 -> v2.14.0). That upgrade happened long ago -- CI now runs golangci-lint v1.64.8 via the `ghcr.io/linkerd/dev:v50-go` image -- so the workaround is obsolete. Removes the exclusion. No code changes are needed: linting the tree with the rule re-enabled reports no G402 findings. Fixes linkerd#9700 Signed-off-by: Sudhir Jaiswal <jaiswalsudhir2944@gmail.com>
raykroeker
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
G402: TLS MinVersion too lowhas been excluded from gosec since #9693. The exclusion was explicitly temporary — the comment says to revert it once golangci-lint moved past v1.50.1, which brought in the gosec v2.13.1 → v2.14.0 fix for the false positive:That upgrade landed long ago. CI runs golangci-lint v1.64.8 (via
ghcr.io/linkerd/dev:v50-go, which installscmd/golangci-lint@latest), so the workaround is dead weight and a real TLS misconfiguration would currently go unreported.Solution
Delete the exclusion. No code changes were needed.
Validation
Run with golangci-lint v1.64.8 to match the dev image.
1. Baseline on
main— clean:2. With the exclusion removed — still clean, so there are no real G402 violations to fix:
3. Confirmed the rule actually fires rather than the removal being a no-op. Temporarily added:
4. Confirmed the exclusion was genuinely suppressing it — restoring the old config and re-running against the same probe reports nothing.
The probe file was removed before committing; the diff is the 8-line config deletion only.
Fixes #9700
Signed-off-by: Sudhir Jaiswal jaiswalsudhir2944@gmail.com