Repository navigation
ci: document how the embedded gosec policy differs from the standalone gate - #2246
Conversation
…e gate The standalone gate (scripts/run-gosec.sh, v2.28.0, used by CI, pre-commit and Make) runs all rules at all severities with no config and skips test files by default. The embedded golangci gosec excludes G104, requires medium severity and confidence, drops G301/G302/G304 via the legacy and common-false-positives presets, and excludes _test.go. Both honor #nosec. Fixture (scratch module, golangci-lint v2.10.1 vs gosec v2.28.0): - golangci: G501 main.go:4, G401 main.go:14, G115 main.go:16 - standalone: the same three plus G304 :17, G302 :21, G301 :22 and G104 :10/:22; the #nosec G304 line was suppressed in both; the _test.go file was not reported by either. The embedded set is a strict subset, so no config changes: the standalone gate is not loosened and golangci is not tightened. Only a comment is added next to the gosec settings. Closes #2152 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 38 minutes for your next included review. View limit details
Comment |
Independent review verdict: CLEAN at da334d6Reviewer: fresh Claude agent (Sonnet, high effort), not the author, cold brief. Coordinator: claude-cc-reviewer. Comment-only: the diff of Claims checked against the config:
Notes (non-blocking):
Gate: labels are mirrored from #2152. Merge once CI is green and the CodeRabbit gate is met. (claude-cc-reviewer) |
|
CR waived: quota, adversarial review + local verification + green CI (per CLAUDE.md:172-173). CodeRabbit posted 'Review limit reached'. Gate at da334d6: CLEAN verdict, CI green, mergeability CLEAN. (claude-cc-reviewer) |
Closes #2152
Summary
I compared the gosec linter embedded in golangci-lint against the standalone gosec gate,
scripts/run-gosec.sh, which CI, pre-commit andmake security-scan-goall use. The embedded set turns out to be a deliberate subset of the standalone gate. Neither has a mistake to fix, so this PR documents the difference instead of changing either one. It adds a 7-line comment above the gosec settings in.golangci.ymland changes no config values.run-gosec.sh).golangci.yml:52-53); thelegacyandcommon-false-positivespresets also drop G301/G302/G304, among others:54-55)_test.goexcluded (:94-99)-testsdefaults to false)_gen.goandgenerated: laxexcluded#nosecThe comment states that a clean golangci run does not imply a clean gosec run, and names
scripts/run-gosec.shas the enforcing gate. Nothing about the security gate changes.Evidence
#nosec G304line._test.gofile.golangci-lint run ./...reports 0 issues,golangci-lint config verifypasses,pre-commit run --files .golangci.ymlpasses, andscripts/test-git-secrets-allowlist.shpasses 44/44..golangci.yml,run-gosec.sh, and the golangci-lint v2.10.1 preset source (exclusion_presets.go), across two passes. No actionable findings at ef116d2f.🤖 Generated with Claude Code