fix(security): use #nosec so the standalone gosec scan sees the suppressions - #4
Merged
Conversation
…essions The Security Scan job runs gosec directly, and gosec only honours its own #nosec directive -- it does not read //nolint:gosec, which is what golangci-lint consumes. All fourteen call sites were already suppressed with a written justification, so the Lint job passed while Security Scan reported the same fourteen findings. Switched to the '// #nosec <rule> -- <reason>' form already used in utils/hash.go, keeping every justification. No code changed.
isaquepinheiro
merged commit Jul 22, 2026
938fcd6
into
feature/pubpascal-cra-compliance
7 checks passed
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.
Deixa o
Security Scanverde. Nenhuma linha de código muda — só a sintaxe das supressões.O problema
O job
Security Scanroda ogosecavulso, e ele só entende a diretiva própria// #nosec. Ele não lê//nolint:gosec, que é o que ogolangci-lintconsome.Resultado: os 14 call sites já estavam suprimidos com justificativa escrita, o job
Lintpassava verde, e oSecurity Scanreportava os mesmos 14 achados (7× G204, 5× G304, 1× G117, 1× G703).O conserto
Troca para a forma
// #nosec <regra> -- <motivo>, que é a que o próprio repositório já usa emutils/hash.go:37. Cada justificativa foi mantida palavra por palavra.14 linhas: 13 em
pubpascal.go, 1 emcontribute.go.Verificação
CI completo rodado neste branch (via PR temporário #3), 5 de 5 verdes:
Local:
go build ./...,go vet ./...,go test ./...limpos.go tool golangci-lint runsem achados nos arquivos deste PR (os 12 restantes são_win.gopré-existentes do upstream, que o CI Linux não compila).A base é
feature/pubpascal-cra-compliance, que é oheaddo HashLoad#263. Mergear aqui atualiza aquele PR na hora e dispara o CI da HashLoad — que deve fechar os 5 checks verdes, encerrando oSecurity Scanvermelho que apareceu depois do merge do #1.