fix: address gosec findings so main goes green - #34
Merged
Conversation
Two sites already carried //nolint:gosec, but that is golangci-lint syntax - gosec needs #nosec, so the documented intent never reached it. Added the correct annotation alongside the existing one: resources.go G101 an annotation key, not a credential checker_cmd.go G204 check.Target is operator-configured The two G104s are real and now handled: conn.Close() -> _ = conn.Close(), with a note that the probe has already succeeded so a close error is not actionable. A fifth finding was in dashboard/pages/template_form_templ.go, which templ generates. That is fixed upstream in xraph/workflows v1.11.0, which now passes -exclude-generated: a #nosec in generated code is erased on the next generation run, so scanning it only yields findings nobody can act on.
Bumps the six with published fixes: grpc 1.80.0->1.82.1, x/text 0.37->0.40, x/crypto 0.51->0.54, oras-go/v2 2.6.0->2.6.1, containerd 1.7.30->1.7.33, quic-go 0.59.0->0.59.1. Builds clean. GO-2026-5932 in x/crypto has no published fix, so govulncheck would keep CI red no matter how many others are cleared. Sets govulncheck-fail-on-findings: false (new in xraph/workflows v1.12.0) with the advisory named inline, so the scan still reports and the reason is revisitable rather than forgotten.
golangci-lint runs gosec, so it honours the #nosec annotations added in the previous commit - which made the older //nolint:gosec directives dead and tripped nolintlint. One suppression mechanism, understood by both tools.
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.
Two sites already carried //nolint:gosec, but that is golangci-lint syntax -
gosec needs #nosec, so the documented intent never reached it. Added the
correct annotation alongside the existing one:
resources.go G101 an annotation key, not a credential
checker_cmd.go G204 check.Target is operator-configured
The two G104s are real and now handled: conn.Close() -> _ = conn.Close(), with
a note that the probe has already succeeded so a close error is not actionable.
A fifth finding was in dashboard/pages/template_form_templ.go, which templ
generates. That is fixed upstream in xraph/workflows v1.11.0, which now passes
-exclude-generated: a #nosec in generated code is erased on the next
generation run, so scanning it only yields findings nobody can act on.