Skip to content

ci: bump gosec to v2.28.0, retire obsolete #nosec suppressions (closes #1382) - #1384

Merged
cristim merged 2 commits into
mainfrom
ci/gosec-bump-retire-nosec
Jul 17, 2026
Merged

ci: bump gosec to v2.28.0, retire obsolete #nosec suppressions (closes #1382)#1384
cristim merged 2 commits into
mainfrom
ci/gosec-bump-retire-nosec

Conversation

@cristim

@cristim cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Bumps the gosec pin in the Security Scanning CI job from v2.26.1 to v2.28.0 (latest release).
  • Retires 10 #nosec annotations that gosec v2.28.0 no longer requires, verified by temporarily removing each annotation and re-running gosec on its module.
  • Posts a comment on the open PR ci(pre-commit): pinned gosec hook on changed packages (closes #1374) #1376 (pre-commit gosec hook) asking that its pin be aligned to v2.28.0 when it lands.

Annotation audit: before vs after

Outcome Count Rules Location
Retired 4 G201 (SQL format string) internal/analytics/postgres_analytics.go
Retired 2 G201 internal/api/analytics_postgres.go
Retired 2 G101 (hardcoded cred) internal/email/templates.go
Retired 1 G101 internal/credentials/resolver.go:27 (azure_client_secret constant only)
Partial update 1 G122 removed from G304,G122 internal/deploy/frontend.go (G304 kept; G122 not a recognized rule)
Total retired/cleaned 10
Kept ~69 G302/G304/G404/G115/G101/G505/G703/G702/G704/G705/G706/G104/G204/G117 all remaining annotations still trigger with v2.28.0

G201 was removed from gosec entirely between v2.26.1 and v2.28.0. G101 refinement means email copy text containing "password" and the azure_client_secret type-name constant are no longer flagged.

Test plan

  • gosec v2.28.0 on all 6 modules (root, pkg, providers/aws, providers/azure, providers/gcp, tests/e2e): 0 findings each
  • go build ./... and go vet ./... on root and pkg: clean
  • go test on all touched packages (internal/analytics, internal/api, internal/email, internal/credentials, internal/deploy): pass
  • YAML parse of ci.yml: OK
  • CI passes on this PR

@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/this-quarter Within the quarter impact/internal Team-internal only effort/s Hours type/chore Maintenance / non-user-visible labels Jul 16, 2026
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7f2a36f5-43de-44c0-8a6e-5c411ac9d6fc

📥 Commits

Reviewing files that changed from the base of the PR and between 8f9347e and e128700.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • internal/analytics/postgres_analytics.go
  • internal/api/analytics_postgres.go
  • internal/credentials/resolver.go
  • internal/deploy/frontend.go
  • internal/email/templates.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/gosec-bump-retire-nosec

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cristim added a commit that referenced this pull request Jul 16, 2026
PR #1384 bumps the CI Security Scanning gosec pin to v2.28.0; align the
pre-commit hook so local and CI verdicts stay in agreement. Updates the
GOSEC_VERSION pin in scripts/gosec-hook.sh and the doc mentions in the
hook config comment.

Re-verified with v2.28.0: auto-install to the versioned cache dir works;
clean pass on cmd/ + pkg/ + providers/aws in ~1.6 s warm; deliberate G501
(crypto/md5) scratch file fails with exit 1; clean pass restored after
removal.
cristim added a commit that referenced this pull request Jul 16, 2026
PR #1384 bumps the CI Security Scanning gosec pin to v2.28.0; align the
pre-commit hook so local and CI verdicts stay in agreement. Updates the
GOSEC_VERSION pin in scripts/gosec-hook.sh and the doc mentions in the
hook config comment.

Re-verified with v2.28.0: auto-install to the versioned cache dir works;
clean pass on cmd/ + pkg/ + providers/aws in ~1.6 s warm; deliberate G501
(crypto/md5) scratch file fails with exit 1; clean pass restored after
removal.
cristim added a commit that referenced this pull request Jul 16, 2026
PR #1384 bumps the CI Security Scanning gosec pin to v2.28.0; align the
pre-commit hook so local and CI verdicts stay in agreement. Updates the
GOSEC_VERSION pin in scripts/gosec-hook.sh and the doc mentions in the
hook config comment.

Re-verified with v2.28.0: auto-install to the versioned cache dir works;
clean pass on cmd/ + pkg/ + providers/aws in ~1.6 s warm; deliberate G501
(crypto/md5) scratch file fails with exit 1; clean pass restored after
removal.
cristim added 2 commits July 17, 2026 19:27
The latest securego/gosec release is v2.28.0. Update the self-install
in the Security Scanning job so CI runs the current version.

PR #1376 (pre-commit gosec hook) is still open; a comment has been
posted there asking to align its pin to v2.28.0 when it lands.
Tested each annotation by temporarily removing it and running gosec
v2.28.0 on the owning module. Findings that no longer appear indicate
the rule was removed or no longer triggers on the pattern.

Retired (finding gone in v2.28.0):
- G201 x6: postgres_analytics.go (x4) and analytics_postgres.go (x2)
  -- gosec v2.28.0 removed the G201 SQL-format-string rule entirely
- G101 x2: email/templates.go -- gosec no longer flags email copy text
  containing the word "password" as a hardcoded credential
- G101 x1: credentials/resolver.go:27 (azure_client_secret constant) --
  gosec no longer flags this string; sibling GCP constants still flagged
- G122 x1 (partial): deploy/frontend.go annotation updated from
  G304,G122 to G304 -- G122 is not a recognized rule in v2.28.0

Kept (finding still returned after removing the annotation):
- G302,G304: pkg/common/audit.go -- 0644 file permission + path variable
- G404: pkg/retry/exponential.go and providers/aws/recommendations/ratelimiter.go
- G115, G101, G704, G703, G304, G204, G117, G505, G706, G104, G703,
  G705: all remaining annotations (verified per-module)

Full verification: gosec v2.28.0 on all 6 modules -> 0 findings;
go build ./... and go vet ./... clean; tests pass on all touched packages.
@cristim
cristim force-pushed the ci/gosec-bump-retire-nosec branch from b58daeb to e128700 Compare July 17, 2026 16:28
@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 8cd51ab into main Jul 17, 2026
19 checks passed
@cristim
cristim deleted the ci/gosec-bump-retire-nosec branch July 27, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/s Hours impact/internal Team-internal only priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/chore Maintenance / non-user-visible urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant