ci(security): run govulncheck on every PR - #212
Merged
Merged
Conversation
This was referenced Sep 1, 2026
Contributor
Author
j-rafique
approved these changes
Sep 1, 2026
mateeullahmalik
added a commit
to LumeraProtocol/supernode
that referenced
this pull request
Sep 9, 2026
Ports the three CI security/lint gates from the chain repo to supernode: - govulncheck (LumeraProtocol/lumera#212) - gosec (LumeraProtocol/lumera#213) - golangci-lint via reviewdog, diff-only (LumeraProtocol/lumera#126) Same tools, same flags, same goals, adapted to this repo's layout. Repo-specific adaptations: * Multi-module matrix. supernode has four Go modules (root, cmd/sncli, sn-manager, tests/system) where the chain repo has three. gosec and govulncheck each run per-module from that module's directory, because a root ./... invocation does not analyze nested modules. fail-fast is disabled so one module's findings cannot hide another's. * golangci-lint pinned to v2.13.2 rather than the chain's v2.11.3. go.mod declares go 1.26.2 and golangci-lint must be BUILT with a Go >= the targeted language version; v2.11.3 is built with go1.26.1. * .golangci.yml is new here (the repo had no lint config). Same linter set as the chain repo; exclusions retarget generated protobuf/mock surfaces instead of Cosmos SDK deprecations. * Uses the existing ./.github/actions/setup-env composite action, which installs libwebp-dev — required for the root module to type-check. Without it gosec fails SSA construction instead of reporting a clean scan. gosec baseline is clean on all four modules (0 findings, 0 SSA errors). Reaching that required five narrow suppressions, each rule-scoped and justified, at intentional trust boundaries: - G108 gateway/server.go: net/http/pprof registers on DefaultServeMux, which this server never serves. pprof routes are on a private mux, only registered when pprofEnabled, and the handlers re-check and return 403. - G703 x4: operator-selected config paths (own $HOME / explicit --config) and a system-test harness writing to a directory it created itself. No runtime behavior changes: the only non-CI edits are comments. Verification: - gosec: 0 issues / 0 SSA errors across all four modules - mutation probe (deliberate G703 taint) => gosec exits 1 and reports G703, proving the gate is non-vacuous; fixture removed - go build ./..., go vet ./pkg/..., and unit tests all pass - all workflow YAML parses; every pinned action ref verified to exist
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.
Behavior change
Adds a dedicated Go Vulnerability Scan workflow that runs:
The workflow runs on:
pull_request/openedactivity;pull_request/synchronize;pull_request/reopenedactivity;master.There are deliberately no path filters, advisory flags, baselines, or
continue-on-errorsettings. Reachable findings fail the job.Rationale
The repository already exposes
make vulncheck, but no workflow on currentmasterexecutes it. This makes reachable Go vulnerabilities visible on every PR and enforces them as a hard CI failure.The workflow uses Lumera's existing checkout and local setup-Go actions. It invokes the CLI directly rather than
golang/govulncheck-action, avoiding the duplicate internal-checkout/Authorization-header failure encountered in the older PR #126 attempt.Current baseline / expected initial result
A local execution against this exact commit using Go 1.26.2 and
govulncheck v1.7.0completed successfully as a scanner invocation and exited3because it found 22 reachable vulnerabilities from 8 modules and the Go standard library.Per rollout decision, this is a strict hard gate. The initial GitHub check is therefore expected to be red until those findings are remediated; they are not suppressed or converted to advisory output in this PR.
Risks
govulncheckjob while the current reachable findings remain.@latestallows scanner updates to change results without a repository commit. This matches the existing Makefile tool declaration and ensures new checks/database behavior are picked up, but reduces tool-version reproducibility.Rollback strategy
Revert this one-file commit or disable/remove
.github/workflows/govulncheck.yml. No chain binary or state rollback is involved.Migration / upgrade impact
None. This is CI-only:
Observability
GitHub Actions exposes a distinct
govulncheckcheck run and retains the full finding traces in its job log. A nonzero scanner exit is visible as a failed check.Verification
Executed on immutable commit
cc108247c096e56f95953bb9c4140bd8e9252f8b:actionlint .github/workflows/govulncheck.yml— PASSgit diff --check— PASS3, 22 reachable vulnerabilitiesmake unit-tests NOCACHE=1— PASSmake integration-tests NOCACHE=1— PASSmake test-scripts— PASS (195 tests)(cd devnet && go test ./tests/common -count=1)— PASSmake installpluscmp build/lumerad "$(command -v lumerad)"— PASSmake system-tests— PASSmake systemex-tests— PASS (1040.311s)make lint— PASS (0 issues)